Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.3.1, JRuby 1.4.0RC1
    • Fix Version/s: JRuby 1.4
    • Component/s: Extensions
    • Labels:
      None
    • Environment:
      Solaris, debug JVM
    • Number of attachments :
      0

      Description

      Some benchmarks, e.g. bench_compiled_load.rb or bench_erubis.rb, are hitting an assert in a debug JVM on Solaris:

      Internal Error at os.cpp:480, pid=7886, tid=1
      Error: memory stomping error

      A backtrace shows that it's probably a jna or jna-posix problem:

      1 - frame( sp=0x08046170, unextended_sp=0x08046170, fp=0x080461b0, pc=0xc500d086)
      com.sun.jna.Function.invokeInt(Native Method)
      2 - frame( sp=0x080461b8, unextended_sp=0x080461c0, fp=0x080461f4, pc=0xc5003253)
      com.sun.jna.Function.invoke(Function.java:298)
      3 - frame( sp=0x080461fc, unextended_sp=0x08046210, fp=0x0804623c, pc=0xc50031fb)
      com.sun.jna.Function.invoke(Function.java:223)
      4 - frame( sp=0x08046244, unextended_sp=0x08046278, fp=0x080462b0, pc=0xc50031fb)
      com.sun.jna.Library$Handler.invoke(Library.java:204)
      5 - frame( sp=0x080462b8, unextended_sp=0x080462c8, fp=0x080462f8, pc=0xc5003863)
      $Proxy4.lstat64
      6 - frame( sp=0x08046300, unextended_sp=0x08046304, fp=0x08046330, pc=0xc50038bb)
      org.jruby.ext.posix.SolarisPOSIX.lstat(SolarisPOSIX.java:37)
      7 - frame( sp=0x08046338, unextended_sp=0x0804633c, fp=0x08046368, pc=0xc5003863)
      org.jruby.RubyFileTest.symlink_p(RubyFileTest.java:270)
      8 - frame( sp=0x08046370, unextended_sp=0x0804637c, fp=0x080463a4, pc=0xc50031fb)
      org.jruby.RubyFile.unlink(RubyFile.java:1548)
      9 - frame( sp=0x080463ac, unextended_sp=0x080463c0, fp=0x080463ec, pc=0xc50031fb)
      org.jruby.RubyFile$s_method_0_0$RUBYINVOKER$unlink.call
      10 - frame( sp=0x080463f4, unextended_sp=0x080463f4, fp=0x0804642c, pc=0xc50031fb)
      org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:623)
      11 - frame( sp=0x08046434, unextended_sp=0x08046450, fp=0xa1a21ef0, pc=0xc51bb48c)
      org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:164)
      12 - frame( sp=0x08046490, unextended_sp=0x08046490, fp=0x080464e8, pc=0xc50031fb)
      org.jruby.runtime.invokedynamic.InvokeDynamicSupport.fallback(InvokeDynamicSupport.java:100)
      13 - frame( sp=0x080464f0, unextended_sp=0x080464fc, fp=0x08046530, pc=0xc5003863)
      bench.bench_compiled_load._file_(bench_compiled_load.rb:85)
      14 - frame( sp=0x08046538, unextended_sp=0x08046548, fp=0x0804657c, pc=0xc50031fb)
      bench.bench_compiled_load.load
      15 - frame( sp=0x08046584, unextended_sp=0x08046584, fp=0x080465b8, pc=0xc5003863)
      org.jruby.Ruby.runScript(Ruby.java:612)
      16 - frame( sp=0x080465c0, unextended_sp=0x080465c8, fp=0x080465f0, pc=0xc50031fb)
      org.jruby.Ruby.runNormally(Ruby.java:534)
      17 - frame( sp=0x080465f8, unextended_sp=0x08046604, fp=0x0804662c, pc=0xc50031fb)
      org.jruby.Ruby.runFromMain(Ruby.java:380)
      18 - frame( sp=0x08046634, unextended_sp=0x0804664c, fp=0x08046678, pc=0xc50033cf)
      org.jruby.Main.run(Main.java:272)
      19 - frame( sp=0x08046680, unextended_sp=0x080466b0, fp=0x080466d4, pc=0xc5003253)
      org.jruby.Main.run(Main.java:117)
      20 - frame( sp=0x080466dc, unextended_sp=0x080466e8, fp=0x08046710, pc=0xc5003253)
      org.jruby.Main.main(Main.java:97)

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        I forget if you told me...does this still break under JRuby 1.4.0RC1 and a 1.5dev build? The latter has replaced JNA with a newer library.

        Show
        Charles Oliver Nutter added a comment - I forget if you told me...does this still break under JRuby 1.4.0RC1 and a 1.5dev build? The latter has replaced JNA with a newer library.
        Hide
        Wayne Meissner added a comment -

        I would guess this is still there in 1.5.0dev.

        The stat structure in jna-posix (and jnr-posix) for 32 bit solaris is missing some members, which results in less memory than neccessary being allocated before being passed to the stat/lstat system call.

        In LP64 mode, both struct stat and struct stat64 are the same, and slightly different to the 32bit struct layout. This one appears to be ok in jnr-posix (and jna-posix did not support 64bit solaris, so not a problem there either). i.e. for 64bit, 1.5.0dev should be ok.

        I'll rework the 32bit struct for jnr-posix, and it should be able to be backported to jna-posix for jruby-1.4.0

        Show
        Wayne Meissner added a comment - I would guess this is still there in 1.5.0dev. The stat structure in jna-posix (and jnr-posix) for 32 bit solaris is missing some members, which results in less memory than neccessary being allocated before being passed to the stat/lstat system call. In LP64 mode, both struct stat and struct stat64 are the same, and slightly different to the 32bit struct layout. This one appears to be ok in jnr-posix (and jna-posix did not support 64bit solaris, so not a problem there either). i.e. for 64bit, 1.5.0dev should be ok. I'll rework the 32bit struct for jnr-posix, and it should be able to be backported to jna-posix for jruby-1.4.0
        Hide
        Wayne Meissner added a comment -

        Fixed in commit 92:2eb354a79378 in jnr-posix.

        Somebody Else (aka enebo) can backport it to jna-posix and cut a new release of that for jruby-1.4

        Show
        Wayne Meissner added a comment - Fixed in commit 92:2eb354a79378 in jnr-posix. Somebody Else (aka enebo) can backport it to jna-posix and cut a new release of that for jruby-1.4
        Hide
        Charles Oliver Nutter added a comment -

        Wayne to the rescue! Thanks very much!

        Show
        Charles Oliver Nutter added a comment - Wayne to the rescue! Thanks very much!
        Hide
        Thomas E Enebo added a comment -

        New jna-posix 1.0.2 solves this on 1.4 branch in commit c196742

        Show
        Thomas E Enebo added a comment - New jna-posix 1.0.2 solves this on 1.4 branch in commit c196742

          People

          • Assignee:
            Thomas E Enebo
            Reporter:
            Christian Thalinger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: