Am 15.01.2012 17:48, schrieb Frederic MASSOT:
I have several crash of usb_modeswitch_dispatcher ...
...
Jan 15 17:12:23 lobon usb_modeswitch_dispatcher: *** glibc detected
*** /usr/sbin/usb_modeswitch_ dispatcher: free(): invalid next size
(normal): 0x099c3340 ***

After several tests I have pinpointed a problem with seems to revolve around setting the PATH environment variable from within the dispatcher script. Any subsequent "exec" command resulted in a crash.

This happens only with the binary dispatcher and *only* in the udev-triggered context. Running the binary dispatcher manually from the command line will succeed as expected.

I have attached a patch for an immediate work-around.

Further research is neccessary though.

Josua Dietze
diff -urN usb-modeswitch-1.2.2/usb_modeswitch.tcl 
usb-modeswitch-1.2.2-1/usb_modeswitch.tcl
--- usb-modeswitch-1.2.2/usb_modeswitch.tcl     2012-01-19 01:02:58.000000000 
+0100
+++ usb-modeswitch-1.2.2-1/usb_modeswitch.tcl   2012-01-22 11:43:21.000000000 
+0100
@@ -27,7 +27,7 @@
 set flags(logging) 0
 set flags(noswitching) 0
 
-set env(PATH) "/bin:/sbin:/usr/bin:/usr/sbin"
+#set env(PATH) "/bin:/sbin:/usr/bin:/usr/sbin"
 
 # Execution starts at file bottom
 
@@ -230,7 +230,7 @@
                # Now we are actually switching
                if $flags(logging) {
                        Log "Command to be run:\nusb_modeswitch -I -W -D -s 20 
$configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f 
\$configBuffer"
-                       set report [exec usb_modeswitch -I -W -D -s 20 
$configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f 
"$configBuffer" 2>@ stdout]
+                       set report [exec /usr/sbin/usb_modeswitch -I -W -D -s 
20 $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f 
"$configBuffer" 2>@ stdout]
                        Log "\nVerbose debug output of usb_modeswitch and 
libusb follows"
                        Log "(Note that some USB errors are to be expected in 
the process)"
                        Log "--------------------------------"
@@ -238,7 +238,7 @@
                        Log "--------------------------------"
                        Log "(end of usb_modeswitch output)\n"
                } else {
-                       set report [exec usb_modeswitch -I -Q -D -s 20 
$configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f 
"$configBuffer" 2>@ stdout]
+                       set report [exec /usr/sbin/usb_modeswitch -I -Q -D -s 
20 $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f 
"$configBuffer" 2>@ stdout]
                }
                break
        } else {

Reply via email to