Bug 41961 - jikes 1.16 core dumps on FreeBSD (but not on RedHat Linux 7.3)
Summary: jikes 1.16 core dumps on FreeBSD (but not on RedHat Linux 7.3)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-24 00:20 UTC by Archie Cobbs
Modified: 2002-08-27 21:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Archie Cobbs freebsd_committer freebsd_triage 2002-08-24 00:20:01 UTC
Jikes core dumps when compiling a certain set of files.
However, on RedHat Linux 7.3, with the exact same source
files for jikes and compilation command line, jikes does
not core dump. Therefore, it appears to be a FreeBSD-specific
problem.

How-To-Repeat: To reproduce the bug:

0. Install the jikes-1.16_1 port (/usr/ports/java/jikes)
1. Download the file http://unc.dl.sourceforge.net/sablevm/sablevm-class-library-1.0.3.tar.gz
2. Unpack the tar file
3. cd sablevm-class-library-1.0.3/
4. find src -name '*.java' > files
5. mkdir classes
6. jikes -g -d classes -bootclasspath src -classpath src -sourcepath src `tail +855 files`

The compilation will fail with jike core dumping.

This does *not* happen on RedHat 7.3 with the exact same jikes
sources. It may have something to do with our pthread library,
because jikes links with it.

The 'tail' is just to not overflow the command line with too many arguments.
But also, if you change the 'tail' to '+856' it doesn't core dump. So the
file java/security/DomainCombiner.java may be related to the problem.
Comment 1 Archie Cobbs 2002-08-24 00:58:39 UTC
FYI,
This problem does *not* occur on FreeBSD 4.5-RELEASE.

-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com
Comment 2 Jay Sachs 2002-08-26 03:40:37 UTC
Freshly -supped ports tree, and -stable as of Aug 7.

Attempt 1: I build the port with no optimization and debugging
on, as follows:

   make CXXFLAGS='-g -pipe'

No core dump, just a (jikes) warning about use of '$' in an identifier.

So apparently the optimization in the 4.6-stable c++ compiler is
a bit flakey.

Attempt 2: Turn on optimization, building jikes as follows:
   make CXXFLAGS='-g -O -pipe'

Ok, got core dump. Ran gdb, and the stack was filled
with near-endless repetition of the frame pair

#177 0x82071d2 in Semantic::ProcessBinaryExpression (this=0x8d18000,
     expr=0x8d1e474) at expr.cpp:6640
#178 0x81f30c8 in Semantic::ProcessPLUS (this=0x8d18000, expr=0x8d1e4c0)
     at semantic.h:1398

883 frames in total. So it looks like the optimizer inserted an infinite
loop. It looks like the gcc 2.95.4 import of June 20 could be the
culprit. The RELENG_4_6 branches (4.6-RELEASE, 4.6.1, 4.6.2 etc)
do NOT have 2.95.4 imported, so if someone could test one of those
systems we could pretty much nail down that it's a 2.95.4 optimizer bug.

jay
Comment 3 Jay Sachs 2002-08-26 15:26:44 UTC
One other datapoint: RedHat 7.3 comes with gcc 2.96
Comment 4 Jasper Jongmans 2002-08-26 16:48:21 UTC
% uname -a
FreeBSD harry.aprogas.net 4.6.1-RELEASE-p10 FreeBSD 4.6.1-RELEASE-p10
#19: Sun Aug 11 20:10:50 CEST 2002
root@harry.aprogas.net:/usr/obj/usr/src/sys/HARRY  i386

% g++ -v
Using builtin specs.
gcc version 2.95.3 20010315 (release) [FreeBSD]

When compiled with CXXFLAGS='-g -O -pipe -march=pentiumpro':

% jikes -g -d classes -bootclasspath src -sourcepath src `cat files`
zsh: bus error (core dumped)  jikes -g -d classes -bootclasspath src
-sourcepath src `cat files`

When compiled with CXXFLAGS='-g -pipe -march=pentiumpro' I get the same
lexical warning as Jay Sachs already mentioned, but for the rest it
compiles fine.

Note: The same problem also occurs with at least one other Java
application (Freenet, http://www.freenetproject.org/).

-- 
Jasper Jongmans                                   j.jongmans@aprogas.net
Website                      http://aprogas.student.utwente.nl/~aprogas/
PGP key                ftp://aprogas.student.utwente.nl/keys/pgp-dsa-elg
PGP fingerprint       6E36 58CF 2CD7 86BC 7F6C  6128 E2AA FA44 CD25 1FFD
Comment 5 Archie Cobbs 2002-08-26 19:35:57 UTC
Jasper Jongmans writes:
> gcc version 2.95.3 20010315 (release) [FreeBSD]
> 
> When compiled with CXXFLAGS='-g -O -pipe -march=pentiumpro':
> 
> % jikes -g -d classes -bootclasspath src -sourcepath src `cat files`
> zsh: bus error (core dumped)  jikes -g -d classes -bootclasspath src
> -sourcepath src `cat files`

Ah- so this must not be just a GCC 2.95.4 bug, since you got a core dump
while running a version of jikes compiled with GCC 2.95.3...

Hmm....

Thanks,
-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com
Comment 6 Archie Cobbs freebsd_committer freebsd_triage 2002-08-27 21:43:00 UTC
State Changed
From-To: open->closed

This problem has been reported to the jikes developers. 
Also, the jikes port has been split into two: 'jikes' and 'jikes-devel'.