Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ss32 opened this issue Mar 29, 2024 · 1 comment
Open

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

ss32 opened this issue Mar 29, 2024 · 1 comment

Comments

@ss32
Copy link

ss32 commented Mar 29, 2024

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
@ss32
Copy link
Author

ss32 commented Mar 29, 2024

#125 might address this. Applying the patch yields more sane output

./simple_grabber --channel --serial /dev/tty/USB0 460800
Error, cannot bind to the specified serial port /dev/tty/USB0.
Error, unexpected error, code: 80008004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant