Skip to content

bug-fix: Protect acquiring buffer by different workers#805

Open
msluszniak wants to merge 2 commits intomainfrom
@ms/fix-crash-in-stt
Open

bug-fix: Protect acquiring buffer by different workers#805
msluszniak wants to merge 2 commits intomainfrom
@ms/fix-crash-in-stt

Conversation

@msluszniak
Copy link
Member

@msluszniak msluszniak commented Feb 12, 2026

Description

This PR tries to fix the random BAD_ACCESS error in speech to text. After streaming a while to a model, there was a crash. I suspect that it was generated by the following. When incrementally adding chunks, model has latency and the buffer increases. So it sometimes reallocates to a different part in memory. Function that processes audio and passes it to executorch runtime does not know about reallocation and passes old memory address. When executorch runtime tries to copy the memory now the address is invalid.

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

I run 30 minutes of live transcription on iOS and do not observe the crash. You can check this similar way.

Screenshots

Related issues

Closes #791

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

@msluszniak msluszniak self-assigned this Feb 12, 2026
@msluszniak msluszniak added the bug fix PRs that are fixing bugs label Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix PRs that are fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash during live transcription in Speech-to-Text demo app

1 participant