Azure-Samples / cognitive-services-speech-sdk

Sample code for the Microsoft Cognitive Services Speech SDK
MIT License
2.79k stars 1.82k forks source link

Segmentation Fault in Azure Speech SDK for Python During Continuous Recognition [EXC_BAD_ACCESS] #2490

Open Elshaffei opened 1 month ago

Elshaffei commented 1 month ago

Describe the bug

Issue: I am encountering a segmentation fault (EXC_BAD_ACCESS) while using the Azure Cognitive Services Speech SDK for Python. The segmentation fault occurs during continuous speech recognition, leading to a crash in the application. The issue occurs after handling multiple audio chunks.

To Reproduce

Steps to reproduce the behavior:

  1. Initialize the Speech SDK with the following configuration:

import azure.cognitiveservices.speech as speechsdk speech_config = speechsdk.SpeechConfig(subscription="YourSubscriptionKey", region="YourServiceRegion") audio_input = speechsdk.audio.AudioConfig(use_default_microphone=True) speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_input) speech_recognizer.start_continuous_recognition()

2.Start the Flask server.

  1. Send audio chunks to the server from the browser through socket.io using microphone

Expected behavior

The speech recognition should process the audio input continuously without crashing. The application should handle multiple audio chunks and provide accurate transcription results.

Version of the Cognitive Services Speech SDK

Which version of the SDK are you using. Version: 1.38.0

Platform, Operating System, and Programming Language

Additional context

- Error messages, stack trace Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000

-Crash Report

Process: Python [55558] Path: /usr/local/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python Identifier: org.python.python Version: 3.12.4 (3.12.4) Code Type: X86-64 (Native) Parent Process: launchd [1] User ID: 501

Date/Time: 2024-07-12 11:19:44.0219 +0300 OS Version: macOS 14.5 (23F79) Report Version: 12 Bridge OS Version: 8.5 (21P5077) Anonymous UUID: 3F5483EE-D6C6-5E2F-5D10-D5137DA113B6

Sleep/Wake UUID: E62013BA-1112-47E6-BF21-481D5377DC5B

Time Awake Since Boot: 79000 seconds Time Since Wake: 713 seconds

System Integrity Protection: enabled

Crashed Thread: 10

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [55558] ...

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [55558] ... Crashed Thread: 10 ... Thread 10 Crashed: 0 libsystem_platform.dylib 0x7ff809ca8b32 _platform_strlen + 18 1 libMicrosoft.CognitiveServices.Speech.core.dylib 0x1042ae8dc SpxFormatMessage + 748 2 libMicrosoft.CognitiveServices.Speech.core.dylib 0x1042ae4fa SpxTraceMessage2 + 106 3 libMicrosoft.CognitiveServices.Speech.core.dylib 0x104282574 diagnostics_log_trace_message + 116 ...

jychoudh commented 1 month ago

From the logs, I can see that Speech SDK is not getting any audio. You have created a AudioInputStreamCallback class, but you haven't used it. While creating an AudioConfig object, you are asking Speech SDK to get input audio from microphone.

Elshaffei commented 1 month ago

Hi jychoudh,

Thanks for your response. I reviewed the logs as well, and it looks like I shared the logs for another problem: Exception with an error code: 0x13 (SPXERR_START_RECOGNIZING_INVALID_STATE_TRANSITION). This problem has been resolved. This is why the logs I shared shows no audio is received. It was happening because of the thread locks. I removed them.

Here's the right log for my current problem EXC_BAD_ACCESS:

https://gist.github.com/Elshaffei/9a650e240b78cf54990b3c83af3238f6

As for the AudioInputStreamCallback class, I am calling the audio_stream.write_audio_data(data) inside the handle_audio_chunk function.

I am also getting transcription from the SDK. But it never last more than 10-15 seconds.

The app used to crash, now the app is stuck, I have to force quit it.

Here's logs from my console:

2024-07-12 23:57:26,342 - root - INFO - Successfully connected to Redis 2024-07-12 23:57:26,512 - root - DEBUG - Calling setup_speech_recognizer() 2024-07-12 23:57:26,740 - root - DEBUG - Starting setup_speech_recognizer 2024-07-12 23:57:26,748 - root - INFO - Speech SDK logging enabled. Log file: /Users/mac/Desktop/App_name/speech_sdk_log.txt 2024-07-12 23:57:26,925 - root - INFO - Speech recognizer setup completed. Filename: /Users/mac/Desktop/App_name/speech_recognition/model.py

Line # Mem usage Increment Occurrences Line Contents

57     42.0 MiB     42.0 MiB           1   @profile
58                                         def setup_speech_recognizer():
59     42.1 MiB      0.0 MiB           1       logging.debug("Starting setup_speech_recognizer")
60                                             global speech_recognizer
61                                         
62                                             # Configure speech service
63     42.2 MiB      0.1 MiB           2       speech_config = speechsdk.SpeechConfig(
64     42.1 MiB      0.0 MiB           1           subscription=Subscription_key,
65     42.1 MiB      0.0 MiB           1           region=Service_region,
66                                                 # endpoint=Endpoint
67                                             )
68                                         
69     42.2 MiB      0.0 MiB           1       speech_config.speech_recognition_language = "ar-SA"  # Set language to Arabic
70                                         
71                                             # Enabling Speech SDK logging
72     42.2 MiB      0.0 MiB           1       log_file_path = os.path.join(os.getcwd(), "speech_sdk_log.txt")
73     42.2 MiB      0.0 MiB           1       speech_config.set_property(speechsdk.PropertyId.Speech_LogFilename, log_file_path)
74     42.2 MiB      0.0 MiB           1       logging.info(f"Speech SDK logging enabled. Log file: {log_file_path}")
75                                         
76                                             # Set up audio configuration from microphone
77     42.2 MiB      0.0 MiB           1       audio_input = speechsdk.audio.AudioConfig(use_default_microphone=True)
78                                         
79     45.0 MiB      2.8 MiB           1       speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_input)
80                                         
81                                             # Attach the callback function for recognized speech
82     45.0 MiB      0.0 MiB           1       speech_recognizer.recognized.connect(recognized_cb)
83     45.0 MiB      0.0 MiB           1       speech_recognizer.recognizing.connect(recognizing_cb)
84     45.0 MiB      0.0 MiB           1       speech_recognizer.session_started.connect(lambda evt: logging.info(f"SESSION STARTED: {evt}"))
85     45.1 MiB      0.0 MiB           1       speech_recognizer.session_stopped.connect(lambda evt: logging.info(f"SESSION STOPPED: {evt}"))
86     45.1 MiB      0.0 MiB           1       speech_recognizer.canceled.connect(lambda evt: logging.error(f"CANCELED: {evt}"))
87                                         
88     45.1 MiB      0.0 MiB           1       logging.info("Speech recognizer setup completed.")

2024-07-12 23:44:34,828 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=3cbad2dd9f4b454a970ff9beee24fdcd, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:34,828 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة 2024-07-12 23:44:35,750 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=ff8e1f255bc84acb9b02e0c5d576293f, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:35,751 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما 2024-07-12 23:44:36,351 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=59c5aedd58b7415898f2c02914e3cdd2, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تت", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:36,352 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تت 2024-07-12 23:44:36,431 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=0c69f7b9b350489abbfa7d285ccfd4b0, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:36,432 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل 2024-07-12 23:44:37,434 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=dd0ffa9090aa4703a5fe5e1c2a71ed76, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:37,434 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة 2024-07-12 23:44:38,071 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=50e32c70683f44da8b5735dd2a008e58, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:38,071 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية 2024-07-12 23:44:38,937 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=dc0eb6d7cf1045afa1469e63de2a6193, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:38,937 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس 2024-07-12 23:44:40,652 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=b30d7200229b43bdba993a044fcd0e9b, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:40,653 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما 2024-07-12 23:44:40,854 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=fd57657e19c348cf8272a10d1f261b94, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلم", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:40,855 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلم 2024-07-12 23:44:41,249 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=71298a392fa84e92a3f50205a0cbc8e8, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:41,249 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون 2024-07-12 23:44:41,548 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=fa9d4b3952a148a0a0a9e199a3b81a39, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:41,549 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما 2024-07-12 23:44:42,028 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=5dff23b8139f4cef835e287c0fff3356, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:42,028 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون 2024-07-12 23:44:42,756 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=13f21d3a2ca54443b1eddda1c6aac514, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:42,757 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون 2024-07-12 23:44:43,160 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=ac63641023164569a8dc07bc3e3e60e9, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:43,160 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة 2024-07-12 23:44:43,964 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=91664c2272734bc1b04761f611a781e2, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:43,964 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية 2024-07-12 23:44:44,939 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=cd1e28795f43451fa8ac0a7b90e9b99b, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:44,940 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى 2024-07-12 23:44:45,214 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=fba4ad06220d4cad890f5e8d4bd7172c, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى لو", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:45,214 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى لو 2024-07-12 23:44:45,444 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=7ce5bbecb1ea4aa4b5e3ac4052041269, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى لو كانت", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:45,444 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى لو كانت 2024-07-12 23:44:45,748 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=3a64ad5940ba4d6a9c998ecebb5a3043, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى لو كانت الصورة", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:45,749 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى لو كانت الصورة 2024-07-12 23:44:46,647 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=6a3ddbd0c2284dfea00979380ae089b7, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى لو كانت الصورة الن", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:46,647 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى لو كانت الصورة الن 2024-07-12 23:44:46,753 - root - DEBUG - Recognizing event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=8aa8a22b29cc494c99956b64cd4a25a7, text="الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى لو كانت الصورة النمطية", reason=ResultReason.RecognizingSpeech)) 2024-07-12 23:44:46,753 - root - INFO - Intermediate recognition result: الناس عندهم حساسية الناس حساسين بزيادة حتى لو قلت الشعب الفلاني الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ ليش كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية الناس ما يتكلمون ما يحبون يسمعون عن الصورة النمطية حتى لو كانت الصورة النمطية 2024-07-12 23:44:47,447 - root - DEBUG - Event type: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=e42a86182f904586b375bf4dfcdb3ae1, text="الناس عندهم حساسية، الناس حساسين بزيادة، حتى لو قلت الشعب الفلاني، الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ، ليش؟ كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية، الناس ما يتكلمون ما يحبون، يسمعون عن الصورة النمطية، حتى لو كانت الصورة النمطية.", reason=ResultReason.RecognizedSpeech)), Event: SpeechRecognitionEventArgs(session_id=dc7d729e2c05461db92b2a27b6b3fb7c, result=SpeechRecognitionResult(result_id=e42a86182f904586b375bf4dfcdb3ae1, text="الناس عندهم حساسية، الناس حساسين بزيادة، حتى لو قلت الشعب الفلاني، الشعب الفلاني ارتياء ممكن يجوك ناس يقولون لأ، ليش؟ كلنا أذكياء ف الناس هذه الأيام حساسة وما تتقبل الصورة النمطية، الناس ما يتكلمون ما يحبون، يسمعون عن الصورة النمطية، حتى لو كانت الصورة النمطية.", reason=ResultReason.RecognizedSpeech))

Elshaffei commented 1 month ago

It looks like the problem consistently arises from those 2 function SpxFormatMessage & SpxFormatMessage2. Check the thread below.

Can anyone help with this one? is it a bug from Azure SDK or is it an issue in my code?

Thread 9 Crashed: 0 libsystem_platform.dylib 0x7ff809ca8b32 _platform_strlen + 18 1 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d3ae8dc SpxFormatMessage + 748 2 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d3ae4fa SpxTraceMessage2 + 106 3 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d382574 diagnostics_log_trace_message + 116 4 libffi.dylib 0x7ff81b502892 ffi_call_unix64 + 82 5 libffi.dylib 0x7ff81b50220e ffi_call_int + 808 6 _ctypes.cpython-312-darwin.so 0x10addb259 _ctypes_callproc + 683 7 _ctypes.cpython-312-darwin.so 0x10add4755 PyCFuncPtr_call + 249 8 Python 0x10b257832 _PyObject_MakeTpCall + 140 9 Python 0x10b34e336 _PyEval_EvalFrameDefault + 51224 10 Python 0x10b2581f2 PyObject_Vectorcall + 75 11 _ctypes.cpython-312-darwin.so 0x10adda91a _CallPythonObject + 407 12 _ctypes.cpython-312-darwin.so 0x10adda617 closure_fcn + 46 13 libffi.dylib 0x7ff81b5024b1 ffi_closure_unix64_inner + 510 14 libffi.dylib 0x7ff81b502a2c ffi_closure_unix64 + 72 15 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d2db2b5 std::1::function::func<recognizer_recognition_set_event_callback::$_1, std::__1::allocator<recognizer_recognition_set_event_callback::$_1>, void (std::1::shared_ptr)>::operator()(std::1::shared_ptr&&) + 165 16 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d5a62e6 Microsoft::CognitiveServices::Speech::EventSignalBase<std::__1::shared_ptr>::Signal(std::1::shared_ptr) + 774 17 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d5a5b3f Microsoft::CognitiveServices::Speech::Impl::CSpxRecognizer::FireRecoEvent(Microsoft::CognitiveServices::Speech::EventSignalBase<std::1::shared_ptr>*, std::1::basic_string<wchar_t, std::1::char_traits, std::__1::allocator> const&, std::1::shared_ptr, unsigned long long) + 351 18 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d5a5ec6 Microsoft::CognitiveServices::Speech::Impl::CSpxRecognizer::FireResultEvent(std::1::basic_string<wchar_t, std::1::char_traits, std::1::allocator> const&, std::__1::shared_ptr) + 310 19 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d56027d Microsoft::CognitiveServices::Speech::Impl::CSpxAudioStreamSession::DispatchEvent(std::1::list<std::1::weak_ptr, std::1::allocator<std::1::weak_ptr>> const&, std::1::basic_string<wchar_t, std::1::char_traits, std::1::allocator> const&, Microsoft::CognitiveServices::Speech::Impl::CSpxAudioStreamSession::EventType, unsigned long long, std::1::shared_ptr, std::__1::basic_string<char, std::1::char_traits, std::1::allocator>, int, std::1::shared_ptr) + 861 20 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d57a4d5 std::1::function::func<Microsoft::CognitiveServices::Speech::Impl::CSpxAudioStreamSession::FireEvent(Microsoft::CognitiveServices::Speech::Impl::CSpxAudioStreamSession::EventType, std::1::shared_ptr, wchar_t const, unsigned long long, std::1::basic_string<char, std::__1::char_traits, std::1::allocator>, int, std::1::shared_ptr)::$_30, std::1::allocator<Microsoft::CognitiveServices::Speech::Impl::CSpxAudioStreamSession::FireEvent(Microsoft::CognitiveServices::Speech::Impl::CSpxAudioStreamSession::EventType, std::__1::shared_ptr, wchar_t const, unsigned long long, std::1::basic_string<char, std::__1::char_traits, std::1::allocator>, int, std::1::shared_ptr)::$_30>, void ()>::operator()() + 213 21 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d3a3b06 std::1::packaged_task<void ()>::operator()() + 86 22 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d3a3a99 Microsoft::CognitiveServices::Speech::Impl::CSpxThreadService::Task::Run() + 25 23 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d3a5ab7 void Microsoft::CognitiveServices::Speech::Impl::CSpxThreadService::Thread::RunTask<std::1::pair<std::1::shared_ptr, std::1::promise>>(std::1::unique_lock&, std::1::deque<std::1::pair<std::1::shared_ptr, std::1::promise>, std::1::allocator<std::1::pair<std::1::shared_ptr, std::1::promise>>>&) + 327 24 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d3a3c35 Microsoft::CognitiveServices::Speech::Impl::CSpxThreadService::Thread::WorkerLoop(std::1::shared_ptr) + 149 25 libMicrosoft.CognitiveServices.Speech.core.dylib 0x10d3a6bd7 void* std::1::thread_proxy<std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete>, void ()(std::__1::shared_ptr), std::__1::shared_ptr>>(void) + 87 26 libsystem_pthread.dylib 0x7ff809c7c18b _pthread_start + 99 27 libsystem_pthread.dylib 0x7ff809c77ae3 thread_start + 15

github-actions[bot] commented 3 weeks ago

This item has been open without activity for 19 days. Provide a comment on status and remove "update needed" label.

Elshaffei commented 2 weeks ago

The issue is till happening! No clue why.