fix: bump engine_task default stack to 8192#74
Open
Duvet05 wants to merge 1 commit intolivekit:mainfrom
Open
Conversation
4096 isn't enough for the DTLS-SRTP handshake — mbedTLS blows through the stack during cert generation and triggers a FreeRTOS stack overflow. Backtrace: dtls_srtp_selfsign_cert → dtls_srtp_init → peer_open → engine_task 8192 fixes it. Tested on ESP32-S3 with PSRAM.
There was a problem hiding this comment.
Pull request overview
Updates the LiveKit component’s Kconfig to increase the default engine_task stack size to avoid FreeRTOS stack overflows during DTLS-SRTP initialization on ESP-IDF targets.
Changes:
- Bump
LK_ENGINE_TASK_STACK_SIZEdefault from4096to8192incomponents/livekit/Kconfig.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default stack of 4096 for
engine_taskisn't enough when DTLS-SRTP kicks in. mbedTLS eats through the stack during self-signed cert generation and you get a FreeRTOS stack overflow panic before the connection even completes.The backtrace looks like:
Bumping to 8192 fixes it. Tested on an ESP32-S3 (octal PSRAM, ESP-IDF 5.5.2).
Only touches the Kconfig default — no code changes. Users who already override
LK_ENGINE_TASK_STACK_SIZEin their sdkconfig aren't affected..