Closed lorenwel closed 9 years ago
@lorenwel How did you solve this issue? Were you compiling from source, or did you apt-get install?
There seem to be memory leak issues. Running the LMS node with Valgrind gives the following output.
minx@minx: /home/devel/lib/lms1xx$ valgrind --leak-check=full ./LMS1xx_node
==19639== Memcheck, a memory error detector
==19639== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==19639== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==19639== Command: ./LMS1xx_node
==19639==
[ INFO] [1436312040.946052249]: Connecting to laser at : 192.168.1.22
==19639== Conditional jump or move depends on uninitialised value(s)
==19639== at 0x4C31A06: rawmemchr (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19639== by 0x5F7C0C1: _IO_str_init_static_internal (strops.c:44)
==19639== by 0x5F6FA66: vsscanf (iovsscanf.c:43)
==19639== by 0x5F5C286: sscanf (sscanf.c:32)
==19639== by 0x4E38DB6: LMS1xx::getScanOutputRange() const (in /home/min8/k5_adm_3/devel/lib/libLMS1xx.so)
==19639== by 0x40B7B7: main (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639==
[ INFO] [1436312041.203160912]: Connected to laser.
==19639== Conditional jump or move depends on uninitialised value(s)
==19639== at 0x4E38B86: LMS1xx::setScanDataCfg(_scanDataCfg const&) (in /home/min8/k5_adm_3/devel/lib/libLMS1xx.so)
==19639== by 0x40C395: main (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639==
==19639== Invalid write of size 4
==19639== at 0x40C4BB: main (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== Address 0xae68584 is 0 bytes after a block of size 1,444 alloc'd
==19639== at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19639== by 0x410311: __gnu_cxx::new_allocator<float>::allocate(unsigned long, void const*) (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== by 0x40FDB8: std::_Vector_base<float, std::allocator<float> >::_M_allocate(unsigned long) (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== by 0x40F4C6: std::vector<float, std::allocator<float> >::_M_fill_insert(__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, unsigned long, float const&) (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== by 0x40ECB5: std::vector<float, std::allocator<float> >::insert(__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, unsigned long, float const&) (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== by 0x40DA87: std::vector<float, std::allocator<float> >::resize(unsigned long, float) (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== by 0x40C31E: main (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639==
==19639== Invalid write of size 4
==19639== at 0x40C51D: main (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== Address 0xae68b74 is 0 bytes after a block of size 1,444 alloc'd
==19639== at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19639== by 0x410311: __gnu_cxx::new_allocator<float>::allocate(unsigned long, void const*) (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== by 0x40FDB8: std::_Vector_base<float, std::allocator<float> >::_M_allocate(unsigned long) (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== by 0x40F4C6: std::vector<float, std::allocator<float> >::_M_fill_insert(__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, unsigned long, float const&) (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== by 0x40ECB5: std::vector<float, std::allocator<float> >::insert(__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, unsigned long, float const&) (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== by 0x40DA87: std::vector<float, std::allocator<float> >::resize(unsigned long, float) (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
==19639== by 0x40C33F: main (in /home/min8/k5_adm_3/devel/lib/lms1xx/LMS1xx_node)
@mikepurvis Any suggestions on this issue please?
The update on 5/17 in which @lorenwel changed the title from "Crash when subscribing to /scan topic" to "[Closed] Error due to faulty ROS installation" indicates to me that a flaw was found in the ROS installation and the issue was resolved by reinstalling the ROS package.
Are you having an issue identical to @lorenwel's original problem description?
@SICK-NorthAmerica Yes! And a reinstallaton of the ROS package doesn't seem to help. When I run the LMS driver with the memory leak analysis tool (valgrind) - it seems to work fine, but throws Segmentation faults and issues similar to what @lorenwel's posted here, when run with rosrun, or directly running the compiled file.
P.S. I tried both downloading a release from source and compiling it - also installing the lidar driver with apt-get.
OK - so fixed the issue by changing the scan resolution on the Lidar. The driver seems to work only with a scan resolution of 0.5, while I had my Lidar set to 0.25. Changing my Lidar back to 0.5 fixed the issue.
We are currently working with an LMS151 running the newest firmware 1.60. We were running both an LMS111 and an LMS151 with earlier firmware versions before and with none of the devices the following error occurred. Initially, I had the problem that the lms1xx node would connect to the laser but fail to read/write from it because the new firmware has the binary communication for the Ethernet AUX-port enabled and SOPAS does not allow this to be changed. However, after switching TCP ports of the Ethernet AUX-Port and the Ethernet Host-port, which works in ASCII mode, the node now initializes successfully and displays the following behavior. The node crashes whenever another node subscribes to the /scan topic. However, one correct message is published before the crash occurs. When I subscribe to the topic before I launch the node, it crashes while publishing the scan message (line 126), with the error message
If I let the node run for a few seconds and then subscribe, it crashes while getting new data (line 114), with the error message
I'm running Hydro on Ubuntu 13.04.