Marcin Junczys-Dowmunt <junczys@...> writes:

> Revision d2d508184e35909aa5da901b81bb70f10f7794c7 breaks my compact 
> reordering model, but at runtime and only if you do a clean build 
> without any build artifacts from earlier compilations. It segfaults 
> during loading in a weird low-level place.

Hi Marcin,

strangely enough, the segfault happens in the default constructor of
unsigned char (no idea why though), which is called during a resize. I could
fix it by passing the default value 0 to the resize function.

Here's the last bit of the backtrace for anyone interested; maybe someone
can enlighten me why it's segfaulting:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004c9df5 in _S_construct<unsigned char> (__p=0x7ffff7ff3415
"\377\003^\255U\v(@\021\003\034\200\206\066\004`\"\221Td\224") at
/usr/include/c++/4.7/bits/alloc_traits.h:263
263             { ::new((void*)__p) _Tp(std::forward<_Args>(__args)...); }
(gdb) bt
#0  0x00000000004c9df5 in _S_construct<unsigned char> (__p=0x7ffff7ff3415
"\377\003^\255U\v(@\021\003\034\200\206\066\004`\"\221Td\224") at
/usr/include/c++/4.7/bits/alloc_traits.h:263
#1  construct<unsigned char> (__p=0x7ffff7ff3415
"\377\003^\255U\v(@\021\003\034\200\206\066\004`\"\221Td\224", __a=...) at
/usr/include/c++/4.7/bits/alloc_traits.h:395
#2  __uninitialized_default_n_a<unsigned char*, unsigned long,
Moses::MmapAllocator<unsigned char> > (__n=<optimized out>,
__first=<optimized out>, __alloc=...) at
/usr/include/c++/4.7/bits/stl_uninitialized.h:594
#3  std::vector<unsigned char, Moses::MmapAllocator<unsigned char>
>::_M_default_append (this=this@entry=0x7fffffffc870, __n=<optimized out>)
at /usr/include/c++/4.7/bits/vector.tcc:558
#4  0x00000000004caba3 in resize (__new_size=<optimized out>,
this=0x7fffffffc870) at /usr/include/c++/4.7/bits/stl_vector.h:647
#5  Moses::StringVector<unsigned char, unsigned long,
Moses::MmapAllocator>::loadCharArray (this=this@entry=0x9edac8, c=...,
in=in@entry=0x9ee5d0, map=<optimized out>) at
moses/TranslationModel/CompactPT/StringVector.h:245

best,
Rico


_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to