LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 01-14-2003, 01:12 PM   #1
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Rep: Reputation: 45
Question Compiling Java Assertion error


This is more of a BLFS and hints problem, but here goes.

When trying to compile Java from scratch following the BLFS, I get this error during the make phase, about 3 hours into the build.

Code:
#
# HotSpot Virtual Machine Error, assertion failure
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.0-blfscompiled-1042552071-debug mixed mode)
#
# assert(!(((ThreadShadow*)__the_thread__)->has_pending_exception()), "shouldn't be allocating with pending exception")
#
# Error ID: /usr/src/source/hotspot/src/share/vm/memory/collectedHeap.inline.hpp, 174
#
# Problematic Thread: prio=1 tid=0x0x8062278 nid=0x5b3d runnable 
#
Current thread is 0x400
Dumping core ...
make[4]: *** [/usr/src/source/control/build/linux-i386/tmp/sun/java.net/net/obj_g/.class.headers.i386] Aborted
make[4]: Leaving directory `/usr/src/source/j2se/make/java/net'
make[3]: *** [debug] Error 2
make[3]: Leaving directory `/usr/src/source/j2se/make/java/net'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/usr/src/source/j2se/make/java'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/usr/src/source/j2se/make'
make: *** [j2se-build] Error 2
Nasty heh?

Anyway, a search of the blfs-support mailing-list archives has brought up this error before, although nothing has come about from it and as far as I know they are still looking into it. So does anyone have any suggestions of fixing it? My only other option could be to follow the hint, as that appears to be have been extensively tested, and the BLFS book is still cvs.

Thanks
 
Old 01-15-2003, 03:41 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
I had similar problems when I followed the blfs book. Although it was an assertion in a different location. I decided to follow the hint from tushar instead and managed to compile java successfully. But still not able to use the plugin in mozilla yet. It gets to where it completely loaded the java applet but once it tries to run it then it crashes.
The hint just recently changed to 1.4.1 so I'm working on compiling that now and I just recompiled mozilla-1.0.2 to see if that makes any difference. I'm trying all of them without optimizations first. If I get it working properly then I'll try optimizations later.

Something you might want to do if you aren't already is to make a script which unpacks a clean source tree applies the patches and runs all the commands for a build. Makes it easier to reproduce the same build with only a slight adjustment. Java tends to be very picky if you have something set slightly wrong.
 
Old 01-15-2003, 06:27 AM   #3
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Original Poster
Rep: Reputation: 45
Cheers - I'm just about to start the hint compile, with 1.4.1, will let you know how it goes.

BTW, I started to do the hint yesterday, something wasn't right so I stoped the compilation and ran:

make clobber

which ended up deleting all the source, is this right??? I don't think that should of happened?Although it may have been something else.

Just giving a heads up if you run that.
 
Old 01-15-2003, 10:26 AM   #4
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Original Poster
Rep: Reputation: 45
Mik - can you help with the java hint? It says to donwload the patches from the primary site of the hint, ftp://ftp.linuxfromscratch.org yeah? Which patches does it mean as I can't find anything? There is the j2sdk-gcc31.patch for the BLFS book on compiling java, but I'm not sure whether to use that or not?
 
Old 01-15-2003, 11:06 AM   #5
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
The primary location of the hint is at http://linuxfromscratch.org/~tushar/hints
There is a link to the patches there also, you don't necessarily need all of them but my 1.4.1 build I did last night failed. It was trying to link against a local copy of motif although I want it to be using lesstif. Still gotta figure that out.

And the make clobber is supposed to start you out with a clean source tree not delete the sources. So it must have been a slight error. I include unpacking the sources in my build script so I never use make clobber.
 
Old 01-16-2003, 11:02 AM   #6
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
Just in case you run into the same problem. The modified hint seems to be missing the part where it notifies you to set ALT_MOTIF_DIR. If it's not set then the copy of motif which is included with java doesn't get built. The hint does say it needs to link against the included version otherwise it will crash.
Well this is the line I added in my build script:

ALT_MOTIF_DIR=$SRC
 
Old 01-16-2003, 12:51 PM   #7
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Original Poster
Rep: Reputation: 45
Mik do you want to post a copy of your script up - I'm having trouble getting the hint to work with errors in different places and loads of things I keep forgetting. I'm not too brilliant with bash to start from scratch.
 
Old 01-17-2003, 03:25 AM   #8
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
Well I still haven't successfully manage to compile a 1.4.1 when I don't set the ALT_MOTIF_DIR it doesn't compile motif and if I set it like it explains in the SUN build guide. It should be $SRC/motif then it fails finding header files and also gives an error when trying to rm the Xm directory which seems kinda weird to want to do that. Well I don't have a lot of time to work on this, I still have a successfull compile of 1.4.0 but it crashes when I use the plugin in mozilla.

Anyways here is the script I use:
Code:
# used the following patches
#
#j2sdk-1.4.1-fix-intl-files.patch.bz2
#j2sdk-1.4.1-link-missing-libs.patch.bz2
#j2sdk-1.4.1-remove-fixed-paths.patch.bz2
#j2sdk-1.4.1-syntax-fixes.patch.bz2
#j2sdk-1.4.1-use-included-motif.patch.bz2

# first install java binary version in binary directory
export JAVA_HOME=$PWD/binary/j2sdk1.4.0_03 &&
mkdir -p src &&
cd src &&
for i in ../j2sdk-1_4_1-*.zip ; do unzip $i; done &&
for i in ../*patch.bz2 ; do bzcat $i | patch -Np1 ; done &&
export SRC=$PWD
export ALT_BOOTDIR="$JAVA_HOME"
export ALT_MOZILLA_PATH=$SRC
export ALT_DEVTOOLS_PATH="/usr/bin"
export ALT_MOTIF_DIR=$SRC/motif
export MILESTONE="lfscompiled"
export BUILD_NUMBER=`date +%s`
export ALT_CACERTS_FILE=${ALT_BOOTDIR}/jre/lib/security/cacerts
export DEV_ONLY=true
#export OTHER_LDFLAGS="-lpthread"
unset JAVA_HOME
unset CLASSPATH
#export OTHER_CFLAGS=$CFLAGS
#export OTHER_CXXFLAGS=$CXXFLAGS
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
export INSANE=true
for i in hotspot/build/linux/makefiles/gcc.make \
        hotspot/build/solaris/makefiles/gcc.make \
        j2se/make/sun/image/generic/Makefile
do
    chmod +w $i
    cp $i $i.orig
    sed -e "s:\-O3:\-march=i686 \-fomit\-frame\-pointer \-s:g" \
        $i.orig > $i
done
ZLIB_VERSION=1.1.4 &&
cd $SRC/j2se/src/share/native/java/util/zip &&
rm -rf $SRC/zlib-1.1.3 &&
tar -xvjf $SRC/../zlib-${ZLIB_VERSION}.tar.* &&
cd zlib-${ZLIB_VERSION} &&
mv adler32.c zadler32.c &&
mv crc32.c zcrc32.c &&
cd $SRC/j2se/make/java/zip/ &&
cp Makefile Makefile.orig &&
chmod +w Makefile &&
sed -e "s:1.1.3:${ZLIB_VERSION}:" Makefile.orig > Makefile &&
cd $SRC/control/make &&
make &&
cd $SRC/control/build/linux-i386 &&
mkdir -p /opt/java &&
cp -a j2sdk-image /opt/java/j2sdk-1.4.1 &&
cd /opt/java &&
ln -nsf j2sdk-1.4.1 j2sdk
I have a build directory which contains the following files:
binary
buildit
j2sdk-1.4.1-fix-intl-files.patch.bz2
j2sdk-1.4.1-link-missing-libs.patch.bz2
j2sdk-1.4.1-remove-fixed-paths.patch.bz2
j2sdk-1.4.1-syntax-fixes.patch.bz2
j2sdk-1.4.1-use-included-motif.patch.bz2
j2sdk-1_4_1-mozilla_headers-unix.zip
j2sdk-1_4_1-src-scsl.zip
zlib-1.1.4.tar.bz2

The binary is a link to where I placed the binary version of java. Hope you manage to have better luck.
 
Old 01-17-2003, 09:30 AM   #9
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Original Poster
Rep: Reputation: 45
Thanks - I think I will use your script to see how far I can get - which has to be further than I am at the moment!

I've got about a week to play with this so if I do get anywhere I'll let you know.
 
Old 01-18-2003, 07:04 AM   #10
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
Well I finally managed to get it compiled. I had to set a few links to /usr/X11R6. The BLFS book tells you all about that but I didn't follow the book. Well after that I still ran into some troubles when it tried to remove the Xm directory. So I modified the motif patch so it would also stop trying to remove that directory. I've only tried one site with Java so far but it seems to work nicely now. Just got to figure out how to get it working for a normal user now. It only loads it as root. Probably some stupid permissions problem.
Hope you manage to get the same results.

Last edited by Mik; 01-18-2003 at 07:06 AM.
 
Old 01-20-2003, 05:35 PM   #11
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Original Poster
Rep: Reputation: 45
I think I have run into the same problem as you. Here is what I get:
Code:
cd  /usr/src/java-source/motif/lib; \
rm -f libXm-j2sdk.a ; \
ln -s /usr/src/java-source/motif/lib/libXm.a libXm-j2sdk.a
cd  /usr/src/java-source/motif/include; \
rm -f Xm ; \
ln -s /usr/src/java-source/motif/lib/Xm/exports/include/Xm .
rm: `Xm' is a directory
ln: `./Xm': cannot overwrite directory
make: *** [motif-install-include] Error 1
/home/cmarch/code/java/java-compile-script/compile-java: dk: command not found
What did you do to get round it? Is your plugin working okay now? So near to getting something compiled!
 
Old 01-21-2003, 05:11 AM   #12
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
Yeah I got exactly the same error. I solved it by modifying the file control/make/motif-rules.gmk and removing the lines where it tries to remove the directory and create the link. I modified the original motif patch to include removing those two lines. You can get the patch I made here:

http://mik.wikaba.com/j2sdk-1.4.1-us...ated.patch.bz2

If you use that patch then don't use the j2sdk-1.4.1-use-included-motif.patch.bz2 anymore.

Yes the plugin does work good now. I just removed the users ~/.mozilla directory and then it worked for the normal user again. That also removes all the settings and probably wasn't really necessary but I didn't feel like figure it out further since it just worked.
 
Old 01-21-2003, 05:23 AM   #13
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
I see you've also posted a message on the mailing list. And tushar suggested to unset the ALT_MOTIF_DIR variable. I've tried unsetting that before and then it didn't even try to compile motif, which ended up in it complaining that it couldn't find the motif library to link with. So I had to set it for it to force the compilation of motif. But maybe that was because I had some other things set wrong before. I haven't tried it after adding the links to /usr/X11R6.
 
Old 01-21-2003, 02:24 PM   #14
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Original Poster
Rep: Reputation: 45
Success!

Have managed to get it done - thanks alot for the help. I have updated your script with global variables so if anyone would like to have a template for compiling Java 1.4.1 from scratch they can follow it. Thanka again Mik.

BTW - I unset the ALT_MOTIF_DIR variable and it worked, so I'm not sure why it didn't for you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
assertion failed TIFFDC101 General 3 09-19-2005 09:41 PM
Get Assertion Error when installing FC3 st95accord Fedora - Installation 1 04-02-2005 01:22 AM
IRQ assertion ssampurna Linux - Hardware 0 03-14-2005 06:36 AM
K3b Quit Working--Assertion Failed Error mooreted Linux - Software 3 04-17-2004 01:54 PM
Help compiling java gonus Linux - Software 4 08-05-2002 01:37 AM


All times are GMT -5. The time now is 10:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration