vosk-api icon indicating copy to clipboard operation
vosk-api copied to clipboard

Aborted (core dumped).

Open Nouman945 opened this issue 1 year ago • 14 comments

The code is working good in windows 10. But i am trying to run this in my Ubuntu 20.04 LTS x64. Each time i run it gives me this error

free(): invalid pointer
Aborted (core dumped)

Can anyone explain to me why this is happening. I also installed the c++ build tools as well and i am using python 3.7.0 in a conda virtual environment. I

ran the setup.py file with different commands like easy_install, install, build etc but i cannot figure out the error. please let me know if you need more details from me.

There's another error occur when i ran the python test_microphone.py

Fatal error: glibc detected an invalid stdio handle
Aborted (core dumped)

Nouman945 avatar Jul 26 '22 05:07 Nouman945

What is the full output before crash

nshmyrev avatar Jul 26 '22 08:07 nshmyrev

Screenshot from 2022-07-27 08-41-09

Here this is the output right now. I also showed the packages versions i am using.

Nouman945 avatar Jul 27 '22 05:07 Nouman945

Ok, what is the output of test_simple.py?

nshmyrev avatar Jul 27 '22 07:07 nshmyrev

Screenshot from 2022-07-27 14-32-03

Its working for the test_simple.py test.wav

but the same error for test_microphone.py

Segmentation fault (core dumped)

Nouman945 avatar Jul 27 '22 11:07 Nouman945

It should be the crash of sounddevice then, probably something with portaudio. What is the OS exactly, portaudio version on your system.

It also helps to collect backtrace like this:

gdb --args python3 ./test_microphone.py

then "run", when it crashes "backtrace".

nshmyrev avatar Jul 27 '22 11:07 nshmyrev

I am using

  • Ubuntu 22.04 LTS
  • PyAudio==0.2.11
  • python==3.7.0

Nouman945 avatar Jul 27 '22 11:07 Nouman945

Screenshot from 2022-07-27 16-03-04

Yes tracked the error. but cannot understand it. its not giving the full path so i can put the file there.

Backtrace.

Screenshot from 2022-07-27 16-05-06

Nouman945 avatar Jul 27 '22 13:07 Nouman945

Hm, looks strange. Does plain sounddevice example

https://github.com/spatialaudio/python-sounddevice/blob/0.4.4/examples/rec_unlimited.py

work for you without crashes?

nshmyrev avatar Jul 28 '22 00:07 nshmyrev

Screenshot from 2022-07-28 08-46-11

Yes its working without any crash.

Nouman945 avatar Jul 28 '22 05:07 Nouman945

Other files are working fine the crash is with only test_microphone.py file. I tried with different versions of python as well but its the same error

Nouman945 avatar Jul 28 '22 05:07 Nouman945

On the screenshot above you try to run gdb in base environment but rec_unlimited in the nlp environment. Can you try to run them in the same environment? Or, even better, can you check if it works with system python without conda?

nshmyrev avatar Jul 28 '22 06:07 nshmyrev

I got it working. thank you so much for guiding man !! I case anyone have the problems installing Pyaudio in Ubuntu you can use

$ sudo apt-get install portaudio19-dev python-all-dev
$ pip3 install pyaudio

I got it working with python 3.10

Nouman945 avatar Jul 28 '22 06:07 Nouman945

This is wrong. Our samples do not use pyaudio at all, we use sounddevice.

nshmyrev avatar Jul 28 '22 06:07 nshmyrev

It was required to run the test_microphone.py file. But after i installed this it started working

Nouman945 avatar Jul 29 '22 20:07 Nouman945

@Nouman945 solution also worked for me, thanks.

amirhosein-vedadi avatar Feb 01 '23 13:02 amirhosein-vedadi