DebuggingNetworkManager

Revision 12 as of 2007-12-06 13:45:56

Clear message

A Testcase

A good testcase is a step by step instruction to reproduce your bug starting with driver unloaded and NetworkManager stopped.

Kill NetworkManager

  sudo killall NetworkManager

To unload your driver  modprobe -r DRIVER .

Then load the driver and start NetworkManager:

  sudo NetworkManager

Capture Log

In order to understand whats going on and track down issues, its good to have a full log. To do so, capture the complete test case and submit the whole file (don't cut out what you think is important). Please add markers in the log file so the bug triager can easily see what actions the user takes at what point of time (this isn't essential, but helps a lot).

To capture the syslog, do:

 tail -n0 -f /var/log/syslog > /tmp/syslog

and to stop capturing do Ctrl-C (you will have to type your other commands in an other window or tab)

Adding markers is just like adding new lines with an editor that show the triager what happened at what point of time.

Example marker:

Sep  6 08:12:30 ...

[ clicked on wireless network 'ubuntu']
Sep  6 08:12:31 ...
...

Debugging Crashes

To install debug symbols, add the following line to your /etc/apt/sources.list

deb http://ddebs.ubuntu.com/~ubuntu-archive/ddebs/ gutsy main universe

Then install the appropriate dbgsym packages:

sudo apt-get update
sudo apt-get install network-manager-dbgsym libnm-util0-dbgsym libnm-glib0-dbgsym libglib2.0-0-dbgsym

Then restart NetworkManager:

sudo /etc/dbus-1/event.d/25NetworkManager restart

Attach the debugger to the pid of NetworkManager

sudo gdb /usr/bin/NetworkManager $(pidof NetworkManager)
...
(gdb) continue

Once it crashes get a backtrace

(gdb) bt
...
(gdb) bt full
...
(gdb) thread apply all bt full
...

and attach the backtrace above together with your /var/log/syslog to the bug.

Driver Logs

When a bug appears to be driver related or you are asked by a bug triager to submit a driver enabled log, you need to enable driver logging right before you start to capture your testcase. How to do that depends on the driver you use and whether it has been with compiled with debug support.

Driver Specific Info

IPW (2100,2200, 3945)

Logging

# either during module load:
 modprobe ipw{2100,2200,3945} debug=65535

# or when already loaded you can change the debug_level through /sys/bus/.../drivers/
 echo 65535 > /sys/bus/pci/drivers/ipw{2100,2200,3945}/debug_level

Compiling Module Sources

For debugging purpose or to verify a fix, a developer might ask you to build your driver module from source. for ipwXXXX you can do that by:

# install required headers and build tools
sudo apt-get install module-assistant
sudo module assistant update
sudo module assistant prepare

# build the driver
cd /path/to/ipw-XXXX
make IEEE80211_IGNORE_DUPLICATE=y SHELL=/bin/bash

# backup your old ipw driver:
sudo cp /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ipw3945/ipw3945.ko $HOME

# install the new driver
cp ipw3945.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ipw3945/
depmod -a

# kill regulatory daemon
ipw3945d-$(uname -r) --kill

#load new module
modprobe ipw3945

Bug Tags

This tags allows to isolate bugs into smaller groups, providing an easiest and faster way to work on specific issues.

Tag

Use case

Link

driver-madwifi

Bugs in which the madwifi driver is in use

[https://launchpad.net/ubuntu/+bugs?field.tag=driver-madwifi link]

driver-ipw2100

Bugs in which the ipw2100 driver is in use

[https://launchpad.net/ubuntu/+bugs?field.tag=driver-ipw2100 link]

driver-ndiswrapper

Bugs in which the ndiswrapper driver is in use

[https://launchpad.net/ubuntu/+bugs?field.tag=driver-ndiswrapper link]

vpn

Bugs related to either openvpn, vpnc or pptp network-manager vpn modules

[https://launchpad.net/ubuntu/+bugs?field.tag=vpn link]

encryption-wep

Bugs in which WEP encryption is used

[https://launchpad.net/ubuntu/+bugs?field.tag=encryption-wep link]

encryption-wpa

Bugs in which WPA encryption is used

[https://launchpad.net/ubuntu/+bugs?field.tag=encryption-wpa link]

encryption-wpa2

Bugs in which WPA2 encryption is used

[https://launchpad.net/ubuntu/+bugs?field.tag=encryption-wpa2 link]


CategoryBugSquad