Double Free Detected in "libcec"

  • Hello,

    I am encountering an issue with libcec on my LibreELEC system. The program crashes with the error message "double free detected in tcache 2". I have debugged the issue using gdb and found that the error occurs in the free function within Here is the relevant backtrace:

    Thread 33 "PeripBusCEC" received signal SIGABRT, Aborted.
    [Switching to Thread 0xffff067cef00 (LWP 2547)]
    0x0000ffff7b21b394 in ?? () from /usr/lib/
    (gdb) bt
    #0  0x0000ffff7b21b394 in ?? () from /usr/lib/
    #1  0x0000ffff7b1d9384 in raise () from /usr/lib/
    #2  0x0000ffff7b1c6e9c in abort () from /usr/lib/
    #3  0x0000ffff7b20fe88 in ?? () from /usr/lib/
    #4  0x0000ffff7b2247f4 in ?? () from /usr/lib/
    #5  0x0000ffff7b2268e8 in ?? () from /usr/lib/
    #6  0x0000ffff7b228a14 in free () from /usr/lib/
    #7  0x0000ffff7e85b25c in CEC::CCECClient::Process() () from /usr/lib/
    #8  0x0000ffff7e85cbb8 in P8PLATFORM::CThread::ThreadHandler(void*) () from /usr/lib/
    #9  0x0000ffff7b219a7c in ?? () from /usr/lib/
    #10 0x0000ffff7b27b70c in ?? () from /usr/lib/

    The issue appears to be related to CEC::CCECClient::Process() in

    Could you please provide guidance on how to resolve this issue or if there are any updates or patches available that address this problem?

    Thank you for your assistance.

    Best regards,

  • Thanks. Do you go OPi3 -> AVR -> TV? If yes, try OPi3 -> TV instead.

    2024-07-03 19:16:11.140 T:3473    debug <general>: OpenConnection - connection to the CEC adapter opened
    2024-07-03 19:16:11.140 T:3473    debug <general>: SetConfigurationFromLibCEC - settings updated by libCEC
    2024-07-03 19:16:11.141 T:3496    debug <general>: Thread CECAdapterUpdate start, auto delete: false
    2024-07-03 19:16:11.271 T:3496    debug <general>: UpdateMenuLanguage - using TV menu language is disabled
    2024-07-03 19:16:11.429 T:3496    debug <general>: UpdateAudioSystemStatus - no CEC capable amplifier found
    2024-07-03 15:21:50.524 T:2234    error <general>: OpenConnection - could not opening a connection to the CEC adapter
  • The log snippets at post #4 (kodi.log and kodi_crashlog_<TIMESTAMP>.log) show different CEC behavior (connected / not connected). So the CEC connection seems to be unstable. Try another HDMI cable. HDMI 2.0 / 2.1 cables have better shielding, so I suggest one of those.