Skip to content

native: reboot exits instance with TAP interface #14636

@miri64

Description

@miri64

Description

When rebooting on a native instance using a tap device, the instance exits with an error message that the TAP device is already in use (EBUSY). This is the case since a274ea4 (#12428) according to my bisect.

Steps to reproduce the issue

Start a native instance of examples/gnrc_networking

sudo dist/tools/tapsetup/tapsetup -d
sudo dist/tools/tapsetup/tapsetup
BOARD=native make -C examples/gnrc_networking
BOARD=native make -C examples/gnrc_networking term

and type reboot.

make: Entering directory '/home/mlenders/Repositories/RIOT-OS/RIOT/examples/gnrc_networking'
/home/mlenders/Repositories/RIOT-OS/RIOT/examples/gnrc_networking/bin/native/gnrc_networking.elf tap0
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2020.10-devel-277-ge8a8d-HEAD)
RIOT network stack example application
All up, running the shell now
> reboot
reboot


		!! REBOOT !!

Expected results

The node should reboot, the shell input is available again:

RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2020.10-devel-277-ge8a8d-HEAD)
RIOT network stack example application
All up, running the shell now
> help
help
Command              Description
---------------------------------------
udp                  send data over UDP and listen on UDP ports
reboot               Reboot the node
version              Prints current RIOT_VERSION
pm                   interact with layered PM subsystem
ps                   Prints information about running threads.
ping6                Ping via ICMPv6
ping                 Ping via ICMPv6
random_init          initializes the PRNG
random_get           returns 32 bit of pseudo randomness
nib                  Configure neighbor information base
ifconfig             Configure network interfaces
rpl                  rpl configuration tool ('rpl help' for more information)
> 

Actual results

native instance exits due to EBUSY when trying to use the TAP device.

RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

/home/mlenders/Repositories/RIOT-OS/RIOT/examples/gnrc_networking/bin/native/gnrc_networking.elf: ioctl TUNSETIFF: Device or resource busy
/home/mlenders/Repositories/RIOT-OS/RIOT/examples/gnrc_networking/bin/native/gnrc_networking.elf: probably the tap interface (tap0) does not exist or is already in use
make: *** [/home/mlenders/Repositories/RIOT-OS/RIOT/examples/gnrc_networking/../../Makefile.include:721: term] Error 1
make: Leaving directory '/home/mlenders/Repositories/RIOT-OS/RIOT/examples/gnrc_networking'

Versions

All RIOT versions after and including a274ea4 (#12428)

Operating System Environment
----------------------------
         Operating System: "Arch Linux" 
                   Kernel: Linux 5.7.10-arch1-1 x86_64 unknown
             System shell: GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
             make's shell: GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)

Installed compiler toolchains
-----------------------------
               native gcc: gcc (GCC) 10.1.0
        arm-none-eabi-gcc: arm-none-eabi-gcc (Arch Repository) 10.1.0
                  avr-gcc: missing
         mips-mti-elf-gcc: missing
               msp430-gcc: missing
     riscv-none-embed-gcc: missing
     xtensa-esp32-elf-gcc: missing
   xtensa-esp8266-elf-gcc: missing
                    clang: clang version 10.0.1 

Installed compiler libs
-----------------------
     arm-none-eabi-newlib: "3.3.0"
      mips-mti-elf-newlib: missing
  riscv-none-embed-newlib: missing
  xtensa-esp32-elf-newlib: missing
xtensa-esp8266-elf-newlib: missing
                 avr-libc: missing (missing)

Installed development tools
---------------------------
                   ccache: ccache version 3.7.11
                    cmake: cmake version 3.18.0
                 cppcheck: missing
                  doxygen: 1.8.18
                      git: git version 2.27.0
                     make: GNU Make 4.3
                  openocd: Open On-Chip Debugger 0.10.0+dev-01089-g3bfe49266 (2020-02-26-14:18)
                   python: Python 3.8.4
                  python2: Python 2.7.18
                  python3: Python 3.8.4
                   flake8: 3.8.3 (mccabe: 0.6.1, pycodestyle: 2.6.0, pyflakes: 2.2.0) CPython 3.8.4 on
               coccinelle: missing

Metadata

Metadata

Labels

Area: cpuArea: CPU/MCU portsArea: networkArea: NetworkingPlatform: nativePlatform: This PR/issue effects the native platformType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions