Skip to content

fix: bump engine_task default stack to 8192#74

Open
Duvet05 wants to merge 1 commit intolivekit:mainfrom
Duvet05:fix/engine-task-stack-size
Open

fix: bump engine_task default stack to 8192#74
Duvet05 wants to merge 1 commit intolivekit:mainfrom
Duvet05:fix/engine-task-stack-size

Conversation

@Duvet05
Copy link

@Duvet05 Duvet05 commented Feb 13, 2026

The default stack of 4096 for engine_task isn'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:

dtls_srtp_selfsign_cert → dtls_srtp_init → peer_open → engine_task

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_SIZE in their sdkconfig aren't affected..

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.
Copilot AI review requested due to automatic review settings February 13, 2026 06:29
@CLAassistant
Copy link

CLAassistant commented Feb 13, 2026

CLA assistant check
All committers have signed the CLA.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_SIZE default from 4096 to 8192 in components/livekit/Kconfig.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants