Debian Bug report logs - #587634
wpasupplicant: race condition in /etc/wpa_supplicant/functions.sh?

version graph

Package: wpasupplicant; Maintainer for wpasupplicant is Debian/Ubuntu wpasupplicant Maintainers <pkg-wpa-devel@lists.alioth.debian.org>; Source for wpasupplicant is src:wpa.

Reported by: Timo Juhani Lindfors <timo.lindfors@iki.fi>

Date: Wed, 30 Jun 2010 13:51:02 UTC

Severity: normal

Found in version wpasupplicant/0.6.10-2

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian/Ubuntu wpasupplicant Maintainers <pkg-wpa-devel@lists.alioth.debian.org>:
Bug#587634; Package wpasupplicant. (Wed, 30 Jun 2010 13:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Timo Juhani Lindfors <timo.lindfors@iki.fi>:
New Bug report received and forwarded. Copy sent to Debian/Ubuntu wpasupplicant Maintainers <pkg-wpa-devel@lists.alioth.debian.org>. (Wed, 30 Jun 2010 13:51:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Timo Juhani Lindfors <timo.lindfors@iki.fi>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: wpasupplicant: race condition in /etc/wpa_supplicant/functions.sh?
Date: Wed, 30 Jun 2010 16:46:42 +0300
Package: wpasupplicant
Version: 0.6.10-2
Severity: normal

Steps to reproduce:
1) cat >> /etc/network/interfaces << EOF
iface hacklab inet dhcp
 wpa-driver wext
 wpa-ssid "Langtao"
 wpa-psk "CENSORED"
 wpa-verbosity 9
 wpa-debug-level 3
EOF
2) sudo ifup wlan=hacklab

Expected results:
2) wlan interface goes up and gets an IP using DHCP

Actual results:
2) wlan interface does not get an IP:

wpa_supplicant: wpa-driver wext
wpa_supplicant: using debug level: 3
wpa_supplicant: /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan.pid -i wlan -D wext -t -ddd -C /var/run/wpa_supplicant
Starting /sbin/wpa_supplicant...
ioctl[SIOCSIWESSID]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Operation not supported
ioctl[SIOCSIWENCODEEXT]: Operation not supported
ioctl[SIOCSIWENCODEEXT]: Operation not supported
ioctl[SIOCSIWENCODEEXT]: Operation not supported
1277831021.556575: WPS: UUID based on MAC address - hexdump(len=16): 75 0b a6 f5 64 b0 5f fa 8a 5e a7 59 cc 7e b9 df
wpa_supplicant: creating sendsigs omission pidfile: /lib/init/rw/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan.pid
wpa_supplicant: ctrl_interface socket located at /var/run/wpa_supplicant/wlan
wpa_supplicant: configuring network block -- 'ADD_NETWORK' command timed out.
wpa_supplicant: wpa-ssid "Langtao" -- Invalid SET_NETWORK command: needs three arguments
(network id, variable name, and value)
wpa_supplicant: wpa-ssid "Langtao" failed!
wpa_supplicant: wpa-psk ***** -- Invalid SET_NETWORK command: needs three arguments
(network id, variable name, and value)
wpa_supplicant: wpa-psk ***** failed!
wpa_supplicant: enabling network block 'ADD_NETWORK' command timed out. -- wpa_supplicant: enabling network block 'ADD_NETWORK' command timed out. failed!
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan/00:12:cf:8e:ee:09
Sending on   LPF/wlan/00:12:cf:8e:ee:09
Sending on   Socket/fallback
DHCPDISCOVER on wlan to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlan to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on wlan to 255.255.255.255 port 67 interval 17
DHCPDISCOVER on wlan to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on wlan to 255.255.255.255 port 67 interval 10
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

More info:
1) strace reveals that the line

WPA_ID=$(wpa_cli add_network)

in /etc/wpa_supplicant/function.sh sometimes sets WPA_ID to the value
of "'ADD_NETWORK' command timed out." instead of the usual "0". This
then causes functions.sh to run funny stuff like

10622 execve("/sbin/wpa_cli", ["/sbin/wpa_cli", "-p", "/var/run/wpa_supplicant", "-i", "wlan", "set_network", "'ADD_NETWORK'", "command", "timed", "out.", "ssid", "\"Langtao\""], [/* 14 vars */]) = 0
10627 execve("/sbin/wpa_cli", ["/sbin/wpa_cli", "-p", "/var/run/wpa_supplicant", "-i", "wlan", "set_network", "'ADD_NETWORK'", "command", "timed", "out.", "psk", "\"CENSORED\""], [/* 14 vars */]) = 0
10628 execve("/sbin/wpa_cli", ["/sbin/wpa_cli", "-p", "/var/run/wpa_supplicant", "-i", "wlan", "enable_network", "'ADD_NETWORK' command timed out."], [/* 14 vars */]) = 0

Maybe wpa_cli gets to run before wpasupplicant has managed to bind its
unix socket?

In any case, functions.sh should detect the case where wpa_cli fails
and not try to pass its error message as an argument for other
commands...

2) For now I can connect to the network using

sudo killall dhclient
sudo killall wpa_supplicant
om wifi power 0
sleep 4
om wifi power 1
sleep 4
sudo /sbin/wpa_supplicant -B -s -P /var/run/wpa_supplicant.wlan.pid -i wlan -D  wext -t -ddd -C /var/run/wpa_supplicant
sleep 4
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan add_network
sleep 4
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan set_network 0 ssid "\"Langtao\""
sleep 4
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan set_network 0 psk "\"CENSORED\""
sleep 4
sudo wpa_cli -p /var/run/wpa_supplicant -i wlan enable_network 0
sleep 4
sudo dhclient -d wlan

but I'd definitely want to get back to using ifup and ifdown.

3) The device is an openmoko freerunner gta02v5 running debian
unstable with the following exceptions:

3.1) linux is from
http://git.openmoko.org/?p=kernel.git;a=commit;h=a3587e4ed77974adfb057af261aaeea4022018e8
and uses the ar6000 kernel module for wlan

3.2) Qi (boot loader) is from
http://git.openmoko.org/?p=qi.git;a=commit;h=9ef7754b8243457ce9e3edb01bb078fac1f77ac1


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: armel (armv4tl)

Kernel: Linux 2.6.29-GTA02_lindi2-andy-tracking-mokodev
Locale: LANG=C, LC_CTYPE=fi_FI (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages wpasupplicant depends on:
ii  adduser                       3.112      add and remove users and groups
ii  libc6                         2.11.2-2   Embedded GNU C Library: Shared lib
ii  libdbus-1-3                   1.2.24-1   simple interprocess messaging syst
ii  libnl1                        1.1-5      library for dealing with netlink s
ii  libpcsclite1                  1.5.5-3    Middleware to access a smart card 
ii  libreadline6                  6.1-3      GNU readline and history libraries
ii  libssl0.9.8                   0.9.8o-1   SSL shared libraries
ii  lsb-base                      3.2-23.1   Linux Standard Base 3.2 init scrip

wpasupplicant recommends no packages.

Versions of packages wpasupplicant suggests:
pn  libengine-pkcs11-openssl      <none>     (no description available)
pn  wpagui                        <none>     (no description available)


-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Debian/Ubuntu wpasupplicant Maintainers <pkg-wpa-devel@lists.alioth.debian.org>:
Bug#587634; Package wpasupplicant. (Mon, 04 Apr 2011 08:36:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Timo Juhani Lindfors <timo.lindfors@iki.fi>:
Extra info received and forwarded to list. Copy sent to Debian/Ubuntu wpasupplicant Maintainers <pkg-wpa-devel@lists.alioth.debian.org>. (Mon, 04 Apr 2011 08:36:03 GMT) Full text and rfc822 format available.

Message #10 received at 587634@bugs.debian.org (full text, mbox):

From: Timo Juhani Lindfors <timo.lindfors@iki.fi>
To: 587634@bugs.debian.org
Subject: #587634: Re: wpasupplicant: race condition in /etc/wpa_supplicant/functions.sh?
Date: Mon, 04 Apr 2011 11:24:12 +0300
Hi,

ping? I guess this report got unnoticed, could somebody take a look? To
me it seems we should replace

WPA_ID=$(wpa_cli add_network)

with something that'd retry several times and exit if wpa_cli does not
succeed at all.





Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 13:44:55 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.