Hi,

sigrok segfaults with my Brymen BM869s DMM.
It happens when I use sigrok-cli to scan.
And also when trying to get measurement without correct udev rules 
(device permissions).

For the purpose of debugging, I have installed the software in the 
following way:

cd libusb-1.0.19/
CC=clang CFLAGS="-g -ggdb -O0 -fPIC" ./configure 
--prefix=$HOME/playground/sigrok/install 
--libdir=$HOME/playground/sigrok/install/usr/lib --enable-shared 
--disable-static
make -j4
make install
cd ..

cd libsigrok-0.3.0
PKG_CONFIG_PATH="$HOME/playground/sigrok/install/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
 
CC=clang CFLAGS="-g -ggdb -O0 -fPIC" ./configure 
--prefix=$HOME/playground/sigrok/install 
--libdir=$HOME/playground/sigrok/install/usr/lib --enable-shared 
--disable-static
make -j4
make install
cd ..

cd sigrok-cli-0.5.0
PKG_CONFIG_PATH="$HOME/playground/sigrok/install/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
 
CC=clang CFLAGS="-g -ggdb -O0 -fPIC" ./configure 
--prefix=$HOME/playground/sigrok/install 
--libdir=$HOME/playground/sigrok/install/usr/lib --enable-shared 
--disable-static
make -j4
make install


And this is what happens:

*Without* the DMM connected and *with* correct udev rules:
./sigrok-cli --scan
The following devices were found:
demo - Demo device with 12 channels: D0 D1 D2 D3 D4 D5 D6 D7 A0 A1 A2 A3

*With* the DMM connected and *with* correct udev rules:
./sigrok-cli --scan
The following devices were found:
brymen-bm86x - Brymen BM869 with 2 channels: P1 P2
demo - Demo device with 12 channels: D0 D1 D2 D3 D4 D5 D6 D7 A0 A1 A2 A3
Segmentation fault

*With* the DMM connected and *with* correct udev rules:
./sigrok-cli --driver brymen-bm86x --samples 3 --output-format analog
P1: -0.002110 V DC REL
P1: -0.002110 V DC REL
P1: -0.002120 V DC REL

*With* the DMM connected and *without* correct udev rules:
./sigrok-cli --driver brymen-bm86x --samples 3 --output-format analog
sr: usb: Failed to open device: LIBUSB_ERROR_ACCESS.
Segmentation fault


In the case of "./sigrok-cli --scan" the call stack looks like that:
0 pthread_mutex_lock      0x7fb5bd7edf44
1 libusb_release_interface  core.c  1512  0x7fb5bc8d23c7
2 dev_close api.c 158 0x7fb5be456216
3 std_dev_clear std.c 266 0x7fb5be43203c
4 cleanup api.c 182 0x7fb5be455a8a
5 sr_hw_cleanup_all hwdriver.c  549 0x7fb5be42f317
6 sr_exit backend.c 388 0x7fb5be42ad4a
7 main  main.c  286 0x404436

In the line 1512 of core.c of libusb, in function call:
usbi_mutex_lock(&dev->lock);

the 'dev' pointer is NULL.


In the case of "./sigrok-cli --driver brymen-bm86x --samples 3 
--output-format analog" without correct udev rules, the call stack looks 
like that:
0 libusb_kernel_driver_active core.c  1711  0x7fa31cace889
1 dev_open  api.c 125 0x7fa31e6520c4
2 sr_dev_open device.c  504 0x7fa31e6278fd
3 run_session session.c 477 0x407ff0
4 main  main.c  270 0x404393

In the line 1711 of core.c of libusb, in the condition:

if (!dev->dev->attached)
     return LIBUSB_ERROR_NO_DEVICE;

the 'dev' pointer is NULL.


Any clues on what might be happening?

--
Best regards,
Andrzej Telszewski


------------------------------------------------------------------------------
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to