#977 closed Bugs (fixed)
bjam crashes when compiled with gcc 4.2
Reported by: | Owned by: | René Rivera | |
---|---|---|---|
Milestone: | Component: | bjam | |
Version: | Boost.Jam 3.1.14 | Severity: | Showstopper |
Keywords: | Cc: |
Description
This is reported a year ago to Debian bugtracker it seems [1]. Bjam crashes when compiled with gcc 4.2.0 :
southpark boost_1_34_0 # ./tools/jam/src/bin.linuxx86/bjam zsh: segmentation fault ./tools/jam/src/bin.linuxx86/bjam
Debian bug report has a nice backtrace too.
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=367825
Attachments (1)
Change History (16)
comment:1 by , 15 years ago
Component: | Building Boost → bjam |
---|---|
Owner: | set to |
Status: | new → assigned |
Version: | → Boost.Jam 3.1.14 |
comment:2 by , 15 years ago
comment:3 by , 15 years ago
Building bjam with -fno-strict-aliasing fixes this problem for me (on FreeBSD 7/amd64, gcc 4.2.0).
I will attach a patch that is based on http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=22;filename=boost.diff;att=1;bug=367825
by , 15 years ago
Attachment: | patch-tools_jam_src_build.jam added |
---|
Build bjam with -fno-strict-aliasing (fixes build with gcc 4.2.0)
follow-up: 5 comment:4 by , 15 years ago
Thats just a workaround, not a real fix, recently David Turner fixed ftjam for this bug. His changes could be backported.
follow-up: 15 comment:5 by , 15 years ago
Replying to ismail@pardus.org.tr:
Thats just a workaround, not a real fix, recently David Turner fixed ftjam for this bug. His changes could be backported.
Do you have a reference for the changes that fix it? I'd really like to fix this in bjam but I've had no luck in finding out what's going wrong.
comment:6 by , 15 years ago
http://david.freetype.org/jam/ftjam-2.5.3rc2.tar.bz2 is the fixed version as far as I know. For spesific changes you would have to ask David.
follow-up: 8 comment:7 by , 15 years ago
One more data point:
g++42 (GCC) 4.2.1 20070627 (prerelease) does not exhibit this problem (tested on FreeBSD 6.2-STABLE/i386), while g++ (GCC) 4.2.0 20070514 [FreeBSD] (tested on FreeBSD 7.0/amd64) does.
Since the original reporter also spoke about g++ 4.2.0, the problem seems to related to the compiler version, and not to the CPU architecture. In the debian bug report mentioned above someone reports the problem is present on i386 (with g++ 4.2.0).
comment:8 by , 15 years ago
Replying to barner@FreeBSD.org:
One more data point:
g++42 (GCC) 4.2.1 20070627 (prerelease) does not exhibit this problem (tested on FreeBSD 6.2-STABLE/i386), while g++ (GCC) 4.2.0 20070514 [FreeBSD] (tested on FreeBSD 7.0/amd64) does.
Nice one! I tried with gcc version 4.2.1 20070627 (prerelease) (Pardus Linux), I can't produce the bug either. So looks like its fixed for gcc 4.2.1.
Regards, ismail
comment:9 by , 15 years ago
Hm, this bug seems to be quite odd to reproduce. It reproduces here with this gcc:
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.2.1 --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-shared --enable-cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --program-suffix=-4.2 --enable-version-specific-runtime-libs --without-system-libunwind --with-cpu=generic --host=x86_64-suse-linux Thread model: posix gcc version 4.2.1 20070705 (prerelease) (SUSE Linux)
Other architectures with equivalent gcc also fail: i386 ia64, ppc, ppc64, s390, s390x (no platform to which we have works)
Now the odd thing: It seems it worked with the same gcc version before, same sources, just in the previous rebuild of all openSUSE packages (I still try to verify this, as the boost-jam tarball has no testsuite, the segfault was not detected directly, only when trying to builld boost itself)
The main change in gcc42 before that was an update from suse-gcc-4_2-branch head (r126079) to suse-gcc-4_2-branch head (r126359)
glibc was changes to the lastest glibc-2.6 head, shortly before.
Anyway, we are applying the change regarding-fno-strict-aliasing in our builds.
If I'd have a vote, as that should not be a major performance isssue for jam, I'd just apply the workaround if you are not going to look for the real fix. Pity that you need yor own jam!
comment:11 by , 15 years ago
I can also attest that gcc 4.2.1 and boost 1.34.1 produce this problem on a Sparc running Solaris 2.8. Adding -fno-strict-aliasing allows for success.
comment:12 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Alternate version of the patch applied. Still wish I could find the real cause of the problem :-(
comment:13 by , 15 years ago
This issue is still occurring for me with gcc 4.2.3 and boost 1.34.1 in Ubuntu. Using -fno-strict-aliasing fixed the problem. I thought it worth mentioning since apparently no recent gcc changes have cured the underlying problem, alas.
comment:14 by , 14 years ago
KFF8g4 <a href="http://hbapdhjrevdb.com/">hbapdhjrevdb</a>, [url=http://dnntzgtyxuyh.com/]dnntzgtyxuyh[/url], [link=http://tvmirclgmorn.com/]tvmirclgmorn[/link], http://azvamvfvjsgw.com/
comment:15 by , 11 years ago
Replying to grafik:
Replying to ismail@pardus.org.tr:
Thats just a workaround, not a real fix, recently David Turner fixed ftjam for this bug. His changes could be backported.
Do you have a reference for the changes that fix it? I'd really like to fix this in bjam but I've had no luck in finding out what's going wrong.
I think the problem is casting to HASHDATA * *. I'll fix this properly soon.
Any news on this one?