# SIGSEGV in ld-linux.so when compiling recent JRuby versions (\> rev #7907) \[SOLVED\]

**URL:** <https://www.ruby-forum.com/t/sigsegv-in-ld-linux-so-when-compiling-recent-jruby-versions-rev-7907-solved/151934>\
**Category:** JRuby\
**Created:** [October 28, 2008, 2:55am UTC](https://www.ruby-forum.com/t/sigsegv-in-ld-linux-so-when-compiling-recent-jruby-versions-rev-7907-solved/151934 "2008-10-28T02:55:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaphaSSSSl\_Valyi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/eada6e/32.png) [@RaphaSSSSl\_Valyi](https://www.ruby-forum.com/u/RaphaSSSSl_Valyi)\
**Post date:** [October 28, 2008, 2:55am UTC](https://www.ruby-forum.com/t/sigsegv-in-ld-linux-so-when-compiling-recent-jruby-versions-rev-7907-solved/151934/1 "2008-10-28T02:55:28Z")

</div>

Hi, just in case, to help the average googler:

Since commit #7907, I had a strange bug when compiling JRuby with ant  
jar-complete:  
jar-complete:  
[mkdir] Created dir:  
/home/rvalyi/DEV/jruby\_old/build/jar-complete/META-INF/jruby.home  
[copy] Copying 697 files to  
/home/rvalyi/DEV/jruby\_old/build/jar-complete/META-INF/jruby.home  
[copy] Copied 106 empty directories to 8 empty directories under  
/home/rvalyi/DEV/jruby\_old/build/jar-complete/META-INF/jruby.home  
[copy] Copying 504 files to  
/home/rvalyi/DEV/jruby\_old/build/jar-complete  
[java] #  
[java] # A fatal error has been detected by the Java Runtime  
Environment:  
[java] #  
[java] # SIGSEGV (0xb) at pc=0xb7fca3a2, pid=32060, tid=3076160400  
[java] #  
[java] # Java VM: Java HotSpot™ Client VM (14.0-b05 mixed  
mode, sharing linux-x86 )  
[java] # Problematic frame:  
[java] # C [ld-linux.so.2+0xe3a2]  
[java] #  
[java] # An error report file with more information is saved as:  
[java] # /home/rvalyi/DEV/jruby\_old/hs\_err\_pid32060.log  
[java] #  
[java] # If you would like to submit a bug report, please visit:  
[java] # [Bug Report](http://java.sun.com/webapps/bugreport/crash.jsp)  
[java] # The crash happened outside the Java Virtual Machine in  
native code.  
[java] # See problematic frame for where to report the bug.  
[java] #

BUILD FAILED  
/home/rvalyi/DEV/jruby/build.xml:343: Java returned: 134

After investigating at the wmeissner found that compiling with ant jar  
and then trying out that command:

> ./bin/jruby -rffi -e ‘module LibC; extend FFI::Library; attach\_function :getpwuid, [:int], :pointer;end; p LibC.getpwuid(0)’  
> would result into the same error, meaning their is an error with the  
> getpwuid libc6 method on some Ubuntu installations.

Part of the C stack was:  
Stack: [0xb7434000,0xb7535000], sp=0xb7533670, free space=1021k  
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code,  
C=native code)  
C [ld-linux.so.2+0xe3a2]  
C [ld-linux.so.2+0x113f3]  
C [libc.so.6+0x103de2]  
C [ld-linux.so.2+0xd716]  
C [libc.so.6+0x103ee1]  
C [libc.so.6+0x104006] \_\_libc\_dlopen\_mode+0x36  
C [libc.so.6+0xdd6a7] \_\_nss\_lookup\_function+0x2a7  
C [libc.so.6+0xdd78c]  
C [libc.so.6+0xdf43d] \_\_nss\_passwd\_lookup2+0x4d  
C [libc.so.6+0x95fbe] getpwuid\_r+0x1ce  
C [libc.so.6+0x957f7] getpwuid+0x77  
C [jna7738.tmp+0x10ec7] ffi\_call\_SYSV+0x17  
C [jna7738.tmp+0x10b74] ffi\_call+0xb4  
C [jna7738.tmp+0x3671]  
C [jna7738.tmp+0x3d20] Java\_com\_sun\_jna\_Function\_invokePointer+0x43  
j  
com.sun.jna.Function.invokePointer(I[Ljava/lang/Object;)Lcom/sun/jna/Pointer;+0  
j  
com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+603  
j  
com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+194  
j  
com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;+6  
j  
com.sun.jna.Function.invokePointer([Ljava/lang/Object;)Lcom/sun/jna/Pointer;+23  
j  
org.jruby.ext.ffi.jna.JNAProvider$PointerInvoker.invoke(Lorg/jruby/Ruby;Lcom/sun/jna/Function;[Ljava/lang/Object;)Lorg/jruby/runtime/builtin/IRubyObject;+7  
j  
org.jruby.ext.ffi.jna.DynamicMethodOneArg.call(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/RubyModule;Ljava/lang/String;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;+46  
j  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/RubyClass;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;+57

Finally, we just tried out what Charles Nutter found some weeks ago  
here:

> **[libdl \_dl\_debug\_initialize problem solved](http://blog.headius.com/2008/08/libdl-dldebuginitialize-problem-solved.html)**
>
> I'm posting this to make sure it gets out there, so nobody else spends a couple days trying to fix it.Recently, after some upgrade, I started getting the following message during JRuby's run of RubySpecs:Inconsistency detected by ld.so: dl-open.c:...

Meaning that the libc6-i68 library seems broken on Ubuntu, at least  
the 8.10 and 7.10 versions I tried.  
Again as nothing important was depending on it, I just removed the  
libc6-i68 package with apt-get remove libc6-i68

And then everything worked again like a charm.

Happy hacking!

Raphaël Valyi.

* * *

To unsubscribe from this list, please visit:

```
http://xircles.codehaus.org/manage_email

```

---

<div class="post-metadata">

**Author:** ![RaphaSSSSl\_Valyi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/eada6e/32.png) [@RaphaSSSSl\_Valyi](https://www.ruby-forum.com/u/RaphaSSSSl_Valyi)\
**Post date:** [October 28, 2008, 7:29pm UTC](https://www.ruby-forum.com/t/sigsegv-in-ld-linux-so-when-compiling-recent-jruby-versions-rev-7907-solved/151934/2 "2008-10-28T19:29:13Z")

</div>

RaphaÃ«l Valyi wrote:

> Finally, we just tried out what Charles Nutter found some weeks ago  
> here: [libdl \_dl\_debug\_initialize problem solved – Charles Oliver Nutter – Java, Ruby, and JVM guy trying to make sense of it all](http://blog.headius.com/2008/08/libdl-dldebuginitialize-problem-solved.html)
> 
> Meaning that the libc6-i68 library seems broken on Ubuntu, at least  
> the 8.10 and 7.10 versions I tried.  
> Again as nothing important was depending on it, I just removed the  
> libc6-i68 package with apt-get remove libc6-i68
> 
> And then everything worked again like a charm.

This strongly points toward there being something “wrong” with JNA on  
Ubuntu when libc6-i686 is installed. We need to investigate that  
possibility, and if it turns out it’s JNA causing the crashing, we must  
do two things:

1. Modify jna-posix to not even load JNA when native.enabled=false (i.e.  
load it reflectively
2. Fix JNA

See my dev post and [http://jira.codehaus.org/browse/JRUBY-3084](http://jira.codehaus.org/browse/JRUBY-3084)

- Charlie

* * *

To unsubscribe from this list, please visit:

```
http://xircles.codehaus.org/manage_email

```
