Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 278790 - sys-devel/gcc-4.3.3 (g++) segfaults while building =media-libs/libmp4v2-1.9.1 with precompiled headers on hardened kernel
Summary: sys-devel/gcc-4.3.3 (g++) segfaults while building =media-libs/libmp4v2-1.9.1...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PR52194
  Show dependency tree
 
Reported: 2009-07-23 03:37 UTC by Simon Perry
Modified: 2012-02-12 14:52 UTC (History)
0 users

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


Attachments
build.log (build.log,8.35 KB, text/plain)
2009-07-23 03:40 UTC, Simon Perry
Details
environment (environment,44.37 KB, text/plain)
2009-07-23 03:41 UTC, Simon Perry
Details
emerge --info (emerge-info.txt,4.28 KB, text/plain)
2009-07-23 03:42 UTC, Simon Perry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Perry 2009-07-23 03:37:33 UTC
libmp4v2-1.9.1 segfaults during compilation. Unsure whether it's my environment or a known issue.

Reproducible: Always

Steps to Reproduce:
1. emerge libmp4v2


Actual Results:  
Compile gets to this file and fails, can even reproduce compiling by hand:

/bin/sh ./libtool --tag=CXX --mode=compile i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H   -I./include -I./include -I. -I.  -Wall -Wformat -march=core2 -fvisibility=hidden -c -o src/3gp.lo src/3gp.cpp
mkdir src/.libs
 i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I./include -I./include -I. -I. -Wall -Wformat -march=core2 -fvisibility=hidden -c src/3gp.cpp  -fPIC -DPIC -o src/.libs/3gp.o

i686-pc-linux-gnu-g++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See <http://bugs.gentoo.org/> for instructions.
make: *** [src/3gp.lo] Error 1
 * 
 * ERROR: media-libs/libmp4v2-1.9.1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 1087:  Called _eapi2_src_compile
 *               ebuild.sh, line  634:  Called die
 * The specific snippet of code:
 *   		emake || die "emake failed"
 *  The die message:
 *   emake failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/media-libs/libmp4v2-1.9.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/libmp4v2-1.9.1/temp/environment'.
 * 

>>> Failed to emerge media-libs/libmp4v2-1.9.1, Log file:

>>>  '/var/tmp/portage/media-libs/libmp4v2-1.9.1/temp/build.log'

 * Messages for package media-libs/libmp4v2-1.9.1:

 * 
 * ERROR: media-libs/libmp4v2-1.9.1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 1087:  Called _eapi2_src_compile
 *               ebuild.sh, line  634:  Called die
 * The specific snippet of code:
 *   		emake || die "emake failed"
 *  The die message:
 *   emake failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/media-libs/libmp4v2-1.9.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/libmp4v2-1.9.1/temp/environment'.
Comment 1 Simon Perry 2009-07-23 03:40:51 UTC
Created attachment 198869 [details]
build.log
Comment 2 Simon Perry 2009-07-23 03:41:17 UTC
Created attachment 198870 [details]
environment
Comment 3 Simon Perry 2009-07-23 03:42:10 UTC
Created attachment 198872 [details]
emerge --info
Comment 4 Gordon Malm (RETIRED) gentoo-dev 2009-07-23 15:49:30 UTC
Changing ownership to sound herd and CCing hardened.

Simon is using non-hardened profile + ~arch, the only 'hardened' thing is hardened-sources.  For instance, we still have glibc-2.10 masked, etc.  I'll try reproducing this on stable hardened later.
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2009-07-23 16:14:17 UTC
It's g++ that's segfaulting and I can't reproduce this. I'm also using -march=core2, the environment is not far from what I have.

So bouncing to toolchain@
Comment 6 Mark Loeser (RETIRED) gentoo-dev 2009-07-23 16:47:54 UTC
core2 is supposed to be used to enable the 64bit extensions on a core2 chip.  You have a CHOST of i686.  I have absolutely no idea what happens in this circumstance, but I think we might have a clue now.

Pick an march that doesn't imply 64bit extensions and see how it works out for you.
Comment 7 Gordon Malm (RETIRED) gentoo-dev 2009-07-23 19:16:50 UTC
Mark, march/mcpu args passed to gcc do not modify target arch and are independent of it. march=core2 should be ok.

It could be a number of things, including a hardware issue.  Re-opening for now, at least until I can also attempt to reproduce the issue.
Comment 8 Simon Perry 2009-07-24 00:40:12 UTC
Just for the hell of it, I recompiled gcc with no -march and just set -O2 in my CFLAGS. It compiles fine, libmp4v2 still fails with the g++ segfault.

Trying to improve my gdb skills (I'm pretty lousy at it) so I can provide some more info. Happy to try any debugging suggestions.
Comment 9 Simon Perry 2009-07-24 03:13:12 UTC
Using this instead of /usr/bin/g++:

[pezz@nexus]-[13:04:55]-[~/build/mp4v2-1.9.1]
$ /usr/i686-pc-linux-gnu/gcc-bin/4.3.3/i686-pc-linux-gnu-g++ -ggdb -DHAVE_CONFIG_H -I./include -I./include -I. -I. -Wall -Wformat -g -O2 -fvisibility=hidden -c src/3gp.cpp  -fPIC -DPIC -o src/.libs/3gp.o

And it compiles. Really seems like something with gcc is messed up on my end.
Comment 10 Gordon Malm (RETIRED) gentoo-dev 2009-07-24 03:34:45 UTC
(In reply to comment #9)
> Using this instead of /usr/bin/g++:
> 
> [pezz@nexus]-[13:04:55]-[~/build/mp4v2-1.9.1]
> $ /usr/i686-pc-linux-gnu/gcc-bin/4.3.3/i686-pc-linux-gnu-g++ -ggdb
> -DHAVE_CONFIG_H -I./include -I./include -I. -I. -Wall -Wformat -g -O2
> -fvisibility=hidden -c src/3gp.cpp  -fPIC -DPIC -o src/.libs/3gp.o
> 
> And it compiles. Really seems like something with gcc is messed up on my end.
> 

What about w/o -ggdb -g?

Comment 11 Simon Perry 2009-07-24 05:31:25 UTC
I'm not really sure what made it compile before, I am unable to reproduce the "good" compile now.

[pezz@nexus]-[15:28:51]-[~/build/mp4v2-1.9.1]
$ /usr/i686-pc-linux-gnu/gcc-bin/4.3.3/i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I./include -I./include -I. -I. -Wall -Wformat -g -O2 -fvisibility=hidden -c src/3gp.cpp  -fPIC -DPIC -o src/.libs/3gp.o

i686-pc-linux-gnu-g++: Internal error: Segmentation fault (program cc1plus)

Same if I remove -g etc.

I'm stumped.
Comment 12 Mark Loeser (RETIRED) gentoo-dev 2009-07-26 20:19:59 UTC
Gordon,

Thanks for the info.  I didn't realize that.

Simoon, still, I can't reproduce this, nor can anyone else.  You also said it worked once for you and then it didn't.  This certainly sounds like some sort of hardware issue on your side.
Comment 13 Simon Perry 2009-07-27 06:14:58 UTC
Happy to leave this closed, but if anyone has some advice on what may be wrong with my environment, I'd appreciate it.

I've found when building the package manually, adding:

--disable-gch

to ./configure makes it fully compile successfully every time, even with crazy optimised CFLAGS/CXXFLAGS.
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2009-08-14 11:43:15 UTC
(In reply to comment #13)
> --disable-gch

It's now passed by default in 1.9.1.
Comment 15 Samuli Suominen (RETIRED) gentoo-dev 2010-09-03 16:14:58 UTC
Reopen. 

This was actually never solved, only worked around in libmp4v2's ebuild by disabling the precompiled headers.

Quoting Zorry from Freenode: pch break the pax's aslr (randmmap)
Comment 16 Ryan Hill (RETIRED) gentoo-dev 2010-09-04 01:44:41 UTC
Actually, bug #301299 isn't a dependency.  It's the same issue though.

Not a toolchain bug - this is due to hardened-sources.