buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Spiewak <djspie...@gmail.com>
Subject Re: segfaults with java 6
Date Mon, 03 Aug 2009 16:36:08 GMT
> Also the troubleshooting guide should describe what can be done if rjb
> once is messed up: one should remove and reinstall rjb with the correct
> JAVA_HOME env variable set.
> (An interesting observation: even if the troubleshooting guide explains
> what's the reason for segfaults both a colleage and I didn't get it
> really (or just didn't read it carefully enough) and didn't get what has
> to be done to fix the segfault.)


The segfault is essentially the processor's colorful way of saying "symbol
referencing error" (or NoSuchMethodException in Java-land).  At least, it is
in this case.  RJB was compiled against a header file for a library (the
JVM) which changed between compile-time and runtime.  When this happens,
some code paths will be referencing library symbols which do not exist, or
which have different signatures.  In either case, the usual result is a
segfault.

As discussed earlier, there is also a non-version-switch-related segfault
which seems to occur in weird places.  This is most likely a bug somewhere
in RJB.  The only way to track this down is to compile the RJB native code
with debug symbols enabled.  Then, run `gdb $RUBY_HOME/bin/ruby
$BUILDR_HOME/_buildr` and enter the "run" command at the resulting prompt (I
think it's "run" anyway, it's been a while).  GDB will automatically stop
exactly where the segfault will occur.  You can use the "list" and "print"
commands to dig around ("help" shows available options).  These sorts of
segfaults are usually more the equivalent of Java's NullPointerException,
but not always.  Watch out for 0-valued pointers or array indexes well out
of bounds.  Oh, if you want better tooling than GDB, you might be able to
use Eclipse CDT's debugger to step through, but I've never done it that way.

Bon chance!

Daniel

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message