[pkg-boost-devel] Bug#367825: FTBFS with GCC 4.2: bjam segfaults

Martin Michlmayr tbm at cyrius.com
Thu May 18 12:08:39 UTC 2006


Package: boost
Version: 1.33.1-4

bjam segfaults (at least on sparc and powerpc) when I compile it with
a snapshot of GCC 4.2.  I'm not entirely sure whether this is a
compiler bug or one in your package, but from other cases like these
it is likely that your package is doing something wrong and that newer
optimizations exhibit the problem.

Maybe you or your upstream can investigate.  If everything fails, I
can talk to someone who knows GCC well.

I've done some preliminary investigation which shows where the error
is.  When you compile bjam with gcc 4.2 (from the gcc-snapshot)
package, you'll get a segfault.  When you drop the optimization for
rule.c to -O2, it works.  So the problem seems to be there.

FWIW, when I ran gdb on different binaries, I got two different
tracebacks.  However, pathunix.c seems to be okay since changing the
optimization on that doesn't change anything (afaict).

Program received signal SIGSEGV, Segmentation fault.
path_parse (file=0x0, f=0xffdcad70) at pathunix.c:65
65              if( file[0] == '<' && ( p = strchr( file, '>' ) ) )
(gdb) where
#0  path_parse (file=0x0, f=0xffdcad70) at pathunix.c:65
#1  0x10010164 in search (target=0x0, time=0x100a0fe8, another_target=0x0) at search.c:113
#2  0x10002690 in compile_include (parse=<value optimized out>, frame=0xffdcaf38) at compile.c:375
#3  0x1000b7f8 in parse_evaluate (p=0xffdcad70, frame=0x0) at parse.c:136
#4  0x100013e0 in compile_rules (parse=0x10046688, frame=0xffdcaf38) at compile.c:1199
#5  0x1000b7f8 in parse_evaluate (p=0xffdcad70, frame=0x0) at parse.c:136
#6  0x10002538 in compile_local (parse=0x10046748, frame=0xffdcaf38) at compile.c:505
#7  0x1000b7f8 in parse_evaluate (p=0xffdcad70, frame=0x0) at parse.c:136
#8  0x10002538 in compile_local (parse=0x10046778, frame=0xffdcaf38) at compile.c:505
#9  0x1000b7f8 in parse_evaluate (p=0xffdcad70, frame=0x0) at parse.c:136
#10 0x100014d8 in compile_if (p=0x1009fe30, frame=0xffdcaf38) at compile.c:313
#11 0x1000b7f8 in parse_evaluate (p=0xffdcad70, frame=0x0) at parse.c:136
#12 0x10001400 in compile_rules (parse=0x1009fe30, frame=0xffdcaf38) at compile.c:1202
#13 0x1000b9d8 in parse_file (f=<value optimized out>, frame=0x0) at parse.c:136
#14 0x1000697c in main (argc=1, argv=0xffdcbb94, arg_environ=<value optimized out>) at jam.c:446
(gdb)

This one seems more likely:

Program received signal SIGSEGV, Segmentation fault.
0x1000e554 in args_free (a=0x1000e41c) at rules.c:574
574         if (--a->reference_count <= 0)
(gdb) where
#0  0x1000e554 in args_free (a=0x1000e41c) at rules.c:574
#1  0x1000e5d4 in set_rule_body (rule=0x1003a130, args=0x0, procedure=0x0) at rules.c:610
#2  0x1000e658 in define_rule (src_module=0x100395e4, rulename=<value optimized out>,
    target_module=<value optimized out>) at rules.c:104
#3  0x1000e6b0 in import_rule (source=0x1003a108, m=0x1000e5d4, name=0x0) at rules.c:781
#4  0x10013f88 in load_builtins () at builtins.c:81
#5  0x10006734 in main (argc=1, argv=0xffa30b94, arg_environ=<value optimized out>) at jam.c:419
(gdb)



> Automatic build of boost_1.33.1-4 on bilbao by sbuild/sparc 85
...
...
> # cd libs/config && ./configure
> # mv libs/config/user.hpp boost/config
> # Build most of the stuff with jam
> cd tools/bcp && ../../tools/build/jam_src/bjam -d2 -sTOOLS=gcc -sGCC=gcc -sGXX=g++ -sHAVE_ICU=1 -sPYTHON_VERSION=2.4 -sPYTHON_ROOT=/usr -sBUILD="release <define>_REENTRANT <threading>single" bcp
> /bin/sh: line 1:  3186 Segmentation fault      ../../tools/build/jam_src/bjam -d2 -sTOOLS=gcc -sGCC=gcc -sGXX=g++ -sHAVE_ICU=1 -sPYTHON_VERSION=2.4 -sPYTHON_ROOT=/usr -sBUILD="release <define>_REENTRANT <threading>single" bcp
> make: *** [build-stamp] Error 139

(sid)2048:tbm at test: ..1.33.1/tools/build/jam_src] ./bin.linuxppc/bjam
zsh: segmentation fault  ./bin.linuxppc/bjam


(P. S.  I seem to recall investigating this before but I cannot find a
bug report.  Sorry in case this is a duplicate.)
-- 
Martin Michlmayr
http://www.cyrius.com/




More information about the pkg-boost-devel mailing list