app : PID-21066 : *ERROR*: Voice assistant subproc...
# ask-ai
h
app : PID-21066 : ERROR: Voice assistant subprocess error: free(): double free detected in tcache 2 : PID-21234 : ERROR: process exited with non-zero exit code -6 INFO: Voice assistant subprocess output: 2025-09-29 114336,483 - ERROR livekit.agents - process exited with non-zero exit code -6 {"pid": 21371, "job_id": "AJ_Nr74ESmbSc3Q"} Running voice process as subprocess in my code and getting this error
t
Thanks for reaching out, Abhishek. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It looks like you're encountering the error "free(): double free detected in tcache 2," which usually points to a memory management hiccup in a native C/C++ extension used by the voice assistant subprocess. This happens when a block of memory is freed more than once, causing the process to stop with exit code -6. To help you work through this, here are some steps you can try: • Update Plugins and SDKs: Make sure all your LiveKit SDKs and plugins (like STT, TTS, VAD) are up-to-date, as updates often include fixes for memory-related issues. • Debug with Tools: Tools such as
valgrind
or
faulthandler
can be really helpful to pinpoint where the error is coming from. For instance, you might run
valgrind --track-origins=yes python agent.py
to get more insight. • Isolate Components: Try disabling components like STT, TTS, or VAD one by one. This can help identify if a particular plugin is causing the problem. • Check Object Management: Double-check that native objects (such as VAD models) aren’t being reused improperly across different sessions or threads. • Enable Core Dumps: Setting up your system to generate core dumps can be useful for post-mortem analysis using tools like
gdb
. If you keep running into this issue, please feel free to share more details about the specific components you’re using (like which STT, TTS, or VAD plugins) and any custom native code involved. I’m here to help you get to the bottom of this! Sources: examples/voice_agents/zapier_mcp_integration.py | Agent deployment CLI reference | LiveKit Docs | Voice AI quickstart | LiveKit Docs | meditation_assistant/agent.py | components/media_lib_sal/mem_trace/media_lib_mem_trace.c