Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 249222 - sys-fs/udev-133 segfaults on network interfaces renaming
Summary: sys-fs/udev-133 segfaults on network interfaces renaming
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Highest normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-29 03:32 UTC by Andrew Savchenko
Modified: 2008-12-17 08:28 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info output (emerge-hemera-info.log,2.49 KB, text/plain)
2008-12-01 14:05 UTC, Panagiotis Christopoulos (RETIRED)
Details
some syslog output (mesg.log,2.41 KB, text/plain)
2008-12-01 15:55 UTC, Panagiotis Christopoulos (RETIRED)
Details
fix netif rename (udev-fix-net-rename.patch,857 bytes, patch)
2008-12-01 18:07 UTC, Kay Sievers
Details | Diff
fix netif rename (udev-fix-net-rename.patch,823 bytes, patch)
2008-12-01 22:54 UTC, Kay Sievers
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Savchenko gentoo-dev 2008-11-29 03:32:27 UTC
I switched eth3 and eth0 in my 70-persistent-net.rules. After this udev segfaults on trying to reassing them at boot time, this puts one remote mashine to almost unusable state...

This is an essential part of system log:
Nov 29 04:39:12 [kernel] Freeing unused kernel memory: 324k freed
Nov 29 04:39:12 [kernel] udevd[1789]: segfault at 0 ip 000000000040b212 sp 00007fffefd6e8b8 error 4 in udevd[400000+18000]
Nov 29 04:39:12 [kernel] udev: renamed network interface eth3 to eth0
Nov 29 04:39:12 [kernel] Serial: 8250/16550 driver4 ports, IRQ sharing disabled

There is my 70-persistent-net.rules:

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:12:2e:1f:3d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x13f0:0x1023 (Sundance Technology IPG Triple-Speed Ethernet)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:71:21:cb:01", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:23:15:94:8e:f1", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x1186:0x4300 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:e6:93:c2:1e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

And finally my emerge --info:
Portage 2.2_rc16 (default/linux/amd64/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r0, 2.6.27-sheryl x86_64)
=================================================================
System uname: Linux-2.6.27-sheryl-x86_64-Intel-R-_Celeron-R-_CPU_2.53GHz-with-glibc2.2.5
Timestamp of tree: Wed, 26 Nov 2008 23:15:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p48
dev-lang/python:     2.5.2-r8
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.3.0-r1
sys-apps/sandbox:    1.2.18.1-r3
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -fomit-frame-pointer -pipe -fstack-protector -fdirectives-only"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=nocona -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -fomit-frame-pointer -pipe -fstack-protector -fdirectives-only"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv"
FFLAGS="-march=nocona -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -fomit-frame-pointer -pipe -fstack-protector"
GENTOO_MIRRORS="ftp://ftp.chg.ru/pub/Linux/gentoo http://mirror.yandex.ru//gentoo-distfiles  http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="ru_RU.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1"
LINGUAS="ru en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/science /usr/local/portage/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="aalib acl acpi adns amd64 apache2 bash-completion berkdb blas bluetooth bzip2 caps cdb cli clisp cracklib crypt cscope ctype cups curl curlwrappers cvs cxx cyrillic djvu doc eap-tls editor encode enscript examples exif expat fftw foomaticdb fortran ftp gdbm geoip gif ginac git gmp gnutls gpgme gpm gsl hardened hdf5 iconv idn imap iproute2 ipv6 isdnlog javascript jpeg jpeg2k keyscrub kpathsea lapack latex libcaca libwww lm_sensors logrotate lzo maildir mailwrapper mbox mhash midi mime mmap mmx mng mppe-mppc mudflap multilib mysql mysqli ncurses netcdf nls nntp nocd nptl nptlonly objc objc++ offensive openexr openmp otr pam pch pcntl pcre pdf perl png pop posix ppds pppd python raw readline recode reflection samba scanner session sharedmem slang slp smtp sockets socks5 sparse spell spl sse sse2 sse3 ssl subversion supernodal sysfs syslog szip tcpd threads tiff unicode usb vim-syntax wifi xattr xorg xpm yaz zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authz_host dir mime" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Matthias Schwarzott gentoo-dev 2008-11-29 16:14:03 UTC
I suggest you edit /etc/make.conf and add -g to CFLAGS and splitdebug to FEATURES.
After "emerge udev" you should be able to find out with addr2line or gdb where udev does crash.

Does the crash also occur if you run udevadm trigger in the running system?
Comment 2 Kay Sievers 2008-12-01 12:59:44 UTC
Maybe it's another problem somewhere with the deprecated sysfs layout, which we don't test anymore. What is CONFIG_SYSFS_DEPRECATED* in your kernel config?
Comment 3 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-12-01 14:05:30 UTC
Created attachment 173966 [details]
emerge --info output

This just happened to me too, after emerging udev-133 and rebooted my router. When I removed /etc/udev/rules.d/70-persistent-net.rules and rebooted, it worked flawlessly, and seems to work with its own generated file but when I edited the damn file again, to apply my interfaces naming changes, it failed again. I had, finally, to mask -133 and downgrade to -130-r1, which works well up to now. For comment #2 , 

Hemera temp # uname -a
Linux Hemera 2.6.27-gentoo-r4 #1 SMP Sun Nov 23 11:46:25 EET 2008 x86_64 AMD Athlon(tm) X2 Dual Core Processor BE-2350 AuthenticAMD GNU/Linux
Hemera temp # zcat /proc/config.gz | grep -i config_sysfs
# CONFIG_SYSFS_DEPRECATED_V2 is not set
CONFIG_SYSFS=y
Hemera temp #

Panagiotis
Comment 4 Kay Sievers 2008-12-01 15:01:16 UTC
(In reply to comment #3)
> This just happened to me too, after emerging udev-133 and rebooted my router.
> When I removed /etc/udev/rules.d/70-persistent-net.rules and rebooted, it
> worked flawlessly, and seems to work with its own generated file but when I
> edited the damn file again, to apply my interfaces naming changes, it failed
> again.

What does "failed" mean? What are the interface names, and what do you expect them to be?
Comment 5 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-12-01 15:55:40 UTC
Created attachment 173975 [details]
some syslog output

> 
> What does "failed" mean? What are the interface names, and what do you expect
> them to be?
> 

As I said before, same with comment #1 . 4 network interfaces, when the net-persistent.rules file is customized, I get in kmsg segfaults like: 

Dec  1 15:18:42 Hemera udevd[1364]: segfault at 0 ip 000000000040b388 sp 00007fff8eda5a48 error 4 in udevd[400000+18000]
Dec  1 15:18:42 Hemera udevd[1402]: segfault at 0 ip 000000000040b388 sp 00007fff8eda5a48 error 4 in udevd[400000+18000]

See the attachment, of the obvious openrc complaints. After downgrading to 130-r1 everything becomes fine again.
Comment 6 Kay Sievers 2008-12-01 17:04:00 UTC
(In reply to comment #5)
> As I said before, same with comment #1 . 4 network interfaces, when the
> net-persistent.rules file is customized.

What I mean is, do you see interface names with *_rename, when it goes wrong?
Comment 7 Andrew Savchenko gentoo-dev 2008-12-01 17:40:06 UTC
(In reply to comment #1)
> I suggest you edit /etc/make.conf and add -g to CFLAGS and splitdebug to
> FEATURES.
> After "emerge udev" you should be able to find out with addr2line or gdb where
> udev does crash.

1) udev crashes at boot time, before the init starts. How on the earth am I supposed to use gdb here?
2) I rolled back to the udev-130-r1. As this is remote system it is too risky to switch to the udev-133 again, because I may lost control at all. Currently >=sys-fs/udev-133 ebuilds are masked until the problem will be solved.
 
> Does the crash also occur if you run udevadm trigger in the running system?
 
No, it doesn't. (I checked this just after the bug was found.)

(In reply to comment #2)
> Maybe it's another problem somewhere with the deprecated sysfs layout, which we
> don't test anymore. What is CONFIG_SYSFS_DEPRECATED* in your kernel config?
> 

They're set on:
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y

Afaik, some utilities are still depend on them.
Well, I'll try to disable this feature on the next kernel upgrade.

(In reply to comment #6)
> (In reply to comment #5)
> > As I said before, same with comment #1 . 4 network interfaces, when the
> > net-persistent.rules file is customized.
> 
> What I mean is, do you see interface names with *_rename, when it goes wrong?
> 

In my case, when udev segfaulted on renaming eth0 to eth3, I saw eth0_rename itstead. If fact, I swap eth0 and eth3 in my rules (in comparision with 'default' layout). It was ok while renaming eth3 to eth0, but udev got segfault on renaming attempt for old eth0 interface to new eth3.
Comment 8 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-12-01 17:42:41 UTC
(In reply to comment #6)
> What I mean is, do you see interface names with *_rename, when it goes wrong?
> 

I cannot reproduce now, cause this is my home router, and I need it as-is, but if I remember correctly, there were two interfaces with _rename when I hit ifconfig -a, after the udevd segfaults. If the information you ask are *very* important for bugsolving, tell me to emerge udev-133 again, and double check.

Panagiotis
Comment 9 Kay Sievers 2008-12-01 18:07:45 UTC
Created attachment 173988 [details, diff]
fix netif rename

Can you possibly try the attached patch, and see if it fixes it? Thanks!
Comment 10 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-12-01 20:15:30 UTC
(In reply to comment #9)
> Can you possibly try the attached patch, and see if it fixes it? Thanks!
> 
I applied your patch, and now ti seems that /etc/udev/rules.d/70-persistent-net.rules gets ignored at all(see http://dev.gentoo.org/~pchrist/work/sys-fs/udev/133_patched_small.txt and the full info in http://dev.gentoo.org/~pchrist/work/sys-fs/udev/133_patched.txt). Also, the ifconfig output with udev of the original udev-133 ebuild --> http://dev.gentoo.org/~pchrist/work/sys-fs/udev/133_plain.txt. 

Comment 11 Kay Sievers 2008-12-01 22:54:20 UTC
Created attachment 174018 [details, diff]
fix netif rename

(In reply to comment #10)
> I applied your patch, and now ti seems that
> /etc/udev/rules.d/70-persistent-net.rules gets ignored at all

Thanks a lot for the test.

Here is an updated patch. If you are again able to give it a try, that would be great.

I hope the issue gets fixed with that, and we can do a new udev release with this fix.
Comment 12 Andrew Savchenko gentoo-dev 2008-12-02 00:18:32 UTC
(In reply to comment #11)
[...]
> Here is an updated patch. If you are again able to give it a try, that would be
> great.
> 
> I hope the issue gets fixed with that, and we can do a new udev release with
> this fix.

It works fine for me.
Comment 13 Kay Sievers 2008-12-02 00:21:43 UTC
(In reply to comment #12)
> > Here is an updated patch. If you are again able to give it a try, that would > > be great.
> It works fine for me.

Thanks a lot for your tests. I will do a udev 135 release now.
Comment 14 Matthias Schwarzott gentoo-dev 2008-12-03 14:51:08 UTC
This should be fixed with udev-135.ebuild
Comment 15 Andrew Savchenko gentoo-dev 2008-12-13 05:50:04 UTC
(In reply to comment #14)
> This should be fixed with udev-135.ebuild
> 

Well, is seems to work ok with udev-135 too.
Comment 16 Greg Dziegielewski 2008-12-13 09:36:06 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > This should be fixed with udev-135.ebuild
> > 
> 
> Well, is seems to work ok with udev-135 too.
> 

Hi everbody. I'm not sure that this is 100% related to this patch, but after updating to udev-133 or better (I've checked with -133 and -135-r1) NetworkManager do not see any network interfaces...

Comment 17 Kay Sievers 2008-12-13 10:01:44 UTC
(In reply to comment #16)
> Hi everbody. I'm not sure that this is 100% related to this patch, but after
> updating to udev-133 or better (I've checked with -133 and -135-r1)
> NetworkManager do not see any network interfaces...

NetworkManager usually fails only if no interfaces are available at all, it does not care about the the names, whatever they are, it will use them.

Do you see interfaces in:
  ls -l /sys/class/net/
?

If yes, does:
  lshal
contain sections about the devices?
Comment 18 Greg Dziegielewski 2008-12-13 11:17:37 UTC
(In reply to comment #17)
> NetworkManager usually fails only if no interfaces are available at all, it
> does not care about the the names, whatever they are, it will use them.
> 
> Do you see interfaces in:
>   ls -l /sys/class/net/
> ?
> 
> If yes, does:
>   lshal
> contain sections about the devices?

Yep they are in /sys/class/net/

but  lshal seems to not see them

(of course i rebuilded hal after updating udev).

Comment 19 Kay Sievers 2008-12-13 14:31:01 UTC
> (In reply to comment #17)
> Yep they are in /sys/class/net/
> 
> but  lshal seems to not see them

Let's find out if it's a udev event issue.
If you restart HAL, does it contain the network devices?
Comment 20 Greg Dziegielewski 2008-12-17 08:28:15 UTC
(In reply to comment #19)
> Let's find out if it's a udev event issue.
> If you restart HAL, does it contain the network devices?

Sorry for the late answer.

I'll try to do more research later today but it seems that hal compiled against udev-133 or later does not detect most of my laptop hardware...

And I'm almost sure that it's not related to this patch.
Should I make new bugreport? And eventually what stuff/logs You need?