Skip to content

segfault in sl_lidar_driver.cpp with C1 due to invalid bound channel #128

@ss32

Description

@ss32

Running simple_grabber using the default baudrate of 460800 elicits a segfault on line 993 of sl_lidar_driver.cpp

./simple_grabber --channel --serial /dev/tty/USB0 460800
Error, unexpected error, code: 80008004
Segmentation fault (core dumped)

Output of dmesg --follow

[1551954.612208] simple_grabber[628807]: segfault at 0 ip 000056d7be0eac9e sp 00007ffea64934b0 error 4 in simple_grabber[56d7be0e5000+20000] likely on CPU 9 (core 1, socket 0)
[1551954.612224] Code: 85 c0 74 0e 83 f8 01 0f 84 9e 00 00 00 e9 8b 01 00 00 48 8b 45 98 48 83 c0 28 48 89 c7 e8 d0 28 00 00 48 89 c7 e8 98 ce ff ff <48> 8b 10 48 83 c2 50 48 8b 12 48 89 c7 ff d2 85 c0 0f 94 c0 84 c0

The root issue appears to be trying to access an invalid memory address for the device stemming from getBindedChannel() returning 0x0

Breakpoint 1, sl::SlamtecLidarDriver::setMotorSpeed (this=0x55555559eeb0, speed=0) at src/sl_lidar_driver.cpp:993
993	                if (_transeiver->getBindedChannel()->getChannelType() == CHANNEL_TYPE_SERIALPORT) {
(gdb) p _transeiver->getBindedChannel()->getChannelType() == CHANNEL_TYPE_SERIALPORT
Cannot access memory at address 0x0
(gdb) p _transeiver->getBindedChannel()
$4 = (sl::IChannel *) 0x0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions