Hmm, simone-c wrote: "I tried to compile latest available version: usb- modeswitch-2.6.0.tar.bz2 (md5: be73dcc84025794081a1d4d4e5a75e4c) and it does not crash."
Generally, not many changes are made anymore regarding the core program. Strangely enough, there wasn't the slightest change in the detachDriver() function between 2.5.2 and 2.6.0. So it's likely there is a combination of things happening here. This is the code where the crash is happening: -x-x-x- struct libusb_config_descriptor *config; libusb_get_active_config_descriptor(dev, &config); -x-x-x- So actually the problem is that libusb can't determine and retrieve the active configuration because it can't read the value that would tell it the number/index of the configuration currently set (/sys/bus/usb/devices/1-2/bConfigurationValue). It would be interesting to check if that attribute is actually there. Try # cat /sys/bus/usb/devices/1-2/bConfigurationValue It *might* be that there is some self-switching going on and the device is gone during usb_modeswitch handling it, but that wouldn't explain why the crash doesn't happen with 2.6.0 ... It's obvious though that I need to catch the "get_active_config" function returning an error. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to usb-modeswitch in Ubuntu. https://bugs.launchpad.net/bugs/1880191 Title: usb_modeswitch 2.5.2 segfault Status in usb-modeswitch package in Ubuntu: Incomplete Bug description: The version that is shipped with Ubuntu 20.04 x64 segfaults: Starting program: /usr/sbin/usb_modeswitch -W -v 05c6 -p 1000 -K [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Take all parameters from the command line * usb_modeswitch: handle USB devices with multiple modes * Version 2.5.2 (C) Josua Dietze 2017 * Based on libusb1/libusbx ! PLEASE REPORT NEW CONFIGURATIONS ! DefaultVendor= 0x05c6 DefaultProduct= 0x1000 StandardEject=1 [New Thread 0x7ffff7d58700 (LWP 16370)] Look for default devices ... found USB ID 05ac:8406 found USB ID 1d6b:0003 found USB ID 05ac:0291 found USB ID 05ac:828f found USB ID 0a5c:4500 found USB ID 05c6:1000 vendor ID matched product ID matched found USB ID 0781:5567 found USB ID 1d6b:0002 Found devices in default mode (1) Access device 015 on bus 001 Get the current device configuration ... Current configuration number is 1 Use interface number 0 with class 8 Use endpoints 0x01 (out) and 0x81 (in) USB description data (for identification) Error: could not get description string "serial number" ------------------------- Manufacturer: Qualcomm, Incorporated Product: Qualcomm CDMA Technologies MSM Serial No.: read error ------------------------- Sending standard EJECT sequence Looking for active drivers ... libusb: error [_open_sysfs_attr] open /sys/bus/usb/devices/1-2/bConfigurationValue failed ret=-1 errno=2 Thread 1 "usb_modeswitch" received signal SIGSEGV, Segmentation fault. 0x0000555555559771 in ?? () (gdb) bt #0 0x0000555555559771 in ?? () #1 0x0000555555557109 in ?? () #2 0x00007ffff7dd10b3 in __libc_start_main (main=0x555555556820, argc=7, argv=0x7fffffffe098, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe088) at ../csu/libc-start.c:308 #3 0x0000555555557bde in ?? () I tried to compile latest available version: usb- modeswitch-2.6.0.tar.bz2 (md5: be73dcc84025794081a1d4d4e5a75e4c) and it does not crash To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/usb-modeswitch/+bug/1880191/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp