DebuggingNetworkManager
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://people.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