I downloaded cmusphinx src from svn and am trying to build cmuclmtk on OSX
10.6.4. My end goal is to train SLMs for data locally rather than using the
web-based lm-tool. My problem is that I get segmentation faults when I run
text2idngram.
I had this error first processing my own input text and now with the test
script in cmuclmtk/test/. See output below:
Thank you for your reply. This is my first time with gdb, I apologize for
excessive ignorance.
Here are the results of my gdb backtrace:
gdb/usr/local/bin/text2idngramGNUgdb6.3.50-20050815(Appleversiongdb-1472)(WedJul2110:53:12UTC2010)Copyright2004FreeSoftwareFoundation,Inc.GDBisfreesoftware,coveredbytheGNUGeneralPublicLicense,andyouarewelcometochangeitand/ordistributecopiesofitundercertainconditions.Type"show copying"toseetheconditions.ThereisabsolutelynowarrantyforGDB.Type"show warranty"fordetails.ThisGDBwasconfiguredas"x86_64-apple-darwin"...Readingsymbolsforsharedlibraries.warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/ac_hash.o"-nodebuginformationavailablefor"ac_hash.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/ac_lmfunc_impl.o"-nodebuginformationavailablefor"ac_lmfunc_impl.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/ac_parsetext.o"-nodebuginformationavailablefor"ac_parsetext.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/parse_line.o"-nodebuginformationavailablefor"parse_line.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/pc_comline.o"-nodebuginformationavailablefor"pc_comline.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/pc_message.o"-nodebuginformationavailablefor"pc_message.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/quit.o"-nodebuginformationavailablefor"quit.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rd_wlist_arry.o"-nodebuginformationavailablefor"rd_wlist_arry.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/read_voc.o"-nodebuginformationavailablefor"read_voc.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/read_wlist_si.o"-nodebuginformationavailablefor"read_wlist_si.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_calloc.o"-nodebuginformationavailablefor"rr_calloc.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_feof.o"-nodebuginformationavailablefor"rr_feof.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_fexists.o"-nodebuginformationavailablefor"rr_fexists.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_filesize.o"-nodebuginformationavailablefor"rr_filesize.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_fopen.o"-nodebuginformationavailablefor"rr_fopen.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_fread.o"-nodebuginformationavailablefor"rr_fread.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_fseek.o"-nodebuginformationavailablefor"rr_fseek.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_fwrite.o"-nodebuginformationavailablefor"rr_fwrite.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_iopen.o"-nodebuginformationavailablefor"rr_iopen.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_malloc.o"-nodebuginformationavailablefor"rr_malloc.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/rr_oopen.o"-nodebuginformationavailablefor"rr_oopen.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/salloc.o"-nodebuginformationavailablefor"salloc.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/sih.o"-nodebuginformationavailablefor"sih.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/libs.a/win32compat.o"-nodebuginformationavailablefor"win32compat.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/arpa_bo_ng_prob.o"-nodebuginformationavailablefor"arpa_bo_ng_prob.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/bo_ng_prob.o"-nodebuginformationavailablefor"bo_ng_prob.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/calc_mem_req.o"-nodebuginformationavailablefor"calc_mem_req.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/calc_prob_of.o"-nodebuginformationavailablefor"calc_prob_of.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/compute_back_off.o"-nodebuginformationavailablefor"compute_back_off.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/compute_discount.o"-nodebuginformationavailablefor"compute_discount.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/compute_unigram.o"-nodebuginformationavailablefor"compute_unigram.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/counts.o"-nodebuginformationavailablefor"counts.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/decode_bo_case.o"-nodebuginformationavailablefor"decode_bo_case.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/disc_meth.o"-nodebuginformationavailablefor"disc_meth.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/disc_meth_absolute.o"-nodebuginformationavailablefor"disc_meth_absolute.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/disc_meth_good_turing.o"-nodebuginformationavailablefor"disc_meth_good_turing.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/disc_meth_linear.o"-nodebuginformationavailablefor"disc_meth_linear.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/disc_meth_witten_bell.o"-nodebuginformationavailablefor"disc_meth_witten_bell.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/disc_method_linear.o"-nodebuginformationavailablefor"disc_method_linear.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/gen_fb_list.o"-nodebuginformationavailablefor"gen_fb_list.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/generate.o"-nodebuginformationavailablefor"generate.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/genrand.o"-nodebuginformationavailablefor"genrand.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/get_ngram.o"-nodebuginformationavailablefor"get_ngram.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/guess_mem.o"-nodebuginformationavailablefor"guess_mem.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/idngram2lm.o"-nodebuginformationavailablefor"idngram2lm.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/increment_context.o"-nodebuginformationavailablefor"increment_context.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/load_lm.o"-nodebuginformationavailablefor"load_lm.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/lookup_index_of.o"-nodebuginformationavailablefor"lookup_index_of.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/miscella.o"-nodebuginformationavailablefor"miscella.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/ngram.o"-nodebuginformationavailablefor"ngram.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/num_of_types.o"-nodebuginformationavailablefor"num_of_types.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/parse_comline.o"-nodebuginformationavailablefor"parse_comline.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/perplexity.o"-nodebuginformationavailablefor"perplexity.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/short_indices.o"-nodebuginformationavailablefor"short_indices.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/stats.o"-nodebuginformationavailablefor"stats.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/two_byte_alphas.o"-nodebuginformationavailablefor"two_byte_alphas.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/validate.o"-nodebuginformationavailablefor"validate.c".warning:Couldnotfindobjectfile"/Users/rtwomey/code/cmusphinx/cmuclmtk/src/.libs/libcmuclmtk.lax/liblmest.a/write_lms.o"-nodebuginformationavailablefor"write_lms.c"...done(gdb)run-vocabEnglish/emma11.vocab-idngramEnglish/emma11.txt.filtered.idngram.32bits<English/emma11.txt.filteredStartingprogram:/usr/local/bin/text2idngram-vocabEnglish/emma11.vocab-idngramEnglish/emma11.txt.filtered.idngram.32bits<English/emma11.txt.filteredReadingsymbolsforsharedlibraries++.donetext2idngramVocab:English/emma11.vocabOutputidngram:English/emma11.txt.filtered.idngram.32bitsN-grambuffersize:100Hashtablesize:2000000Tempdirectory:cmuclmtk-aFUQGVMaxopenfiles:20FOFsize:10n:3Initialisinghashtable...Readingvocabulary...Allocatingmemoryforthen-grambuffer...Readingtextintothen-grambuffer...20,000n-gramsprocessedforeach".",1,000,000foreachline.........Sortingn-grams...ProgramreceivedsignalEXC_BAD_ACCESS,Couldnotaccessmemory.Reason:KERN_INVALID_ADDRESSataddress:0x000000005fbff1600x00007fff83506180instrlen()(gdb)bt#0 0x00007fff83506180 in strlen ()#1 0x00007fff83511a7c in __vfprintf ()#2 0x00007fff83544a07 in vsnprintf ()#3 0x00007fff83544886 in __sprintf_chk ()#4 0x0000000100006d31 in read_txt2ngram_buffer ()#5 0x0000000100002635 in main (argc=1, argv=<value temporarily unavailable, due to optimizations>) at text2idngram.c:196(gdb)btfull#0 0x00007fff83506180 in strlen ()Nosymboltableinfoavailable.#1 0x00007fff83511a7c in __vfprintf ()Nosymboltableinfoavailable.#2 0x00007fff83544a07 in vsnprintf ()Nosymboltableinfoavailable.#3 0x00007fff83544886 in __sprintf_chk ()Nosymboltableinfoavailable.#4 0x0000000100006d31 in read_txt2ngram_buffer ()Nosymboltableinfoavailable.#5 0x0000000100002635 in main (argc=1, argv=<value temporarily unavailable, due to optimizations>) at text2idngram.c:196vocab_filename=0x100100080"English/emma11.vocab"idngram_filename=<valuetemporarilyunavailable,duetooptimizations>outfile=(FILE*)0x7fff70629ec0tempfiles_directory="cmuclmtk-aFUQGV",'\0'<repeats489times>,"???_?\000\000p?_?\000\000\006\003???\000\000??_?\000\000?&?_?",'\0'<repeats18times>,"???_?\000\000??_?\000\000`??_?\000\000?\005?_?\000\000?N?L\000\000\000\000?\024\n\000?\000\000G?\000\000d#҃?#\027\031^?A?\034W=OT???e??W?D\027??-ċj\021??\031?\\\024\022#)\030??U?~\005??\001%ӧ?U??\037??\034Oϡ???x\t?"...verbosity=2buffer_size=8333300max_files=20fof_size=10temp_file_root=0x5fbff160<Address0x5fbff160outofbounds>temp_file_ext=0x1001000d0""help_flag=<valuetemporarilyunavailable,duetooptimizations>vocabulary={size=2000003,chain=0x100200000}(gdb)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That information is a great help. I've just committed a small update to check
mkdtemp result and print error message. Please update and run it again, it's
interesting why it fails.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I move the quit(-1, "Failed to create temporary folder: %s\n",
strerror(errno)) out of the if statement so it immediately gets called after
mkdtemp, I get:
Failed to create temporary folder: No such file or directory
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think the reason is in mkdtemp, it looks like it works as expected and
creates non-null result. The reason might be in memory corruption somewhere
later.
I think you need ot continue debugging and try to get more meaningful
backtrace. Your one was created without debuging symbols and lacks important
information. You need to compile the application using -g -O0 options to get
proper backtrace. See the docs linked above for more details.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I downloaded cmusphinx src from svn and am trying to build cmuclmtk on OSX
10.6.4. My end goal is to train SLMs for data locally rather than using the
web-based lm-tool. My problem is that I get segmentation faults when I run
text2idngram.
I had this error first processing my own input text and now with the test
script in cmuclmtk/test/. See output below:
As far as I could tell, the build went fine. (no errors). Has anyone built
this successfully in OS X? Is it a 32 bit/64bit kind of problem?
Has anyone had problems with text2idngram built on other systems recently?
Thanks!
Robert
oh and fyi text2idngram.log doesn't give much info... :
Hello
Nobody uses OSX as development platform here
No, I don't think so
No, everything works as expected
It must be a bug. To help us solve it you need to collect stack trace from
gdb. See
http://live.gnome.org/GettingTraces/Details
For more detailed information see gdb documentation
http://sourceware.org/gdb/current/onlinedocs/gdb/Backtrace.html#Backtrace
Thank you for your reply. This is my first time with gdb, I apologize for
excessive ignorance.
Here are the results of my gdb backtrace:
OK. So looking through the code a bit it seems the problem is at line163 in
text2idngram.c, the
call:
If I change
to
and recompile, the tests all complete fine.
Is this a bug or a problem with permissions on making the tmp directory?
Hello.
That information is a great help. I've just committed a small update to check
mkdtemp result and print error message. Please update and run it again, it's
interesting why it fails.
Hmmmm... neat. I have updated, compiled and run, but I don't get any error
message dumped to the terminal.
I actually inserted a check for temp_file_root == NULL earlier as well, it
seems like mkdtemp isn't returning NULL but it isn't anything valid...
If I move the quit(-1, "Failed to create temporary folder: %s\n",
strerror(errno)) out of the if statement so it immediately gets called after
mkdtemp, I get:
Hello.
Thanks for your help in debugging this issue.
I don't think the reason is in mkdtemp, it looks like it works as expected and
creates non-null result. The reason might be in memory corruption somewhere
later.
I think you need ot continue debugging and try to get more meaningful
backtrace. Your one was created without debuging symbols and lacks important
information. You need to compile the application using -g -O0 options to get
proper backtrace. See the docs linked above for more details.
Hm, I was able to reproduce this issue on 64-bit machine. Will fix it soon!
Fixed in trunk, please update.
That fixes it for me--thanks!