Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 212503 - sys-apps/coreutils - sleep segfaults after STOP and CONT on HPPA
Summary: sys-apps/coreutils - sleep segfaults after STOP and CONT on HPPA
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: HPPA Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: http://git.kernel.org/?p=linux/kernel...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-06 15:36 UTC by Jeroen Roovers (RETIRED)
Modified: 2008-04-21 18:04 UTC (History)
1 user (show)

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


Attachments
Patch the fixes the problem (212503.diff,465 bytes, patch)
2008-03-11 20:18 UTC, Guy Martin (RETIRED)
Details | Diff
fix signal trampoline cache flushing (signal-trampoline-cache-flush.patch,1.10 KB, patch)
2008-03-20 10:07 UTC, Guy Martin (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2008-03-06 15:36:44 UTC
jeroen@elmer ~ $ sleep 5
^Z
[1]+  Stopped                 sleep 5
jeroen@elmer ~ $ fg
sleep 5
Segmentation fault
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-03-06 15:44:45 UTC
elmer ~ # gdb `which sleep`
GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "hppa2.0-unknown-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run 5
Starting program: /usr/bin/sleep 5
[Thread debugging using libthread_db enabled]
^Z[New Thread 0x400013c0 (LWP 18828)]
[New Thread 0x40001c00 (LWP 18828)]

Program received signal SIGTSTP, Stopped (user).
[Switching to Thread 0x40001c00 (LWP 18828)]
0x40742d80 in nanosleep () from /lib/libc.so.6
(gdb) fg
Continuing.

Program received signal SIGTSTP, Stopped (user).
0x40742d80 in nanosleep () from /lib/libc.so.6
(gdb) fg
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0xfb6bf548 in ?? ()
(gdb) thread apply all bt full

Thread 2 (Thread 0x40001c00 (LWP 18828)):
#0  0xfb6bf548 in ?? ()
No symbol table info available.
#1  0x00012fb8 in ?? ()
No symbol table info available.
#2  0x40001850 in ?? ()
No symbol table info available.
#3  0x40001850 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x400013c0 (LWP 18828)):
#0  0xfb6bf548 in ?? ()
No symbol table info available.
#1  0x00012fb8 in ?? ()
No symbol table info available.
#2  0x40001850 in ?? ()
No symbol table info available.
#3  0x40001850 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
#0  0xfb6bf548 in ?? ()
(gdb)

Thu Mar  6 16:44:00 CET 2008
Portage 2.1.4.4 (default-linux/hppa/2007.0, gcc-4.1.2, glibc-2.7-r1, 2.6.24-gentoo-r2-JeR parisc)
=================================================================
System uname: 2.6.24-gentoo-r2-JeR parisc PA8700 (PCX-W2)
Timestamp of tree: Thu, 06 Mar 2008 05:16:01 +0000
distcc 2.18.3 hppa2.0-unknown-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p17-r1
dev-lang/python:     2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 2.0.0_rc6-r1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="hppa"
CBUILD="hppa2.0-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mschedule=8000 -march=2.0 -ggdb -Wall"
CHOST="hppa2.0-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/bind /var/spool/torque /var/www/localhost/htdocs/wordpress/wp-config.php"
CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -mschedule=8000 -march=2.0 -ggdb -Wall"
DISTDIR="/keeps/gentoo/distfiles"
FEATURES="autoaddcvs buildpkg cvs distlocks fixpackages notitles sandbox sfperms splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://mirror.muntinternet.net/pub/gentoo/ http://gentoo.tiscali.nl/"
LC_ALL="en_US.UTF-8"
LINGUAS="en nl he"
MAKEOPTS="-j4"
PKGDIR="/keeps/gentoo/packages/elmer"
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="/mnt/alt/portage-tmp"
PORTDIR="/keeps/gentoo/portage"
PORTDIR_OVERLAY="/keeps/gentoo/local"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="7zip X Xaw3d a52 aac aalib accessibility ads alsa amr amrnb amrwb ao aoss apache2 ares arts asf async asyncns audiofile audit automount avfs bash-completion berkdb bidi bittorrent bl bzip2 c++ cairo caps catalogs cblas cdb cddb cdparanoia cdr chardet cjk cli cpudetection cracklib crypt cups curl custom-cflags dbtool dbus device-mapper dga dia directfb djbfft domainkeys dts dv dvd dvdr dvdread dxr3 edl elf emacs enca encode esd examples exif expat fam fame fastbuild fastcgi fbcon ffmpeg filter flac fontconfig foomaticdb fortran ftp gadu gd gdbm geoip ggi gif gimp gimpprint glep glib glut gmp gnome gnutls gphoto2 gpm gs gsl gtk gtk2 gtkhtml hal hesiod hppa ical icecast iconv idea idn imagemagick imlib immqt-bc inquisitio ipv6 isdnlog jack javascript jingle jpeg jpeg2k kde kerberos lapack lcms ldap leim libcaca libnotify libsamplerate libwww live logrotate logwatch lua lzo mad matroska memcache mhash midi mikmod mmap mng modplug motif mozbranding mp3 mssql mudflap musepack mysql nas ncurses netpbm network-cron nfconntrack nfs nls nntp nptl nptlonly nsplugin offensive ogg openexr opengl openmp oss ots overlays pam pango pbs pch pcre pdf pdo-external perl php pic plotutils plugins png portage portaudio postgres povray ppds pppd pulseaudio python pyzord qdbm qt3 qt3support quotas raw readline recode reflection rpc rrdtool rtc ruby samba sasl scanner scim sdl seamonkey session sid slang slp sms sndfile snmp soundex speex spell spl sqlite ssl startup-notification suhosin svg swat sysfs talkfilters tcl tcpd tga theora threads thunar-vfs tidy tiff timidity tk tools truetype twolame udev unicode unzip urandom usb userlocales utempter utf v4l v4l2 vanim vcd vidix vim-syntax vorbis wavpack webdav webinstall winbind wlan wma wmf xanim xchattext xcomposite xface xml xml2 xmpi xorg xpm xrandr xscreensaver xsettings xulrunner xv xvid xvmc zip zip-external zlib" ALSA_CARDS="ad1889 usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en nl he" USERLAND="GNU" VIDEO_CARDS="stifb fbdev matrox"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2008-03-06 15:46:52 UTC
What it looks like in dmesg:

[306605.572000] do_page_fault() pid=18828 command='sleep' type=15 address=0x00000000
[306605.572000]
[306605.572000]      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
[306605.572000] PSW: 00000000000001000000000000001011 Not tainted
[306605.572000] r00-03  0004000b fb6bf528 00012fbb 407f2914
[306605.572000] r04-07  3b9ac9ff c4653600 3b9aca00 00000001
[306605.572000] r08-11  00000002 00000001 00013000 0000006d
[306605.572000] r12-15  00000073 00000064 00014000 00000000
[306605.572000] r16-19  00000000 000ae000 000cdd38 407f2914
[306605.572000] r20-23  000000a2 40742d58 40742d58 00000000
[306605.572000] r24-27  00000000 00000000 fb6bf488 00014edc
[306605.572000] r28-31  00000000 00000000 fb6bf540 fb6bf548
[306605.572000] sr00-03  00000001 00000028 00000000 00000001
[306605.572000] sr04-07  00000001 00000001 00000001 00000001
[306605.572000]
[306605.572000]       VZOUICununcqcqcqcqcqcrmunTDVZOUI
[306605.572000] FPSR: 00000100000000000000000000000000
[306605.572000] FPER1: 00000000
[306605.572000] fr00-03  0400000000000000 0000000000000000 0000000000000000 0000000000000000
[306605.572000] fr04-07  4014000000000000 4014000000000000 1062281010673810 0000000000000000
[306605.572000] fr08-11  fffff0008fd90000 0000000200000003 000000008f7858c0 ffffff9c00000002
[306605.572000] fr12-15  0000000010673810 4014000000000000 003f36c810673810 000000013b9aca00
[306605.572000] fr16-19  f0000884f000017c f00001748fc20208 8fc15c4000000020 8fc14bf000001000
[306605.572000] fr20-23  0000000000000000 8fc14bc010176f84 0000000000000000 0000000000000000
[306605.572000] fr24-27  0000000000000000 0000000500000000 412e848000000000 040a7c007919bf52
[306605.572000] fr28-31  1b3dcf9a46f95658 b560b52cf410b88e 1b3dcf9a55555555 21dd259f55555555
[306605.572000]
[306605.572000] IASQ: 00000001 00000001 IAOQ: fb6bf54b fb6bf54f
[306605.572000]  IIR: 40140000    ISR: 00000001  IOR: 00000000
[306605.572000]  CPU:        0   CR30: 12154000 CR31: 11111111
[306605.572000]  ORIG_R28: 00000000
[306605.572000]  IAOQ[0]: 0xfb6bf548
[306605.572000]  IAOQ[1]: 0xfb6bf54c
[306605.572000]  RP(r2): 0x12fb8
Comment 3 SpanKY gentoo-dev 2008-03-09 10:14:24 UTC
your gdb is obviously useless ... did you actually build it with debugging and such ?

most likely a bug in glibc/kernel i would guess
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2008-03-11 04:55:43 UTC
(In reply to comment #3)
> your gdb is obviously useless ... did you actually build it with debugging and
> such ?

Oops, must have forgot to turn off optimisation.

> most likely a bug in glibc/kernel i would guess

Yes.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2008-03-11 04:56:32 UTC
gmsoft tried with different kernels and found that 2.6.19 did not have the problem but 2.6.20 did.
Comment 6 Guy Martin (RETIRED) gentoo-dev 2008-03-11 08:24:48 UTC
Still working on this.

The patch causing this issue is most likely this one :
http://git.kernel.org/?p=linux/kernel/git/kyle/parisc-2.6.git;a=commitdiff;h=4650f0a5832033c78690811aa9b171764c11fc0f
Comment 7 Guy Martin (RETIRED) gentoo-dev 2008-03-11 19:39:22 UTC
After lots of testing, I've found out the guilty patch :

http://git.kernel.org/?p=linux/kernel/git/kyle/parisc-2.6.git;a=commitdiff;h=2b163b71e6d4471cae74037cb680e885eafc8d64
Comment 8 Guy Martin (RETIRED) gentoo-dev 2008-03-11 20:18:56 UTC
Created attachment 145859 [details, diff]
Patch the fixes the problem

The attached patch fix the problem.
Comment 9 Guy Martin (RETIRED) gentoo-dev 2008-03-12 11:15:45 UTC
Kernel team, please include attached patch in next gentoo-sources.
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2008-03-15 19:05:56 UTC
(In reply to comment #8)
> Created an attachment (id=145859) [edit]
> Patch the fixes the problem
> 
> The attached patch fix the problem.

I applied the patch to 2.6.24-r3 but it didn't fix the problem, sadly.
Comment 11 Daniel Drake (RETIRED) gentoo-dev 2008-03-18 10:40:15 UTC
(assuming it fixes a problem)

Where has the patch come from? Who created it? Has it been submitted upstream? It's not in Linus' tree, which is generally our requirement for including patches.
Comment 12 Guy Martin (RETIRED) gentoo-dev 2008-03-20 10:06:33 UTC
Patch was applied upstream. Attaching new patch.
Comment 13 Guy Martin (RETIRED) gentoo-dev 2008-03-20 10:07:17 UTC
Created attachment 146641 [details, diff]
fix signal trampoline cache flushing
Comment 14 Jeroen Roovers (RETIRED) gentoo-dev 2008-03-20 19:22:55 UTC
The new patch does fix the problem.
Comment 15 Mike Pagano gentoo-dev 2008-03-23 13:54:37 UTC
Keeping an eye on this patch to see when it to hits Linus' mainline development kernel tree.
Comment 16 Jimmy.Jazz 2008-03-30 17:43:49 UTC
Hi,

I have a similar problem as well with cp. cp segfaults during openoffice 2.4.0 emerge (during unpack).

I'm using sys-apps/coreutils-6.10-r1
glibc flags,  sys-libs/glibc-2.7-r2  USE="gd nls"
coreutils flags,  sys-apps/coreutils-6.10-r1  USE="acl nls xattr"

$ emerge --info
Portage 2.1.4.4 (default-linux/amd64/2007.0, gcc-4.2.3, glibc-2.7-r2, 2.6.25-rc7 x86_64)
=================================================================
System uname: 2.6.25-rc7 x86_64 AMD Athlon(tm) 64 Processor 3200+
Timestamp of tree: Sat, 29 Mar 2008 16:16:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.5.1-r5
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="-march=k8 -O3 -pipe"
...
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j2"
...
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 17 Jimmy.Jazz 2008-03-30 18:07:46 UTC
Not really helpful but shows its relation with glibc:

Unpacking writerfilter.2008-02-29.tar.bz2
Copying extra command images
Copying scsolver directory into the tree
./unpack: line 513: 18025 Segmentation fault      $GNUCP -Rf $TOOLSDIR/scratch/scsolver $OOBUILDDIR/
make: *** [/var/tmp/portage/app-office/openoffice-2.4.0/work/ooo/build/OOH680_m12/unpack] Error 1

cp[18025] general protection ip:2aca4c9f2c10 sp:7fff5e74fba8 error:0 in libc-2.7.so[2aca4c97c000+13e000]

Also, python scripts often fail with a segmentation fault if they are not used with a export MALLOC_CHECK=0. It could be an other glibc glitch too.

They are the only segmentation faults I get.
Comment 18 Jimmy.Jazz 2008-03-30 21:35:47 UTC
(In reply to comment #17)

Great, I found what was wrong, the flag xattr.

If coreutils ebuild is compiled with that flag cp will crash every time it is called from openoffice ebuild.

Indeed, without that flag everything works great. Now it would be interesting to know why that append and how it interferes with glibc. Obviously, python script's segmentation fault has nothing to do with that flag.



Comment 19 Jeroen Roovers (RETIRED) gentoo-dev 2008-03-30 22:13:20 UTC
(In reply to comment #18)
> (In reply to comment #17)
> 
> Great, I found what was wrong, the flag xattr.

Wonderful.

> If coreutils ebuild is compiled with that flag cp will crash every time it is
> called from openoffice ebuild.

How does that have anything to do with STOP and CONT resulting in a segmentation fault on HPPA systems?

> Indeed, without that flag everything works great. Now it would be interesting
> to know why that append and how it interferes with glibc. Obviously, python
> script's segmentation fault has nothing to do with that flag.

It's probably best to open a new bug report for this, if it is indeed a bug.
Comment 20 Jeroen Roovers (RETIRED) gentoo-dev 2008-04-21 18:04:45 UTC
The patch is in vanilla-sources-2.6.25 and therefore in gentoo-sources-2.6.25-r1 as well.