javac segmentation fault?

161 views
Skip to first unread message

Cliff Rowley

unread,
Jan 27, 2009, 1:35:27 PM1/27/09
to android-platform
Hi guys,

I've tried as hard as I can to solve this without leaning on the
mailing list and I just can't figure out what is going on. For some
reason javac segfaults every time I try to build the android source,
regardless of what Java version I am using. I've tried rebuilding my
prebinding cache (several times), blatting my source tree and starting
over (several times), and using every Java version available on my
machine. I've checked and re-checked my steps, but alas, it dies at
the same spot, every single time, and I can't figure it out. I can
build other Java applications, and I can build applications using the
Android SDK just fine.

I'm using a MacBook Pro with 10.5.6 and the following Java
environments installed and available through Java Preferences:

J2SE 5.0 (32-bit)
J2SE 5.0 (32-bit)
Java SE 6 (64-bit)
J2SE 1.4.2 (32-bit)

The build process gets this far: http://pastebin.com/f1dab0871

And the crash log says this: http://pastebin.com/fc55817

If anyone could provide even the smallest insight that might help me
solve this I would be eternally grateful...

Cliff Rowley

Cliff Rowley

unread,
Jan 30, 2009, 6:06:28 PM1/30/09
to android-platform
Sorry to bump, just in case someone who might be able to help tunes
in. I'm at a complete road block :-(

Cliff Rowley

Gross, Mark

unread,
Jan 30, 2009, 6:10:12 PM1/30/09
to android-...@googlegroups.com
What does the command "free" say?

FWIW: I had some problems building on a 1 gig box that didn't have swap enabled. Problems that included a seg fault in javac, and other stuff.

After adding a gig of swap that system builds without issue. One person told me that he needed 1.5 gig of working set to build.

--mgross

Cliff Rowley

unread,
Feb 1, 2009, 12:48:50 AM2/1/09
to android-platform
Thanks for your reply Mark, starting to go a little insane here! I
have whatever swap OS X / Leopard sets up by default :-)

What gets me is that it fails so early in the build - literally 30
seconds in while running droiddoc. It's been a while since I did any
real Java development, or in fact any real development outside of Ruby
& ActionScript, so this whole process is part alien, part vaguely
familiar.

Not sure where to go next..

Cliff Rowley

unread,
Feb 1, 2009, 1:11:53 AM2/1/09
to android-platform
Solved!

Oddly (but almost predictably) the night I choose to give it up, a
solution presents itself.

The problem is actually something in the Leopard JDK's, where a
certain number of command line arguments crashes the x86_64 Java
binaries, and for some reason the 64bit binaries are always called
even when you set the 32bit JDK as default.. The workaround is a bit
drastic, but it works..

http://discussions.apple.com/thread.jspa?threadID=1694282

I had to do the same to /all/ my Java binaries to get this to work.
It does not seem to have had any effect on anything else on my system.
It may also be possible for me to use a JDK entirely separate from
Leopard's, but one thing at a time, I'm still rusty.

Chris Streeter

unread,
Feb 20, 2009, 12:44:08 AM2/20/09
to android-platform
So I tried the same solution Cliff tried, but I'm still getting the
same error. For those curious, I used the following script I wrote:

#!/bin/sh
BASE_DIR='/System/Library/Frameworks/JavaVM.framework/Versions/1.5/
Home/bin'
for e in `ls $BASE_DIR`; do
if [ -x "${BASE_DIR}/${e}" -a ! -d "${BASE_DIR}/${e}" ]; then
if [ ! -e "${BASE_DIR}/original/${e}.orig" ]; then
echo "cp -p ${BASE_DIR}/${e} ${BASE_DIR}/original/${e}.orig"
cp -p "${BASE_DIR}/${e}" "${BASE_DIR}/original/${e}.orig"
fi
lipo "${BASE_DIR}/${e}" -remove x86_64 -output "${BASE_DIR}/original/
${e}"
cat "${BASE_DIR}/original/${e}" > "${BASE_DIR}/${e}"
fi
done

The build that I'm doing is on a disk image formatted as a journaled
case-sensitive image. I'm on a MacBook running Mac OS 10.5.6 with 4G
of RAM and 13G free disk space, so I can't imagine a lack of swap has
anything to do with it. I did a straight repo check out last night.
The build output is below. Does anyone have any other solutions I
could try? It seems weird that no one else has seen this issue. Thanks
for your help in advance,

- Chris

Build Output:

build/core/product_config.mk:211: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=darwin
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
build/core/main.mk:180: implicitly installing apns-conf_sdk.xml
build/core/copy_headers.mk:15: warning: overriding commands for target
`out/target/product/generic/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for
target `out/target/product/generic/obj/include/libpv/
getactualaacconfig.h'
host Java: droiddoc (out/host/common/obj/JAVA_LIBRARIES/
droiddoc_intermediates/classes)
/bin/bash: line 1: 38187 Segmentation fault javac -J-Xmx512M -
target 1.5 -Xmaxerrs 9999999 -encoding ascii -g -classpath out/host/
darwin-x86/framework/clearsilver.jar -extdirs "" -d out/host/common/
obj/JAVA_LIBRARIES/droiddoc_intermediates/classes build/tools/droiddoc/
src/AnnotationInstanceInfo.java build/tools/droiddoc/src/
AnnotationValueInfo.java build/tools/droiddoc/src/AttributeInfo.java
build/tools/droiddoc/src/AttrTagInfo.java build/tools/droiddoc/src/
ClassInfo.java build/tools/droiddoc/src/DroidDoc.java build/tools/
droiddoc/src/ClearPage.java build/tools/droiddoc/src/Comment.java
build/tools/droiddoc/src/ContainerInfo.java build/tools/droiddoc/src/
Converter.java build/tools/droiddoc/src/DocFile.java build/tools/
droiddoc/src/DocInfo.java build/tools/droiddoc/src/Errors.java build/
tools/droiddoc/src/FieldInfo.java build/tools/droiddoc/src/
Hierarchy.java build/tools/droiddoc/src/InheritedTags.java build/tools/
droiddoc/src/KeywordEntry.java build/tools/droiddoc/src/
LinkReference.java build/tools/droiddoc/src/LiteralTagInfo.java build/
tools/droiddoc/src/MemberInfo.java build/tools/droiddoc/src/
MethodInfo.java build/tools/droiddoc/src/NavTree.java build/tools/
droiddoc/src/PackageInfo.java build/tools/droiddoc/src/
ParamTagInfo.java build/tools/droiddoc/src/ParameterInfo.java build/
tools/droiddoc/src/ParsedTagInfo.java build/tools/droiddoc/src/
Proofread.java build/tools/droiddoc/src/SampleCode.java build/tools/
droiddoc/src/SampleTagInfo.java build/tools/droiddoc/src/Scoped.java
build/tools/droiddoc/src/SeeTagInfo.java build/tools/droiddoc/src/
Sorter.java build/tools/droiddoc/src/SourcePositionInfo.java build/
tools/droiddoc/src/Stubs.java build/tools/droiddoc/src/TagInfo.java
build/tools/droiddoc/src/TextTagInfo.java build/tools/droiddoc/src/
ThrowsTagInfo.java build/tools/droiddoc/src/TodoFile.java build/tools/
droiddoc/src/TypeInfo.java
make: *** [out/host/common/obj/JAVA_LIBRARIES/droiddoc_intermediates/
javalib.jar] Error 41
> > > FWIW: I had some problems building on a 1 gig box that didn't have swap enabled.  Problems that included a segfaultinjavac, and other stuff.

Cliff Rowley

unread,
Apr 20, 2009, 9:12:54 AM4/20/09
to android-platform
Ok, I've just had the same problem again - but with another
(unrelated) project. Be sure to get the right set of binaries, which
appears on my machine to be "/System/Library/Frameworks/
JavaVM.framework/Versions/A/Commands/*".

I used your script, and that path, and everything is perfect.
Reply all
Reply to author
Forward
0 new messages