Package: ftjam
Version: 2.5.2-1
jam0 segfaults (at least on 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 try to find someone who knows C/GCC well.
I've done some preliminary investigation which shows where the error
is. When you compile jam0 with gcc 4.2 (from the gcc-snapshot)
package, you'll get a segfault. When you drop the optimization for
rule.c to -O1, it works. So the problem seems to be there.
FWIW, when I ran gdb on different binaries, I got two different
tracebacks.
This seems to be related to #367825 where bjam segfaults.
> Automatic build of ftjam_2.5.2-1 on test.track.rz.uni-augsburg.de by
> sbuild/powerpc 0.44
...
> make[1]: Entering directory `/build/tbm/ftjam-2.5.2'
> gcc -o jam0 -g -O2 builtins.c command.c compile.c execnt.c execunix.c
> execvms.c expand.c filent.c fileos2.c fileunix.c filevms.c glob.c hash.c
> hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c
> newstr.c option.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c
> search.c timestamp.c variable.c
> execunix.c: In function 'execcmd':
> execunix.c:235: warning: incompatible implicit declaration of built-in
> function '_exit'
> chmod a+w jambase.c
> ./jam0
> make[1]: *** [all] Segmentation fault
> make[1]: Leaving directory `/build/tbm/ftjam-2.5.2'
> make: *** [build-stamp] Error 2
[EMAIL PROTECTED]:/build/tbm/ftjam-2.5.2$ gcc -o jam0 -g -O2 builtins.c
command.c compile.c execnt.c execunix.c execvms.c expand.c filent.c fileos2.c
fileunix.c filevms.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c
jamgram.c lists.c make.c make1.c newstr.c option.c parse.c pathunix.c pathvms.c
regexp.c rules.c scan.c search.c timestamp.c variable.c
execunix.c: In function 'execcmd':
execunix.c:235: warning: incompatible implicit declaration of built-in function
'_exit'
[EMAIL PROTECTED]:/build/tbm/ftjam-2.5.2$ ./jam0
Segmentation fault
[EMAIL PROTECTED]:/build/tbm/ftjam-2.5.2$ gcc -c -O1 -o rules.o rules.c
[EMAIL PROTECTED]:/build/tbm/ftjam-2.5.2$ gcc -o jam0 -g -O2 builtins.c
command.c compile.c execnt.c execunix.c execvms.c expand.c filent.c fileos2.c
fileunix.c filevms.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c
jamgram.c lists.c make.c make1.c newstr.c option.c parse.c pathunix.c pathvms.c
regexp.c scan.c search.c timestamp.c variable.c rules.o
execunix.c: In function 'execcmd':
execunix.c:235: warning: incompatible implicit declaration of built-in function
'_exit'
[EMAIL PROTECTED]:/build/tbm/ftjam-2.5.2$ ./jam0
...found 143 target(s)...
...using 1 temp target(s)...
Program received signal SIGSEGV, Segmentation fault.
hashitem (hp=0x1002d058, data=0xffbf795c, enter=1) at hash.c:108
108 keyval = *b;
(gdb) where
#0 hashitem (hp=0x1002d058, data=0xffbf795c, enter=1) at hash.c:108
#1 0x10008244 in newstr (string=0x93c10008 <Address 0x93c10008 out of bounds>)
at newstr.c:52
#2 0x1000a394 in addsettings (head=0x0, setflag=-1816068088,
symbol=0x93c10008 <Address 0x93c10008 out of bounds>, value=0x1002a318) at
rules.c:253
#3 0x10002478 in evaluate_rule (rulename=<value optimized out>,
args=0xffbf79e8, result=0x0)
at compile.c:586
#4 0x100027ac in compile_rule (parse=<value optimized out>, args=0xffbf7a5c,
jmp=<value optimized out>) at compile.c:518
#5 0x1000198c in compile_rules (parse=0x1009e140, args=0xffbf7a5c,
jmp=0xffbf7a58) at compile.c:630
#6 0x10008788 in parse_file (f=<value optimized out>) at parse.c:59
#7 0x10005740 in main (argc=<value optimized out>, argv=<value optimized out>,
arg_environ=<value optimized out>) at jam.c:336
(gdb)
Program received signal SIGSEGV, Segmentation fault.
0x0ff0a110 in strcmp () from /lib/tls/libc.so.6
(gdb) where
#0 0x0ff0a110 in strcmp () from /lib/tls/libc.so.6
#1 0x10005ab8 in hashitem (hp=0x10083d88, data=0xffa1d958, enter=1) at
hash.c:116
#2 0x10010ab8 in bindtarget ()
#3 0x10001290 in builtin_depends (parse=0x10034170, args=0xffa1da48,
jmp=0xffa1da04)
at builtins.c:144
#4 0x10002b98 in evaluate_rule (rulename=0x10032e68 "Depends",
args=0xffa1da48, result=0x0)
at compile.c:596
#5 0x100028d4 in compile_rule (parse=0x1005a2e8, args=0xffa1dad0,
jmp=0xffa1dacc) at compile.c:518
#6 0x10002c6c in compile_rules (parse=0x100a3118, args=0xffa1dad0,
jmp=0xffa1dacc) at compile.c:630
#7 0x1000bdd8 in parse_file (f=0x100118e4 "+") at parse.c:59
#8 0x10007220 in main (argc=0, argv=0xffa1eb58, arg_environ=0xffa1eb5c) at
jam.c:336
(gdb)
--
Martin Michlmayr
http://www.cyrius.com/
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]