Menu

segfault in bio_readhdr (pocketsphinx, VS9)

Help
2010-04-08
2012-09-22
  • Fabrizio Morbini

    Hi, i'm trying to use pocketsphinx with visual studio 9.
    pocketsphinx 0.6 compiles fine (with sphinxbase 0.6) but when i execute
    pocketsphinx_batch.exe on the following configuration file:
    <start cfg="" file="">
    -hmm ../pocketsphinx/model/hmm/en/tidigits
    -lm ../pocketsphinx/model/lm/en/tidigits.DMP
    -dict ../pocketsphinx/model/lm/en/tidigits.dic
    -ctl ../pocketsphinx/test/data/tidigits/tidigits.ctl
    -cepdir ../pocketsphinx/test/data/tidigits
    -hyp testest.match
    -samprate 16000
    <end cfg="" file=""> </end></start>

    I get a segmentation fault in the first fgets of the function bio_readhdr when
    trying to read the file ../../model/hmm/en/tidigits/transition_matrices. The
    output is:

    INFO: acmod.c(238): Parsed model-specific feature parameters from
    ../../model/hmm/en/tidigits/feat.params
    INFO: fe_interface.c(288): You are using the internal mechanism to generate
    the seed.
    INFO: feat.c(848): Initializing feature stream to type: 's2_4x', ceplen=13,
    CMN='current', VARNORM='no', AGC='none'
    INFO: cmn.c(142): mean= 12.00, mean= 0.0
    INFO: mdef.c(520): Reading model definition: ../../model/hmm/en/tidigits/mdef
    INFO: mdef.c(531): Found byte-order mark BMDF, assuming this is a binary mdef
    file
    INFO: bin_mdef.c(330): Reading binary model definition:
    ../../model/hmm/en/tidigits/mdef
    INFO: bin_mdef.c(508): 34 CI-phone, 396 CD-phone, 5 emitstate/phone, 170 CI-
    sen, 670 Sen, 222 Sen-Seq
    INFO: tmat.c(205): Reading HMM transition probability matrices:
    ../../model/hmm/en/tidigits/transition_matrices

    The same cfg file above works fine with the executable created in cygwin (from
    the same source code).

    Thanks,
    fabrizio.

     
  • Nickolay V. Shmyrev

    Hello

    Thanks for your report. Can you please provide a stacktrace for the segfault.

     
  • Fabrizio Morbini

    here is the call stack displayed by VS9 when the problem happens:

    ntdll.dll!77228c39()

    ntdll.dll!77228b48()

    sphinxbase.dll!_lock_file(_iobuf * pf=0x005f0480) Line 242 C
    sphinxbase.dll!fgets(char * string=0x0018b854, int count=16384, _iobuf *
    str=0x005f0480) Line 71 + 0x9 bytes C
    sphinxbase.dll!bio_readhdr(_iobuf * fp=0x005f0480, char * * *
    argname=0x0018f980, char * * * argval=0x0018f974, int * swap=0x0018f9e0) Line
    163 + 0x15 bytes C
    pocketsphinx.dll!tmat_init(const char * file_name=0x00344928, logmath_s *
    lmath=0x00344318, double tpfloor=9.9999997473787516e-005, int breport=1) Line
    215 + 0x1e bytes C
    pocketsphinx.dll!acmod_init_am(acmod_s * acmod=0x00344a50) Line 100 + 0x41
    bytes C
    pocketsphinx.dll!acmod_init(cmd_ln_s * config=0x00344230, logmath_s *
    lmath=0x00344318, fe_s * fe=0x00000000, feat_s * fcb=0x00000000) Line 269 +
    0x9 bytes C
    pocketsphinx.dll!ps_reinit(ps_decoder_s * ps=0x00344270, cmd_ln_s *
    config=0x00344230) Line 234 + 0x16 bytes C
    pocketsphinx.dll!ps_init(cmd_ln_s * config=0x00344230) Line 300 + 0xd bytes C
    pocketsphinx_batch.exe!main(int argc=2, char * * argv=0x002f1e98) Line 625 +
    0xc bytes C
    pocketsphinx_batch.exe!__tmainCRTStartup() Line 266 + 0x19 bytes C
    pocketsphinx_batch.exe!mainCRTStartup() Line 182 C
    kernel32.dll!76d03677()
    ntdll.dll!77229d72()
    ntdll.dll!77229d45()
    pocketsphinx.dll!UnDecorator::getDecoratedName() Line 987 + 0x14 bytes C++

     
  • Nickolay V. Shmyrev

    Hm, strange

    It works with VC2008 ExpressEdition here. Are you sure you didn't corrupt the
    pocketsphinx archive somehow?

     
  • Fabrizio Morbini

    Hi Nickolay, the problem was in the VS configuration file. I had changed the
    property:
    Configuration properties->C/C++->Code generation->Runtime library
    from: Multi-threaded Debug DLL (/MDd)
    to: Multi-threaded Debug (/MTd)

    because i wanted to remove the dependency on VS runtime dll.

    apparently that breaks pocketsphinx or requires some other option to be
    changed to make it work.

    thanks.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.