Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 474954 - udev & logrotate crashes with trap invalid opcode after "emerge --update"
Summary: udev & logrotate crashes with trap invalid opcode after "emerge --update"
Status: RESOLVED DUPLICATE of bug 384149
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-27 09:11 UTC by Dan Johansson
Modified: 2013-06-28 16:10 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Johansson 2013-06-27 09:11:43 UTC
After updating one of my systems (udev 200-204 was one of the updates) I noticed that after doing a /etc/init.d/udev restart the udev went into "crashed" state.
Looking at dmesg I see the following (yes, I have downgraded to 200 again):
systemd-udevd[32559]: starting version 200
traps: udevd[32559] trap invalid opcode ip:7f78a0d95a57 sp:7fff6ff1dce0 error:0 in udevd[7f78a0d89000+2f000]

I can also see an entry for logwatch in dmesg:
traps: logrotate[5759] trap invalid opcode ip:7f43adf28e3b sp:7fff20f0e990 error:0 in logrotate[7f43adf25000+f000]

That more that udev is affected brings me to belive that the problem is not with udev or logwatch but some other system component - the question is only which and why.


Reproducible: Always




Portage 2.1.12.2 (hardened/linux/amd64/no-multilib, gcc-4.6.3, glibc-2.15-r3, 3.9.5-hardened x86_64)
=================================================================
System uname: Linux-3.9.5-hardened-x86_64-QEMU_Virtual_CPU_version_0.12-with-gentoo-2.2
KiB Mem:     2058580 total,     71480 free
KiB Swap:     506040 total,    506040 free
Timestamp of tree: Thu, 27 Jun 2013 02:45:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6, 1.12.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://192.168.4.1/gentoo-portage"
USE="3dnow acl amd64 apache2 bash-completion bzip2 cli corefonts cracklib crypt cxx dri encode gd gmp hardened iconv icu jpeg jpeg2k justify metric minimal mmx modules mp3 mudflap ncurses network-cron nls nptl openmp pax_kernel pcre python raw readline session sse sse2 ssl tcpd theora threads tiff truetype unicode urandom userlocales vhosts vim-syntax zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en sv en_GB en_US sv_SE" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Patrick Lauer gentoo-dev 2013-06-27 09:17:27 UTC
This looks like you're running within QEMU / KVM, and using -march=native in CFLAGS.

Most likely there's some CPU misdetection happening, you should use more conservative CFLAGS for that setup
Comment 2 Dan Johansson 2013-06-27 09:31:30 UTC
Thanks for your support.

That is correct, this is a system that is running under QEMU/KVM on an AMD Opteron "host"-system.

Until now I have had no problems running with "CFLAGS="-march=native -O2 -pipe""
Do you have a suggestion on what CFLAGS to use instead for a setup like mine?

And can I just change the CFLAGS and do an "emerge --emptytree"?

-- 
Dan
Comment 3 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-06-27 10:36:50 UTC
I think dropping -march=native would be a good start, then try to rebuild udev and its dependencies; since the trap is in the udev daemon, it should be in that package or one of its dependencies.

From there on you can optionally try to identify which package is failing and also try to identify which specific flag that -march=native picks that produced the invalid opcode. Alternatively, you may be able to find this problem to be documented on the internet to spare out the work needed to figure this out.
Comment 4 Dan Johansson 2013-06-27 10:39:43 UTC
Thanks for your feedback, will try to rebuild udev and it's dependencies.

-- 
Dan
Comment 5 Dan Johansson 2013-06-27 11:07:32 UTC
The problem seems to be with udev itself.
Compiling udev with CFLAGS="-march=native -O2 -pipe" causes udev to crash with "traps: udevd[7785] trap invalid opcode ip:7f7760fb0b37 sp:7fff81250cd0 error:0 in udevd[7f7760fa4000+30000]".
Compile it with CFLAGS="-O2 -pipe" and it starts just fine.

Any suggestion on how to find out the offending flag?

-- 
Dan
Comment 6 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-06-27 11:21:38 UTC
(In reply to Dan Johansson from comment #5)
> Any suggestion on how to find out the offending flag?

`gcc -march=native -E -v - </dev/null 2>&1 | grep cc1` will show you what flags are used, you could try half of the flags to see if you can find the flag; alternatively, you could also try to use -march=native and attempt to negate some flags. Divide and conquer, trial and error; good luck! :)
Comment 7 Dan Johansson 2013-06-27 11:46:55 UTC
After some research I found this: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56068

I think that is the issue that I am having as well (QEMU/KVM is not returning the correct cpu-id).

-- 
Dan
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2013-06-28 16:10:18 UTC

*** This bug has been marked as a duplicate of bug 384149 ***