Skip to content
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

OpenSL can hang if callback returns DataCallbackResult::Stop #2059

Closed
philburk opened this issue Jul 8, 2024 · 1 comment · Fixed by #2061
Closed

OpenSL can hang if callback returns DataCallbackResult::Stop #2059

philburk opened this issue Jul 8, 2024 · 1 comment · Fixed by #2061
Labels
bug_anr bug P1 high priority

Comments

@philburk
Copy link
Collaborator

philburk commented Jul 8, 2024

Oboe version: 1.9.0 or earlier
App name used for testing: OboeTester

Short description
The callback handler called requestStop() which tried to acquire mLock.
But the close already held mLock and was waiting for the callback to finish.
So there was a deadlock.

This would normally be a rare event. But the RAPID CYCLE test uses usleep()s and
specially timed return of DataCallbackResult::Stop to trigger the bug.

Steps to reproduce
Run Oboetester
Press EXTRAS...
Press RAPID CYCLE
Press START

Expected behavior
Run forever.

Actual behavior
Stops after a few cycles.

@philburk philburk added the bug label Jul 8, 2024
philburk added a commit that referenced this issue Jul 8, 2024
This triggers a race condition and a deadlock.

To trigger #2059
philburk added a commit that referenced this issue Jul 8, 2024
Temporarily unlock() and lock() when Destroy()ing a stream
because that joins the callback thread.

Fixes a rare ANR.

Fixes #2059
@philburk
Copy link
Collaborator Author

philburk commented Jul 8, 2024

This is tracked by internal bug b/348615156

philburk added a commit that referenced this issue Jul 8, 2024
This triggers a race condition and a deadlock.

To trigger #2059
@philburk philburk added P1 high priority bug_anr labels Jul 8, 2024
philburk added a commit that referenced this issue Jul 10, 2024
Try to reproduce the bug in #2059.
philburk added a commit that referenced this issue Jul 11, 2024
Try to reproduce the bug in #2059.
philburk added a commit that referenced this issue Jul 11, 2024
Try to reproduce the bug in #2059.

Use OBOE_SUPPRESS_LOG_SPAM to reduce logs during tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug_anr bug P1 high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant