Closed serxoz closed 3 years ago
Hi again. I can see in gdb this:
#1 0x00007f3d8dc41fdd in vosk_recog_write (speech=0x7f3d8800f6b0, data=<optimized out>, len=320)
at res_speech_vosk.c:156
156 memcpy(vosk_speech->buf + vosk_speech->offset, data, len);
(gdb) print vosk_speech->offset
$1 = 11010520
Maybe offset is the cause?
You'd better use strncat in your patch instead of strcat, otherwise you might get buffer overflow.
You also better accumulate text in asterisk variables instead of patching the sources.
The text is acumulated while the locution in SpeechBackgrond() is playing, I think can't do that in dialplan... :S
I think the problem is in the assert. Look here: https://github.com/alphacep/vosk-asterisk/pull/19
Although despite correcting the name of the variable, it still allows a large offset to pass. I had another core dump with an offset value of 524616.
I think the problem is in the assert. Look here:
asserts are disabled by default, still, it is a valid fix I think, thank you.
Although despite correcting the name of the variable, it still allows a large offset to pass. I had another core dump with an offset value of 524616.
You can probably add a printf of the offset value every frame and collect logs showing the offset changes.
You still need to fix strcat issue in your code.
I was thinking assert was enabled... :( I could solve the problem with this: https://github.com/alphacep/vosk-asterisk/pull/20 I've tested it with more than 200 calls and is working OK.
Thank you for your recommendation on strncat().
Hi.
I'm here begging for help or at least some directions. I get sometimes, not always, this segfault:
Don't always get it, it's so random! And to put things more easy, I've modified app_speech_utils.c a little. But, I think my modifications don't have to do with this part of code... I'm not 100% sure.
I attach here my asterisk patch and my vosk-asterisk patch for the braves who want to try. I have tried them with 16.18.0 and git version of asterisk. My modifications try to solve a pair of problems I encounter:
Hope you can at least point me in a good direction to follow. Thank you in advance.
ast-patch.txt vosk-ast-patch.txt core-thread1.txt