mynlp / enju

English HPSG parser
Other
51 stars 15 forks source link

Running gives Segmentation Fault (related to coerceHash) #1

Closed frankier closed 7 years ago

frankier commented 7 years ago

Hi,

On Ubuntu 16.10, after following the instructions to compile and then running enju, I get a Segmentation Fault. If I reconfigure with CFLAGS="-g -O0 -DDEBUG" CPPFLAGS="-DDEBUG" ./configure and compile, and run through gdb, I can get the following stack trace:

$ gdb enju
(gdb) bt
#0  std::tr1::_Hashtable<int, std::pair<int const, lilfes::coercode*>, std::allocator<std::pair<int const, lilfes::coercode*> >, std::_Select1st<std::pair<int const, lilfes::coercode*> >, std::equal_to<int>, std::tr1::hash<int>, std::tr1::__detail::_Mod_range_hashing, std::tr1::__detail::_Default_ranged_hash, std::tr1::__detail::_Prime_rehash_policy, false, false, true>::find (this=<optimised out>, this=<optimised out>, __k=<optimised out>) at /usr/include/c++/6/tr1/hashtable.h:698
#1  lilfes::coerceDataAdd (b=1, a=1) at ../include/liblilfes/ftype.h:637
#2  lilfes::CompileType (unifiee=unifiee@entry=0x555555977660, unifier=unifier@entry=0x555555977660) at compile.cpp:272
#3  0x000055555562b294 in lilfes::type::Fix (this=this@entry=0x555555977660, displayError=displayError@entry=true) at ftype.cpp:986
#4  0x000055555562cf7d in lilfes::init () at ftype.cpp:114
#5  0x00005555556b22f8 in lilfes::InitTermBase::PerformAll (table=0x555555937780 <_ZN6lilfesL2IFE>) at initial.cpp:33
#6  lilfes::Initializer::PerformAll () at initial.cpp:52
#7  0x0000555555577f5a in main (argc=1, argv=0x7fffffffca18) at enju.cc:32

As far as I can see, I think the problem could be that coerceHash is not being initialised correctly (or perhaps not linked correctly)?

Please let me know if you need any more information.

Thanks for your work on enju, Frankie

miyao-yusuke commented 7 years ago

It appears this error is specific to Ubuntu 16. The program works fine on Ubuntu 14 and 15. Maybe related to the version of the compiler. Needs further investigation.

kkos commented 7 years ago

I have installed enju into Ubuntu 16.04 and 16.10. It works on 16.04 (g++ version 5.4.0). A compile error occurred on 16.10 (g++ version 6.2.0)

depbase=`echo DataConv.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I.  -I../ll/include  -fstrict-aliasing -W -Wall -g -O2 -DHAVE_HASH_MAP -DHAVE_EXT_HASH_MAP -MT DataConv.o -MD -MP -MF $depbase.Tpo -c -o DataConv.o DataConv.cc &&\
mv -f $depbase.Tpo $depbase.Po
DataConv.cc: In function ‘lilfes::type* up::conv::convParseStatus(up::ParseStatus)’:
DataConv.cc:10:117: error: cannot convert ‘bool’ to ‘lilfes::type*’ in return
 parse_status/1: parser module \"mayz:parser\" not loaded yet"); return false; }
                                                                        ^~~~~
Makefile:748: ターゲット 'DataConv.o' のレシピで失敗しました
make[2]: *** [DataConv.o] エラー 1
make[2]: ディレクトリ '/home/kosako/work/enju/mayz-src' から出ます
Makefile:550: ターゲット 'all' のレシピで失敗しました
sumire-uematsu commented 7 years ago

The branch Issue2 also fixed the additional problem of DataConv.cc mentioned above. Now the master branch would work on ubuntu 16.10