DebuggingNetworkManager

Differences between revisions 38 and 39
Revision 38 as of 2011-10-26 20:59:54
Size: 8947
Editor: cyphermox
Comment:
Revision 39 as of 2011-10-26 21:11:25
Size: 7665
Editor: cyphermox
Comment:
Deletions are marked like this. Additions are marked like this.
Line 45: Line 45:
See also [[DebuggingModemmanager]].
Line 157: Line 158:
== 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
}}}
Line 222: Line 180:
See [[DebuggingModemmanager]] for the same instructions for ModemManager.
Line 242: Line 202:

Debugging Central

This page is part of the debugging series — pages with debugging details for a variety of Ubuntu packages.

Bug Summary

If a network-manager bug report is about not being able to connect the title or summary should be in the format:

"[CHIPSET] cannot connect to (ENCRYPT_METHOD)"

where the CHIPSET is the wireless driver used and ENCRYPT_METHOD is the encryption method used by your wireless network.

Understanding your bug and getting more information

Getting debug logs

First, make sure you have the debug helper script: http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/test/debug-helper.py.

You can then follow developers' intructions on a bug report for the exact command line to use; or run it directly as such:

Getting NetworkManager debug logs

sudo python debug-helper.py --nm debug

Then get the logs which will be written to /var/log/syslog. To disable it, pass info instead of debug in the above command, or reboot.

In the above command, you can also include specific domains to enable logging for, see 'sudo /usr/sbin/NetworkManager --help':

sudo python debug-helper.py --nm debug --domains core ip4 ip6

Getting ModemManager debug logs

sudo python debug-helper.py --mm debug

Then get the logs which will be written to /var/log/syslog. To disable it, pass info instead of debug in the above command, or reboot.

See also DebuggingModemmanager.

Getting wpasupplicant debug logs

sudo python debug-helper.py --wpa debug

Then get the logs which will be written to /var/log/syslog. To disable it, pass info instead of debug in the above command, or reboot.

Getting a capture of syslog

Mixing and mashing the above is perfectly acceptable as well if you want to see how NetworkManager and other parts of the stack interact together.

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. You can also do this on the fly as you test with the command logger "[ clicked on wireless network 'ubuntu']" .

Example marker:

Sep  6 08:12:30 ...

[ clicked on wireless network 'ubuntu']

Sep  6 08:12:31 ...
...

Handling 3G / modem issues

An few extra things that are very helpful to add in case of issues with 3G:

The output of udevadm for tty devices, and output of lsusb:

$ udevadm info --query=all --path=/sys/class/tty/... --attribute-walk

$ lsusb

A Testcase

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

Stop NetworkManager

  sudo stop network-manager

To unload your driver  sudo modprobe -r DRIVER .

Then load the driver  sudo modprobe DRIVER  and start NetworkManager:

  sudo start network-manager

Debugging Crashes

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

deb http://ddebs.ubuntu.com/ natty main universe

or

deb http://ddebs.ubuntu.com/ oneiric main universe

Then install the appropriate dbgsym packages:

  sudo apt-get update
  sudo apt-get install network-manager-dbgsym libnm-util2-dbgsym libnm-glib4-dbgsym libglib2.0-0-dbgsym

Then stop NetworkManager:

sudo stop network-manager

Run NetworkManager in a debugger

sudo gdb /usr/sbin/NetworkManager
...
(gdb) run --no-daemon

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.

Bug Tags

These tags allow isolation of bugs into smaller groups, providing an easier and faster way to work on specific issues.

Tag

Use case

`driver-madwifi`

Bugs in which the madwifi driver is in use

`driver-ndiswrapper`

Bugs in which the ndiswrapper driver is in use

`vpn`

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

`encryption-wep`

Bugs in which WEP encryption is used

`encryption-wpa`

Bugs in which WPA encryption is used

`encryption-wpa2`

Bugs in which WPA2 encryption is used

The previously described tags are specific to the NetworkManager application, if you need more general tags please visit Bugs/Tags page.

Testing a patch

It's often a good idea to check in the NM trunk PPA to see if an updated version of NetworkManager fixes the bugs you see. Be careful though, as those are daily builds that may break other things, and are to be considered unstable.

Sometimes a developer might ask you to test a quick patch he came up with. Below an example how to do that for network-manager. If your bug is for network-manager-applet or some other package, just replace the package name

See DebuggingModemmanager for the same instructions for ModemManager.

# get build dependencies
sudo apt-get install build-essential fakeroot devscripts
sudo apt-get build-dep network-manager

# get sources
sudo apt-get source network-manager

# cd into the source directory
cd network-manager-*/

# apply the patch (note that -p1 could also be -p0 if the patch was created without an extra prefix in the diff path)
patch -p1 < /tmp/yourdownloadedpatch.diff

# build binaries only without signing
debuild -b -uc

# packages are produced in parent directory
cd ../


# install all nm packages
sudo dpkg -i network-manager*.deb libnm-*.deb

Note that you didnt change the version of the package. so to get back to the "official" current version you need to do something like:

  sudo apt-get install --reinstall network-manager libnm-util2 libnm-glib4

if you installed other packages from the build, do the same for them.


CategoryBugSquad

DebuggingNetworkManager (last edited 2016-08-02 09:34:57 by penalvch)