Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
maXmo
Posts: 4
Joined: 05 Jan 2013, 12:48

segfault on linux mint and alcatel OT-X220S

Post by maXmo » 05 Jan 2013, 12:57

usb_modeswitch.log is

Code: Select all

USB_ModeSwitch log from Sat Jan  5 14:38:59 2013

Using global config file: /etc/usb_modeswitch.conf

Raw args from udev: /2-1.1:1.0

Bus ID for device not given by udev.
 Trying to determine it from kernel name (2-1.1:1.0) ...
Using top device dir /sys/bus/usb/devices/2-1.1

USB dir exists: /sys/bus/usb/devices/2-1.1

SCSI dir exists: /sys/bus/usb/devices/2-1.1
Warning: SCSI attribute "vendor" not readable.
Warning: SCSI attribute "model" not readable.
Warning: SCSI attribute "rev" not readable.
----------------
USB values from sysfs:
  idVendor	1bbb
  idProduct	f000
  manufacturer	USBModem
  product	HSPA Data Card
  serial	1234567890ABCDEF
  bNumConfigurations	1
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
Searching entries named: /usr/share/usb_modeswitch/1bbb:f000*
Searching overriding entries named: /etc/usb_modeswitch.d/1bbb:f000*
SCSI attributes not needed, moving on.

Extracting config 1bbb:f000 from collection /usr/share/usb_modeswitch/configPack.tar.gz
config: TargetVendor set to 1bbb
config: TargetProduct set to 0000,0017
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1
! matched, now switching
Command to be run:
/usr/sbin/usb_modeswitch -I -W -D -s 20 -c /run/usb_modeswitch/current_cfg -u -1   -v 1bbb -p f000 2>&1

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are expected in the process)
--------------------------------

Reading config file: /run/usb_modeswitch/current_cfg

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 1.2.3 (C) Josua Dietze 2012
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1bbb
DefaultProduct= 0xf000
TargetVendor=   0x1bbb
TargetProduct=  not set
TargetClass=    not set
TargetProductList="0000,0017"

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint=  not set
MessageContent="55534243123456788000000080000606f50402527000000000000000000000"
NeedResponse=0
ResponseEndpoint= not set

InquireDevice disabled
Success check enabled, max. wait time 20 seconds
System integration mode enabled


Looking for target devices ...
  searching devices, found USB ID 1bbb:f000
   found matching vendor ID
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 1bcf:2c18
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002
 No devices in target mode or class found
Looking for default devices ...
  searching devices, found USB ID 1bbb:f000
   found matching vendor ID
   found matching product ID
   adding device
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 1bcf:2c18
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002
 Found device in default mode, class or configuration (1)
Accessing device 012 on bus 002 ...
Skipping the check for the current configuration
Using first interface: 0x00
Using endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: USBModem
     Product: HSPA Data Card
  Serial No.: 1234567890ABCDEF
-------------------------
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Resetting response endpoint 0x81
Resetting message endpoint 0x01

Checking for mode switch (max. 20 times, once per second) ...
 Searching for target devices ...
  searching devices, found USB ID 1bbb:0017
   found matching vendor ID
   found matching product ID from list
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 1bcf:2c18
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002

Found target device, now opening

Found target device 013 on bus 002

Target device description data
-------------------------
Manufacturer: USBModem
     Product: HSPA Data Card
  Serial No.: 1234567890ABCDEF
-------------------------
 Found correct target device

Mode switch succeeded. Bye.

ok:1bbb:0017
--------------------------------
(end of usb_modeswitch output)
Checking success of mode switch for max. 20 seconds ... Reading attributes ...
USB dir exists: /sys/bus/usb/devices/2-1.1
 All attributes matched
Mode switching was successful, found 1bbb:0017 (USBModem: HSPA Data Card)Now checking for bound driver ...
 no driver has bound to interface 0 yet
Device not in "bind_list" yet, bind it now

dmesg is

Code: Select all

[ 3895.137292] usb 2-1.1: >USB disconnect, device number 12
[ 3895.333999] usb 2-1.1: >new high-speed USB device number 13 using ehci_hcd
[ 3895.429965] usb 2-1.1: >New USB device found, idVendor=1bbb, idProduct=0017
[ 3895.429974] usb 2-1.1: >New USB device strings: Mfr=3, Product=2, SerialNumber=4
[ 3895.429980] usb 2-1.1: >Product: HSPA Data Card
[ 3895.429985] usb 2-1.1: >Manufacturer: USBModem
[ 3895.429990] usb 2-1.1: >SerialNumber: 1234567890ABCDEF
[ 3895.434671] scsi13 : usb-storage 2-1.1:1.4
[ 3896.435321] scsi 13:0:0:0: >Direct-Access     ALCATEL  Mass Storage     2.31 PQ: 0 ANSI: 2
[ 3896.437105] sd 13:0:0:0: >Attached scsi generic sg2 type 0
[ 3896.439863] sd 13:0:0:0: >[sdb] Attached SCSI removable disk
[ 3898.148291] usb_modeswitch_[4246]: segfault at 0 ip b75cdee1 sp bfae074c error 4 in libc-2.15.so[b7550000+1a3000]
I created udev rule

Code: Select all

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", RUN+="/sbin/modprobe usbserial vendor=0x1bbb product=0x0017"
and now it works

Apparently it switches the modem but fails to load a driver for it.

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: segfault on linux mint and alcatel OT-X220S

Post by LOM » 05 Jan 2013, 14:14

maXmo wrote:segfault on linux mint and alcatel OT-X220S
Yes but which kernel version?
Your usb_modeswitch package is not up to date, 1.2.5 is current..
The driver to load is not usbserial but the option driver (usb_wwan.ko + option.ko for newer kernels, only option.ko for older kernels).
You should not have to create a udev rule for loading the driver and my guess is that the segfault is caused by an old option driver in a newer kernel.

maXmo
Posts: 4
Joined: 05 Jan 2013, 12:48

Re: segfault on linux mint and alcatel OT-X220S

Post by maXmo » 06 Jan 2013, 14:06

Linux version 3.5.0-17-generic

option.ko:

filename: /lib/modules/3.5.0-17-generic/kernel/drivers/usb/serial/option.ko
license: GPL
version: v0.7.2
depends: usb_wwan,usbserial
intree: Y
vermagic: 3.5.0-17-generic SMP mod_unload modversions 686
parm: debug:Debug messages (bool)

is it old?

hmmm... wwan? Now I remember a log entry saying that WWAN is turned off. I turned off wifi from keyboard (as I don't need it). Can this cause problems?

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Re: segfault on linux mint and alcatel OT-X220S

Post by Josh » 06 Jan 2013, 14:35

I suspect the culprit of the crash is the C port of the usb_modeswitch_dispatcher script that Ubuntu chose to employ. I'm not the author of that.

https://bugs.launchpad.net/ubuntu/+sour ... bug/829519
https://bugs.launchpad.net/ubuntu/+sour ... bug/941004

maXmo
Posts: 4
Joined: 05 Jan 2013, 12:48

Re: segfault on linux mint and alcatel OT-X220S

Post by maXmo » 06 Jan 2013, 14:39

modprobe option tells

kernel: [28274.630564] usbcore: registered new interface driver usbserial
kernel: [28274.630604] usbcore: registered new interface driver usbserial_generic
kernel: [28274.630632] USB Serial support registered for generic
kernel: [28274.630641] usbserial: USB Serial Driver core
kernel: [28274.639471] usbcore: registered new interface driver option
kernel: [28274.639488] USB Serial support registered for GSM modem (1-port)

but network manager doesn't recognize the device.

maXmo
Posts: 4
Joined: 05 Jan 2013, 12:48

Re: segfault on linux mint and alcatel OT-X220S

Post by maXmo » 06 Jan 2013, 15:15

Josh wrote:I suspect the culprit of the crash is the C port of the usb_modeswitch_dispatcher script that Ubuntu chose to employ. I'm not the author of that.

https://bugs.launchpad.net/ubuntu/+sour ... bug/829519
https://bugs.launchpad.net/ubuntu/+sour ... bug/941004
Yes, looks like it https://bugs.launchpad.net/ubuntu/+sour ... bug/824147

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: segfault on linux mint and alcatel OT-X220S

Post by LOM » 06 Jan 2013, 15:23

maXmo wrote:Linux version 3.5.0-17-generic
Your 3G stick is recently added in the option driver, unsupported in 3.6.5 but supported in 3.6.11
It is the same stick usb id (1bbb:0017) as discussed here:

http://www.draisberghof.de/usb_modeswit ... f=3&t=1230

so update your kernel and the usb_modeswitch package.

Post Reply