Problems with Pocketsphinx demo project, segmentation fault?

I'm new here and hope I can get some help on an Android app using Pocketsphinx (with NDK).

I'm doing this work for a school project where we are building GPS and we wanted to add some kind of offline voice recognition, Pocketsphinx seems to be fine, so I downloaded the sphinxbase and pocketsphinx library and also the demo project they have.

After quietly a lot of fixing and trying (installing and getting used to Ubuntu first, fixing errors I got when trying to compile libraries, errors from trying to build libraries with the NDK to get a .so file, problems with a project not having the correct Android libraries, and converting it to project 2.1 for testing on my phone), I was able to run the program (although for some reason I have to stop at it 2 ro 3 times before it appears on my phone).

My problem comes when I try to use the demo project, for those who don't know what it looks like just a text area and a button, you press the button to start recording, and then you speak and enter the speech should appear as text in the area like as soon as I press this button, it closes. It doesn't crash, the process dies, but I don't get the stack. From what I can see from the debug information, it starts the write process, but then it crashes after that, I think it crashes when it is about to start working with native code.

What I can understand from the obscure debug information I get is that the Native environment is closed, I get a message from debug with a Zygote tag and the message "Process X terminated by signal (11)". From my search, I learned that this most likely means a segmentation fault (SIGSEGV).

This is my understanding, I have no real understanding of what segmentation fault means or how to solve this problem. Below I will add a part of the log, this is what I see before the program dies, if you need more information from the logs tell me what and how to get it as I am very unsure what information will be useful.

I am working on Ubuntu 11.10 with Eclipse and Android pluggins, my phone is a Sony Ericsson Xperia if applicable and running on some Android 2.1 version from Sony Ericsson, the sphinx libraries are the latest from the Sphinx projects website.

Hope someone here can give me some way to continue working on this, I'm basically a Java developer, but I've done some work in C ++, so if I need to dig C code too, but I hope it doesn't get that far.

Here is a log extract:

03-20 11:37:22.676: D/edu.cmu.pocketsphinx.demo.RecognizerTask(385): signalling START
03-20 11:37:22.676: D/edu.cmu.pocketsphinx.demo.RecognizerTask(385): signalled START
03-20 11:37:22.676: D/edu.cmu.pocketsphinx.demo.RecognizerTask(385): gotSTART
03-20 11:37:22.676: D/edu.cmu.pocketsphinx.demo.RecognizerTask(385): START
03-20 11:37:22.806: D/edu.cmu.pocketsphinx.demo.PocketSphinxDemo(385): Showing Dialog
03-20 11:37:22.826: I/AudioHardwareQSD(1066): AudioHardware PCM record is going to standby.
03-20 11:37:22.836: I/AudioHardwareQSD(1066): AudioHardware PCM record is going to standby.
03-20 11:37:22.836: D/dalvikvm(385): +++ not scanning '/system/lib/' for 'Decoder_startUtt__SWIG_0' (wrong CL)
03-20 11:37:22.836: D/dalvikvm(385): +++ not scanning '/system/lib/' for 'Decoder_startUtt__SWIG_0' (wrong CL)
03-20 11:37:22.846: I/DEBUG(1063): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-20 11:37:22.846: I/DEBUG(1063): Build fingerprint: 'SEMC/X10i_1234-9753/X10i/es209ra:2.1-update1/2.1.A.0.435/TP7d:user/release-keys'
03-20 11:37:22.846: I/DEBUG(1063): pid: 385, tid: 395  >>> edu.cmu.pocketsphinx.demo <<<
03-20 11:37:22.846: I/DEBUG(1063): signal 11 (SIGSEGV), fault addr 0000001c
03-20 11:37:22.846: I/DEBUG(1063):  r0 00000000  r1 00000000  r2 00000154  r3 8c6d703c
03-20 11:37:22.846: I/DEBUG(1063):  r4 00000000  r5 81356e14  r6 475c8d6c  r7 00000000
03-20 11:37:22.846: I/DEBUG(1063):  r8 475c8d6c  r9 00000154  10 43117f40  fp 00123e08
03-20 11:37:22.846: I/DEBUG(1063):  ip 8130c191  sp 475c8d18  lr 8130c1a1  pc 8130d568  cpsr 40000030
03-20 11:37:22.866: I/DEBUG(1063):          #00  pc 0000d568  /data/data/edu.cmu.pocketsphinx.demo/lib/
03-20 11:37:22.866: I/DEBUG(1063):          #01  pc 0000c19c  /data/data/edu.cmu.pocketsphinx.demo/lib/
03-20 11:37:22.876: I/DEBUG(1063):          #02  pc 0000edb4  /system/lib/
03-20 11:37:22.876: I/DEBUG(1063): code around pc:
03-20 11:37:22.876: I/DEBUG(1063): 8130d558 447db089 1c0458ab 681b1c0f 93074691 
03-20 11:37:22.876: I/DEBUG(1063): 8130d568 2b0069c3 e0d3d100 36301c06 f0331c30 
03-20 11:37:22.876: I/DEBUG(1063): code around lr:
03-20 11:37:22.876: I/DEBUG(1063): 8130c190 b083b500 21001c10 93019200 f9d6f001 
03-20 11:37:22.876: I/DEBUG(1063): 8130c1a0 bd00b003 b084b510 93019200 23001c10 
03-20 11:37:22.876: I/DEBUG(1063): 8130c1b0 93022400 f0009403 f030fe3b 9903fc47 
03-20 11:37:22.876: I/DEBUG(1063): stack:
03-20 11:37:22.876: I/DEBUG(1063):     475c8cd8  7fffffff  
03-20 11:37:22.876: I/DEBUG(1063):     475c8cdc  ab227f0f  /system/lib/
03-20 11:37:22.876: I/DEBUG(1063):     475c8ce0  afe3db7c  
03-20 11:37:22.876: I/DEBUG(1063):     475c8ce4  afe0f130  /system/lib/
03-20 11:37:22.876: I/DEBUG(1063):     475c8ce8  afe3db7c  
03-20 11:37:22.876: I/DEBUG(1063):     475c8cec  afe0f130  /system/lib/
03-20 11:37:22.876: I/DEBUG(1063):     475c8cf0  00000000  
03-20 11:37:22.876: I/DEBUG(1063):     475c8cf4  afe0f048  /system/lib/
03-20 11:37:22.876: I/DEBUG(1063):     475c8cf8  afe3d9c4  
03-20 11:37:22.876: I/DEBUG(1063):     475c8cfc  00002004  
03-20 11:37:22.876: I/DEBUG(1063):     475c8d00  00000001  
03-20 11:37:22.876: I/DEBUG(1063):     475c8d04  078bcd20  
03-20 11:37:22.876: I/DEBUG(1063):     475c8d08  00000209  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d0c  b0000463  /system/bin/linker
03-20 11:37:22.886: I/DEBUG(1063):     475c8d10  df002777  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d14  e3a070ad  
03-20 11:37:22.886: I/DEBUG(1063): #00 475c8d18  00000000  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d1c  afe0f048  /system/lib/
03-20 11:37:22.886: I/DEBUG(1063):     475c8d20  afe3d9c4  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d24  0014bac0  [heap]
03-20 11:37:22.886: I/DEBUG(1063):     475c8d28  003952b8  [heap]
03-20 11:37:22.886: I/DEBUG(1063):     475c8d2c  0000a000  [heap]
03-20 11:37:22.886: I/DEBUG(1063):     475c8d30  ad00ef40  /system/lib/
03-20 11:37:22.886: I/DEBUG(1063):     475c8d34  8c6d703c  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d38  0014ba78  [heap]
03-20 11:37:22.886: I/DEBUG(1063):     475c8d3c  475c8d6c  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d40  43117f54  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d44  475c8d90  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d48  00000004  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d4c  458ad8c8  /mspace/dalvik-heap/2 (deleted)
03-20 11:37:22.886: I/DEBUG(1063):     475c8d50  43117f60  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d54  8130c1a1  /data/data/edu.cmu.pocketsphinx.demo/lib/
03-20 11:37:22.886: I/DEBUG(1063): #01 475c8d58  00000000  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d5c  00000000  
03-20 11:37:22.886: I/DEBUG(1063):     475c8d60  430fdfae  /data/dalvik-cache/data@app@edu.cmu.pocketsphinx.demo.apk@classes.dex
03-20 11:37:22.886: I/DEBUG(1063):     475c8d64  ad00edb8  /system/lib/
03-20 11:37:23.026: D/Zygote(1065): Process 385 terminated by signal (11)
03-20 11:37:23.056: I/ActivityManager(1140): Process edu.cmu.pocketsphinx.demo (pid 385) has died.
03-20 11:37:23.056: I/UsageStats(1140): Unexpected resume of while already resumed in edu.cmu.pocketsphinx.demo
03-20 11:37:23.056: I/WindowManager(1140): WIN DEATH: Window{45f50c48 edu.cmu.pocketsphinx.demo/edu.cmu.pocketsphinx.demo.PocketSphinxDemo paused=false}
03-20 11:37:23.086: I/AudioHardwareQSD(1066): AudioHardware PCM record is going to standby.
03-20 11:37:23.116: W/InputManagerService(1140): Got RemoteException sending setActive(false) notification to pid 385 uid 10106


I am trying to find an answer and most of the threads I found asked to look in the log file from the application and this is usually the end of the thread, my project does not give me the log file (even if there is code to create it). I'm at a loss as to where to look next and I hope someone here can give me a hand.


source to share

1 answer

This, as I understand it, I have no real understanding of what is the way to eliminate segmentation or how to solve this problem.

If you want to be a software developer, you better study it in detail. You can find the starting point from Wikipedia

Typically a segmentation fault means there is a bug in your application or configuration.

and most of the streams I found asked to look in the log file from the application and this is usually the end of the stream, my project doesn't give me the log file (even if there is code to create on it)

This is great advice for you too. You need to figure out why the pocketsphinx.log file is not being generated. Its path is configured in sources. Most likely it was created on the SD card, but you can configure a different location. The contents of this log will tell you what the problem is with your application.



All Articles