Package: libcec3
Version: 3.0.1+dfsg2-4
Severity: grave

Hi,

Recently, Kodi has started segfaulting on startup, pointing to libcec3.
A backtrace reads:

#0  0x00007fffecf55789 in __readdir (dirp=dirp@entry=0x0) at 
../sysdeps/posix/readdir.c:44
#1  0x00007fffc81d8b74 in PLATFORM::CDRMEdidParser::GetPhysicalAddress 
(this=this@entry=0x7fffc29e8550)
    at 
/home/sesse/nmu/libcec-3.0.1+dfsg2/src/libcec/platform/drm/drm-edid.cpp:54
#2  0x00007fffc81e4c0e in CEC::CUSBCECAdapterCommunication::GetPhysicalAddress 
(this=0x7fffb4000f50)
    at 
/home/sesse/nmu/libcec-3.0.1+dfsg2/src/libcec/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp:697
#3  0x00007fffc81baaec in CEC::CCECClient::AutodetectPhysicalAddress 
(this=0x1a7cab0)
    at /home/sesse/nmu/libcec-3.0.1+dfsg2/src/libcec/CECClient.cpp:1224
#4  0x00007fffc81b884c in CEC::CCECClient::SetPhysicalAddress (this=0x1a7cab0, 
configuration=...)
    at /home/sesse/nmu/libcec-3.0.1+dfsg2/src/libcec/CECClient.cpp:236
#5  0x00007fffc81bcdcb in CEC::CCECClient::OnRegister (this=0x1a7cab0) at 
/home/sesse/nmu/libcec-3.0.1+dfsg2/src/libcec/CECClient.cpp:138
#6  0x00007fffc81cd4d2 in CEC::CCECProcessor::RegisterClient (this=0x1a76840, 
client=std::shared_ptr (count 4, weak 0) 0x1a7cab0)
    at /home/sesse/nmu/libcec-3.0.1+dfsg2/src/libcec/CECProcessor.cpp:899
#7  0x00007fffc81d3e7a in CEC::CLibCEC::Open (this=0x1a78d10, 
strPort=<optimized out>, iTimeoutMs=<optimized out>)
    at /home/sesse/nmu/libcec-3.0.1+dfsg2/src/libcec/LibCEC.cpp:91
#8  0x00000000010cdd39 in PERIPHERALS::CPeripheralCecAdapter::OpenConnection() 
()
#9  0x00000000010d0434 in PERIPHERALS::CPeripheralCecAdapter::Process() ()
#10 0x000000000113f56f in CThread::Action() ()
#11 0x000000000113f832 in CThread::staticThread(void*) ()
#12 0x00007ffff55ad0a4 in start_thread (arg=0x7fffc29e9700) at 
pthread_create.c:309
#13 0x00007fffecf8807d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

It would seem libcec3 unconditionally assumes /sys/class/drm exists
(it does not on my system using the proprietary NVIDIA driver, since
that driver doesn't use drm), and then segfaults when it doesn't.

Could you please add a check for the NULL value?

Reply via email to