DeepSpeech: deepspeech-tflite: SIGSEGV, Segmentation fault in __memmove_avx_unaligned_erms

  • Have I written custom code: No:
  • OS Platform and Distribution: Linux Ubuntu 20.04:
  • TensorFlow installed from: seems to be bundled
  • TensorFlow version TensorFlow: v2.3.0-6-g23ad988:
  • Python version: 3.8.5:
  • Exact command to reproduce:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from deepspeech import Model


def main():
    model = './deepspeech/output_graph.tflite'
    ds = Model(model)


if __name__ == '__main__':
    main()

I trying to use a tflite model from https://github.com/AASHISHAG/deepspeech-german for version 0.9.0 (at the bottom of the page). It is the file output_graph.tflite in the Google Drive folder. When loading the model I get a segmentation fault. I have raised an issue also at the project’s issue page

I get the same error with deepspeech version 0.9.0 and 0.9.2.

I have recorded a gdb stack trace:

gdb --args venv/bin/python3 deepspeech_test.py 
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from venv/bin/python3...
(No debugging symbols found in venv/bin/python3)
(gdb) start
Temporary breakpoint 1 at 0x4008a0
Starting program: /home/widerstand/Projekte/hands-free-tv/venv/bin/python3 deepspeech_test.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Temporary breakpoint 1, 0x00000000004008a0 in main ()
(gdb) continue
Continuing.
[New Thread 0x7ffff37e2700 (LWP 41611)]
[New Thread 0x7ffff2fe1700 (LWP 41612)]
[New Thread 0x7fffee7e0700 (LWP 41613)]
[New Thread 0x7fffebfdf700 (LWP 41614)]
[New Thread 0x7fffe97de700 (LWP 41615)]
[New Thread 0x7fffe6fdd700 (LWP 41616)]
[New Thread 0x7fffe67dc700 (LWP 41617)]
[Thread 0x7fffe6fdd700 (LWP 41616) exited]
[Thread 0x7fffe67dc700 (LWP 41617) exited]
[Thread 0x7fffe97de700 (LWP 41615) exited]
[Thread 0x7fffebfdf700 (LWP 41614) exited]
[Thread 0x7fffee7e0700 (LWP 41613) exited]
[Thread 0x7ffff2fe1700 (LWP 41612) exited]
[Thread 0x7ffff37e2700 (LWP 41611) exited]
[Detaching after fork from child process 41618]
Loading model from file ./deepspeech/output_graph.tflite
TensorFlow: v2.3.0-6-g23ad988
DeepSpeech: v0.9.3-0-gf2e9c85

Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
__memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:321
321     ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) bt
#0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:321
#1  0x00007ffff33c10e0 in ?? () from /home/widerstand/Projekte/hands-free-tv/venv/lib/python3.8/site-packages/deepspeech/lib/libdeepspeech.so
#2  0x00007ffff347a4e0 in ?? () from /home/widerstand/Projekte/hands-free-tv/venv/lib/python3.8/site-packages/deepspeech/lib/libdeepspeech.so
#3  0x00007ffff347d3ec in ?? () from /home/widerstand/Projekte/hands-free-tv/venv/lib/python3.8/site-packages/deepspeech/lib/libdeepspeech.so
#4  0x00007ffff3227daf in ?? () from /home/widerstand/Projekte/hands-free-tv/venv/lib/python3.8/site-packages/deepspeech/lib/libdeepspeech.so
#5  0x00007ffff3224260 in DS_CreateModel () from /home/widerstand/Projekte/hands-free-tv/venv/lib/python3.8/site-packages/deepspeech/lib/libdeepspeech.so
#6  0x00007ffff35fe6d6 in _wrap_CreateModel (args=<optimized out>, kwargs=<optimized out>) at impl_wrap.cpp:4010
#7  0x00007ffff7b1851c in cfunction_call_varargs () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#8  0x00007ffff7b18ad1 in _PyObject_MakeTpCall () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#9  0x00007ffff7af6b46 in _PyEval_EvalFrameDefault () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#10 0x00007ffff7aee6f0 in function_code_fastcall () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#11 0x00007ffff7af6c26 in _PyEval_EvalFrameDefault () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#12 0x00007ffff7aee6f0 in function_code_fastcall () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#13 0x00007ffff7b1a3fa in _PyObject_FastCallDict () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#14 0x00007ffff7b1a4f2 in _PyObject_Call_Prepend () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#15 0x00007ffff7b6b061 in slot_tp_init () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#16 0x00007ffff7b67253 in type_call () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#17 0x00007ffff7b18ad1 in _PyObject_MakeTpCall () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#18 0x00007ffff7af5213 in _PyEval_EvalFrameDefault () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#19 0x00007ffff7aee6f0 in function_code_fastcall () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#20 0x00007ffff7af5252 in _PyEval_EvalFrameDefault () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#21 0x00007ffff7aee6f0 in function_code_fastcall () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#22 0x00007ffff7af5252 in _PyEval_EvalFrameDefault () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#23 0x00007ffff7bd2b94 in _PyEval_EvalCodeWithName () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#24 0x00007ffff7bd2d9e in PyEval_EvalCodeEx () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#25 0x00007ffff7bd2dcb in PyEval_EvalCode () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#26 0x00007ffff7c08528 in run_eval_code_obj () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#27 0x00007ffff7c085e0 in run_mod () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#28 0x00007ffff7c0aec5 in PyRun_FileExFlags () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
--Type <RET> for more, q to quit, c to continue without paging--c
#29 0x00007ffff7c0b036 in PyRun_SimpleFileExFlags () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#30 0x00007ffff7c25708 in Py_RunMain () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#31 0x00007ffff7c25b39 in Py_BytesMain () from /home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/libpython3.8.so.1.0
#32 0x00007ffff786d0b3 in __libc_start_main (main=0x4008a0 <main>, argc=2, argv=0x7fffffffd2d8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd2c8) at ../csu/libc-start.c:308
#33 0x00000000004008d9 in _start ()
(gdb)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17

Most upvoted comments

When re-exporting the tflite model the segmentation fault is gone:

../venv_tools/bin/python DeepSpeech.py --export_tflite --export_dir . --alphabet_config_path=deepspeech-german/alphabet.txt --checkpoint_dir=deepspeech-german

I’m closign this one and will ask the creators what they did to cause an segmentation fault.

I trying to use a tflite model from https://github.com/AASHISHAG/deepspeech-german for version 0.9.0 (at the bottom of the page). It is the file output_graph.tflite in the Google Drive folder. When loading the model I get a segmentation fault. I have raised an issue also at the project’s issue page

do you repro with the model we ship?

I tried now and the shipped deepspeech-0.9.3-models.tflite works without a segmentation fault. So it seems to be a problem with the generation of the tflite file.