Public bug reported:

I don't know exactly what the issue is, other than a test suite failing
which doesn't fail on other devices. On my own system it is very
reproducible, but does require running the library PcapPlusPlus, and if
you are willing to run this, I've provided all info I can about
precisely where the test case fails (which does involve diving into some
C++). Apologies that this report contains a lot of info about
PcapPlusPlus. It may be possible to reproduce in other ways, but this is
how I came across what I believe is a network driver issue. (Hopefully
this is the right place to report this.)

# My Release of Ubuntu:
Description:    Ubuntu 20.04.2 LTS
Release:        20.04


# Package Version:
network-manager:
  Installed: 1.22.10-1ubuntu2.2
  Candidate: 1.22.10-1ubuntu2.2
  Version table:
 *** 1.22.10-1ubuntu2.2 500
        500 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 
Packages
        100 /var/lib/dpkg/status
     1.22.10-1ubuntu1 500
        500 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 Packages


# What I was attempting to do:
Running the test suite from PcapPlusPlus (an open-source C++ wrapper over the 
libpcap library). I have run the test suite on other systems with different 
network cards and drivers, also on Ubuntu 20.04, and all tests pass without an 
issue.

When testing on other systems, although the network is not accessible
whilst the tests are running, as soon as the tests have completed,
network access is restored. If the test suite is interrupted, network
access is also restored.


# What happens instead:
The test suite for the library PcapPlusPlus causes my network device to 
disconnect from the router it is connected to.

The test which causes the problem is one which attempts to send a number
of predefined packets from a .pcap file over the network device.

I believe that the network driver is likely the cause of the problem. The 
driver I am running is `ath9k`. The output of `sudo lspci -v` showed the 
following info about my network device:
```
05:00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network Adapter 
(rev 01)
        Subsystem: Qualcomm Atheros AR93xx Wireless Network Adapter
        Flags: bus master, fast devsel, latency 0, IRQ 19
        Memory at dfe00000 (64-bit, non-prefetchable) [size=128K]
        Expansion ROM at dfe20000 [disabled] [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
        Capabilities: [70] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [300] Device Serial Number 00-00-00-00-00-00-00-00
        Kernel driver in use: ath9k
        Kernel modules: ath9k
```

You will likely need the same driver and/or network device to see the
issue.

Steps to reproduce:
1. Clone PcapPlusPlus from its github repository: 
https://github.com/seladb/PcapPlusPlus
2. Enter the PcapPlusPlus directory
```
cd PcapPlusPlus
```
3. Configure PcapPlusPlus for linux:
```
./configure-linux.sh
```
4. Make the library
```
make all -j4
```
-jN flag specifies the number of concurrent threads for make  
5. Change directory into the Tests/Pcap++Test directory (from the root of the 
project)
```
cd Tests/Pcap++Test
```
6. Find the ip address of your network device using `ifconfig` or `ip address`
7. Run the PcapPlusPlus tests
```
sudo Bin/Pcap++Test -i <ip-address> -v -t TestSendPacket
```
* `-i` flag specifies the interface to use
* `-v` flag specifies verbose mode (optional)
* `-t` flag specifies the test to run. The test which causes the problem is 
TestSendPacket (optional, if you run the whole test suite, you will still land 
on this test after a short while)
* `sudo` is required for PcapPlusPlus to open the network device.

If the error occurs, the test will hang and not complete.


# Additional info:
It is possible to pinpoint where the test is hanging using logging.

If you look in the file 
`PcapPlusPlus/Tests/Pcap++Test/Tests/LiveDeviceTests.cpp`, the test which fails 
to complete is:
```
PTF_TEST_CASE(TestSendPacket)
```
You should find this test case. Inside the `while` loop in this test, packets 
are loaded in from a .pcap file, and sent over the network interface.

The .pcap file which defines the packets to be sent is
`PcapPlusPlus/Tests/Pcap++Test/PcapExamples/example.pcap`

To add logging, use the macro:
```
PTF_PRINT_VERBOSE("message");
```
This has the same syntax as `printf` for printing variables. E.g. to print the 
number of packets read:
```
PTF_PRINT_VERBOSE("Packets read: %d", packetsRead);
```
Make sure to make the library again if you add any logging. Change directory to 
the root of the project and follow step 4.

If I restart my network device in-between runs (going into wifi settings
and using the toggle at the top of the page), it will hang when
attempting to send the 67th packet from the file
`PcapPlusPlus/Tests/Pcap++Test/PcapExamples/example.pcap`

If I do not restart my network device between runs of the test suite,
the suite will hang whilst trying to send the 53rd packet from
`PcapPlusPlus/Tests/Pcap++Test/PcapExamples/example.pcap`.

Not only does the test suite fail to finish, but also the device remains
disconnected from the router afterwards, until a restart of the device
(again with the toggle switch in the wifi settings). I am unable to ping
any devices (including my own router) after running the test.

The kernel logs `dmesg -wH` show that the device enters promiscuous mode
at the start of transmission, and leaves promiscuous mode when the test
is stopped with Ctrl + C.

For more info on PcapPlusPlus: https://pcapplusplus.github.io/
For more info on PcapPlusPlus tests: https://pcapplusplus.github.io/docs/tests

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: network-manager 1.22.10-1ubuntu2.2
ProcVersionSignature: Ubuntu 5.8.0-45.51~20.04.1-generic 5.8.18
Uname: Linux 5.8.0-45-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.16
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Tue Mar 16 00:32:59 2021
InstallationDate: Installed on 2020-11-05 (130 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
IpRoute:
 default via 192.168.1.1 dev wlp5s0 proto dhcp metric 600 
 169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown 
 192.168.1.0/24 dev wlp5s0 proto kernel scope link src 192.168.1.122 metric 600 
 192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: network-manager
UpgradeStatus: No upgrade log present (probably fresh install)
nmcli-nm:
 RUNNING  VERSION  STATE      STARTUP  CONNECTIVITY  NETWORKING  WIFI-HW  WIFI  
   WWAN-HW  WWAN    
 running  1.22.10  connected  started  full          enabled     enabled  
enabled  enabled  enabled

** Affects: network-manager (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug focal

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1919265

Title:
  PcapPlusPlus test suite crashes network adapter

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1919265/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to