ifquery crashing

Bug #1535648 reported by Hadmut Danisch on 2016-01-19
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ifupdown (Ubuntu)
High
Unassigned

Bug Description

Hi,

I'm just doing some tests where to use an ubuntu machine as a router and thus plugging in an USB Ethernet devices as it's second ethernet interfaces.

Unfortunately I can't keep that damned Network manager from renaming the device (i.e. from eth0 to enx0000e80006d8), even if I tell NM to ignore the device. Since this happens before udev, it confuses several udev scripts).

In context of this problem I found lots of messages in /var/log/syslog of the kind

Jan 19 11:27:22 pcdanisch kernel: [ 58.468781] ifquery[2851]: segfault at 1 ip 0000000000403187 sp 00007ffd578ec7e0 error 4 in ifup[400000+d000]
Jan 19 11:27:22 pcdanisch sh[799]: Segmentation fault (core dumped)
Jan 19 11:27:23 pcdanisch kernel: [ 59.827088] ifquery[2854]: segfault at 1 ip 0000000000403187 sp 00007fffc05179f0 error 4 in ifup[400000+d000]
Jan 19 11:27:30 pcdanisch kernel: [ 67.250139] ifquery[2869]: segfault at 1 ip 0000000000403187 sp 00007ffd35611ce0 error 4 in ifup[400000+d000]
Jan 19 11:27:32 pcdanisch kernel: [ 68.602021] ifquery[2872]: segfault at 1 ip 0000000000403187 sp 00007ffcf72b86d0 error 4 in ifup[400000+d000]
Jan 19 11:27:34 pcdanisch kernel: [ 70.959531] ifquery[2877]: segfault at 1 ip 0000000000403187 sp 00007fffde45f440 error 4 in ifup[400000+d000]
Jan 19 11:27:35 pcdanisch kernel: [ 72.308751] ifquery[2880]: segfault at 1 ip 0000000000403187 sp 00007ffe5b504290 error 4 in ifup[400000+d000]
Jan 19 11:27:38 pcdanisch kernel: [ 74.665195] ifquery[2885]: segfault at 1 ip 0000000000403187 sp 00007ffc740490d0 error 4 in ifup[400000+d000]
Jan 19 11:27:41 pcdanisch kernel: [ 78.025873] ifquery[2892]: segfault at 1 ip 0000000000403187 sp 00007ffe07b6dbc0 error 4 in ifup[400000+d000]
Jan 19 11:27:42 pcdanisch kernel: [ 79.373347] ifquery[2896]: segfault at 1 ip 0000000000403187 sp 00007ffe48bf52c0 error 4 in ifup[400000+d000]
Jan 19 11:27:45 pcdanisch kernel: [ 81.735654] ifquery[2901]: segfault at 1 ip 0000000000403187 sp 00007ffdae631d10 error 4 in ifup[400000+d000]
Jan 19 11:27:46 pcdanisch kernel: [ 83.096254] ifquery[2904]: segfault at 1 ip 0000000000403187 sp 00007fff1832ff20 error 4 in ifup[400000+d000]
Jan 19 11:27:48 pcdanisch kernel: [ 84.464102] ifquery[2907]: segfault at 1 ip 0000000000403187 sp 00007fff187e0190 error 4 in ifup[400000+d000]
Jan 19 11:27:51 pcdanisch kernel: [ 87.846187] ifquery[2926]: segfault at 1 ip 0000000000403187 sp 00007ffdda95e5a0 error 4 in ifup[400000+d000]
Jan 19 11:27:53 pcdanisch kernel: [ 90.221171] ifquery[2943]: segfault at 1 ip 0000000000403187 sp 00007ffc74040e80 error 4 in ifup[400000+d000]
Jan 19 11:27:55 pcdanisch kernel: [ 91.585842] ifquery[2946]: segfault at 1 ip 0000000000403187 sp 00007ffe9e5690a0 error 4 in ifup[400000+d000]
Jan 19 11:27:56 pcdanisch kernel: [ 92.944679] ifquery[2949]: segfault at 1 ip 0000000000403187 sp 00007ffe87e171c0 error 4 in ifup[400000+d000]
Jan 19 11:27:57 pcdanisch kernel: [ 94.311727] ifquery[2952]: segfault at 1 ip 0000000000403187 sp 00007ffc6e785e50 error 4 in ifup[400000+d000]
Jan 19 11:28:00 pcdanisch kernel: [ 96.675499] ifquery[2957]: segfault at 1 ip 0000000000403187 sp 00007fff554d8c50 error 4 in ifup[400000+d000]
Jan 19 11:28:02 pcdanisch kernel: [ 99.054338] ifquery[2962]: segfault at 1 ip 0000000000403187 sp 00007ffe86f84f10 error 4 in ifup[400000+d000]
Jan 19 11:28:03 pcdanisch kernel: [ 100.421026] ifquery[2965]: segfault at 1 ip 0000000000403187 sp 00007ffc207b43e0 error 4 in ifup[400000+d000]
Jan 19 11:28:06 pcdanisch kernel: [ 102.797828] ifquery[2970]: segfault at 1 ip 0000000000403187 sp 00007ffeadf03670 error 4 in ifup[400000+d000]
Jan 19 11:28:10 pcdanisch kernel: [ 107.196645] ifquery[2979]: segfault at 1 ip 0000000000403187 sp 00007ffecb784e70 error 4 in ifup[400000+d000]
Jan 19 11:28:12 pcdanisch kernel: [ 108.559839] ifquery[2982]: segfault at 1 ip 0000000000403187 sp 00007ffd583c4260 error 4 in ifup[400000+d000]
Jan 19 11:28:14 pcdanisch kernel: [ 110.923263] ifquery[2987]: segfault at 1 ip 0000000000403187 sp 00007ffc9a42fcb0 error 4 in ifup[400000+d000]
Jan 19 11:28:15 pcdanisch kernel: [ 112.290839] ifquery[2990]: segfault at 1 ip 0000000000403187 sp 00007ffd42fb2960 error 4 in ifup[400000+d000]
Jan 19 11:28:17 pcdanisch kernel: [ 113.663268] ifquery[2993]: segfault at 1 ip 0000000000403187 sp 00007ffec52573c0 error 4 in ifup[400000+d000]
Jan 19 11:28:19 pcdanisch kernel: [ 116.039414] ifquery[2998]: segfault at 1 ip 0000000000403187 sp 00007ffc89c7a6a0 error 4 in ifup[400000+d000]
Jan 19 11:28:20 pcdanisch kernel: [ 117.410062] ifquery[3001]: segfault at 1 ip 0000000000403187 sp 00007ffc73a40f90 error 4 in ifup[400000+d000]
Jan 19 11:28:22 pcdanisch kernel: [ 118.778371] ifquery[3004]: segfault at 1 ip 0000000000403187 sp 00007fff27fa05e0 error 4 in ifup[400000+d000]
Jan 19 11:28:24 pcdanisch kernel: [ 121.154538] ifquery[3009]: segfault at 1 ip 0000000000403187 sp 00007fff61c73220 error 4 in ifup[400000+d000]
Jan 19 11:28:27 pcdanisch kernel: [ 123.527011] ifquery[3014]: segfault at 1 ip 0000000000403187 sp 00007ffcd6a8dc80 error 4 in ifup[400000+d000]
Jan 19 11:28:28 pcdanisch kernel: [ 124.892613] ifquery[3017]: segfault at 1 ip 0000000000403187 sp 00007fffba57fa20 error 4 in ifup[400000+d000]
Jan 19 11:28:28 pcdanisch sh[799]: message repeated 31 times: [ Segmentation fault (core dumped)]

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: ifupdown 0.7.54ubuntu1
ProcVersionSignature: Ubuntu 4.2.0-23.28-generic 4.2.6
Uname: Linux 4.2.0-23-generic x86_64
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
Date: Tue Jan 19 11:30:48 2016
InstallationDate: Installed on 2015-09-03 (137 days ago)
InstallationMedia: Xubuntu 15.10 "Wily Werewolf" - Alpha amd64 (20150825)
SourcePackage: ifupdown
UpgradeStatus: No upgrade log present (probably fresh install)

Hadmut Danisch (hadmut) wrote :
Hadmut Danisch (hadmut) wrote :

I've found two problems:

1.) See /lib/systemd/system/ifup-wait-all-auto.service the line

  for i in $(ifquery --list --exclude lo --allow auto); do INTERFACES="$INTERFACES$i "; done;

  There is a space missing in "$INTERFACES$i " it concatenates all device names into one

2.) This ifquery-call just crashes:

# ifquery --state vlan0
Segmentation fault (core dumped)

# ifquery --state lo
Segmentation fault (core dumped)

for some reason it does not crash with eth0

# ifquery --state eth0

So please fix ifquery.

Hadmut Danisch (hadmut) wrote :

Famous last words of strace -s 80 -f ifquery --state vlan0

arch_prctl(ARCH_SET_FS, 0x7fb790db1700) = 0
mprotect(0x7fb790bb2000, 16384, PROT_READ) = 0
mprotect(0x60c000, 4096, PROT_READ) = 0
mprotect(0x7fb790ddf000, 4096, PROT_READ) = 0
munmap(0x7fb790db3000, 171412) = 0
fcntl(0, F_GETFD) = 0
fcntl(1, F_GETFD) = 0
fcntl(2, F_GETFD) = 0
brk(0) = 0x10f3000
brk(0x1114000) = 0x1114000
open("/run/network/.ifstate.lock", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/run/network/ifstate", O_RDONLY) = -1 ENOENT (No such file or directory)
exit_group(1) = ?
+++ exited with 1 +++

Hadmut Danisch (hadmut) wrote :

More analysis:

ifstate crashes if /run/network/ifstate is not present.

Hadmut Danisch (hadmut) wrote :

typo: meant ifquery --state instead of ifstate

Need to do more checks, but seems to be fixed on Ubuntu 16.04, which comes with a newer version of ifupdown

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ifupdown (Ubuntu):
status: New → Confirmed
Changed in ifupdown (Ubuntu):
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers