Hi Hieu,
It is still segfaulting, but in another place, I think. Have you tried
the files in the archive I supplied in another mail?
Output of gdb:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff63c9700 (LWP 318)]
0x00007fffe4043e70 in ?? ()
(gdb) bt
#0 0x00007fffe4043e70 in ?? ()
#1 0x00007ffff7b91a7c in Delete () at mert/Singleton.h:20
#2 Scorer::~Scorer (this=0x7fffe0033af0, __in_chrg=<optimized out>) at
mert/Scorer.cpp:21
#3 0x00007ffff7b7e19a in ~StatisticsBasedScorer (this=<optimized out>,
__in_chrg=<optimized out>) at mert/StatisticsBasedScorer.h:21
#4 BleuScorer::~BleuScorer (this=0x7fffe0033af0, __in_chrg=<optimized
out>) at mert/BleuScorer.cpp:44
#5 0x00007ffff7bb7b94 in MergeScorer::calculateScore (this=<optimized
out>, comps=...) at mert/MergeScorer.cpp:81
#6 0x00007ffff7bc5c82 in StatisticsBasedScorer::score (this=0x612630,
candidates=..., diffs=..., scores=...)
at mert/StatisticsBasedScorer.cpp:95
#7 0x00007ffff7b93a65 in Optimizer::GetIncStatScore (this=<optimized
out>, thefirst=..., thediffs=...) at mert/Optimizer.cpp:367
#8 0x00007ffff7b957cf in Optimizer::LineOptimize (this=0x19ff100,
origin=..., direction=..., bestpoint=...) at mert/Optimizer.cpp:237
#9 0x00007ffff7b964c4 in SimpleOptimizer::TrueRun (this=0x19ff100,
P=...) at mert/Optimizer.cpp:408
#10 0x00007ffff7b94715 in Optimizer::Run (this=0x19ff100, P=...) at
mert/Optimizer.cpp:350
#11 0x0000000000404551 in (anonymous namespace)::OptimizationTask::Run
(this=0x19ff140) at mert/mert.cpp:55
#12 0x000000000040c954 in Moses::ThreadPool::Execute
(this=0x7fffffffda40) at moses/src/ThreadPool.cpp:58
#13 0x00007ffff79328bb in thread_proxy () from
/usr/lib64/libboost_thread.so.1.36.0
#14 0x00007ffff6b6b7b6 in start_thread () from /lib64/libpthread.so.0
#15 0x00007ffff68c7c6d in clone () from /lib64/libc.so.6
#16 0x0000000000000000 in ?? ()
W dniu 26.06.2012 19:46, Hieu Hoang pisze:
> i think the main problem is in Vocab, which accesses the m_vocab map in
> multiple threads. It's exactly the same situation as FactorCollection.
>
> marcin - can you git pull and try again. I've tried to make it
> thread-safe but the problem doesn't occur with me so i can't test it
>
> https://github.com/moses-smt/mosesdecoder/commit/153e80053c4319501323bc15ea66bb668f1ef542
>
> On 26/06/2012 03:58, Barry Haddow wrote:
>> Hi
>>
>> The problem is caused by the use of the Singleton class - which is marked as
>> thread-unsafe in the header.
>>
>> In MergeScorer, a local instance of BleuScorer is created and then destroyed.
>> BleuScorer descends from Scorer, which has a handle to the thread-unsafe
>> "singleton" Vocabulary.
>>
>> There's been a lot of code changes since I last looked at this, but I would
>> question whether MergeScorer needs to create and destroy a BleuScorer every
>> time it does the scoring. Can't it just re-use the same instance? I also
>> wonder why code known to be thread-unsafe is in a multi-threaded application,
>>
>> cheers - Barry
>>
>> On Tuesday 26 June 2012 08:50:59 Marcin Junczys-Dowmunt wrote:
>>> Hi Tom,
>>> Yes, checked a few minutes ago with the latest changes. Error still
>>> occurring. I have prepared a tarball with the necessary files (*.dat
>>> *.opt merge.init) and put it here:
>>>
>>> http://junczys.ayz.pl/mertsegfault.tgz
>>>
>>> The error occurs with the following command:
>>>
>>> mert -d 14 --scconfig case:true --sctype MERGE --ffile run1.features.dat
>>> --scfile run1.scores.dat --ifile run1.init.opt -n 20 --threads 8
>>>
>>> Or any other number of threads above 1, works with 1 thread, though.
>>>
>>> 26/6/2012, "Tom Hoar"<[email protected]> napisał/a:
>>>> Marcin,
>>>>
>>>> There have been some very recent changes to mert. Are you using an
>>>> update after the changes below?
>>>>
>>>> Tom
>>>>
>>>>
>>>> -------- Original Message --------
>>>> Subject: Re: [Moses-support] mert failure
>>>> Date: Mon, 25 Jun 2012 09:52:12 -0400
>>>> From: Hieu Hoang<[email protected]>
>>>> To: [email protected]
>>>>
>>>>
>>>> thanks. gcc version-specific error. Fixed
>>>>
>>>> https://github.com/moses-smt/mosesdecoder/commit/8498b17a41e403020897b491
>>>> fa63a2c2845ab088
>>>>
>>>>
>>>> On Mon, 25 Jun 2012 20:25:25 +0200, Marcin Junczys-Dowmunt
>>>>
>>>> <[email protected]> wrote:
>>>>> Yes, I do.
>>>>>
>>>>> W dniu 25.06.2012 20:11, Christophe Servan pisze:
>>>>>> Hi Marcin,
>>>>>> Do you use the script mert-moses-multi.pl when you use the option
>>>>>> "-sctype MERGE" ?
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Christophe
>>>>> _______________________________________________
>>>>> Moses-support mailing list
>>>>> [email protected]
>>>>> http://mailman.mit.edu/mailman/listinfo/moses-support
>>> _______________________________________________
>>> Moses-support mailing list
>>> [email protected]
>>> http://mailman.mit.edu/mailman/listinfo/moses-support
>>>
>>
>> --
>> Barry Haddow
>> University of Edinburgh
>> +44 (0) 131 651 3173
>>
> _______________________________________________
> Moses-support mailing list
> [email protected]
> http://mailman.mit.edu/mailman/listinfo/moses-support
>
--
dr inż. Marcin Junczys-Dowmunt
Uniwersytet im. Adama Mickiewicza
Wydział Matematyki i Informatyki
ul. Umultowska 87
61-614 Poznań
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support