-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition in esp_modem_dte (IDFGH-10767) #333
Comments
Thanks for the report! Could you please check if this PR #312 fixes your issues? The thread safety was kind of handled (in a very fragile way) by cooperation between the DTE class and its terminal (so the attached terminal would signal when it's okay to clean the callback), but it got broken when adding USB terminal in 44bae24. I'm sorry, I posted the fix some time ago but haven't really gotten to merge it and resolve this issue sooner. |
Yes, I don't see the race, but there seems to be one regression:
|
Good catch, thanks! Have set the default state into: |
CMUX mode seems to be broken on #312. Haven't managed to get to the bottom, but it seems the AT-commands responses are being ignored in CMUX. |
Also, my confirmation above might be premature... I still seem to be hitting https://github.com/david-cermak/esp-protocols/blob/fix/minor_modem_refactor/components/esp_modem/src/esp_modem_dte.cpp#L321, but this time when logging level is |
You're correct, there might be also other issues with the PR. I'm sorry, it's been 2 months since I touched it and I need to spend some time with it. Clearly this change #333 (comment) did help introducing a data race, since we need to set the |
I'm sorry it took so long, but I've finally merged #312 You were right, there were multiple issues with that PR, not only the locking:
Now it should be fixed and merged to master. I'll test it some more, and if everything works I'd create a new release. |
Answers checklist.
General issue report
I seem to be hitting this exception:
I think that
set_read_cb
is being run twice before this check. It seems to happen when the timings are being "relaxed" by increased logging level, or some higher priority task running in the background. I've found this commit, but yeah, the race is still there. Having theGOT_LINE
signal, but then also reading theresult
variable doesn't guarantee atomicity.Let me know if you need more details.
The text was updated successfully, but these errors were encountered: