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 libc.so.6. Here is the relevant backtrace:

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

    The issue appears to be related to CEC::CCECClient::Process() in libcec.so.4.

    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,
    Evgeny

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

    Code
    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
    Code
    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.