I'm also seeing crashes for several scenarios. Like this loop works:

a = 1; while a < 1_000_000; a += 1; end

But these two crash the JVM:

a = 1.0; while a < 1_000_000.0; foo(a); a += 1.0; end
def foo(a); end; a = 1; while a < 1_000_000; foo(a); a += 1; end

A simple fib bench also crashed. I've attached a dump from the "foo" case above, and I can provide a jruby dist to reproduce if you like.

It tends to stymie further experimentation :) (no pressure, I know this stuff has just recently started to JIT).

- Charlie

Yehuda Katz wrote:
I'm trying to implement a simple method missing using invokeDynamic. I've been able to make it work using static methods or static methods that proxy to virtual methods (but not directly to virtual methods). However, I'm trying to add support for including the name of the method in the call to MethodMissing.

Based on the Fidget demo, it seemed like the way to go would be to create a custom JavaMethodHandle that encapsulated the logic. I wasn't able to get it working (mostly in the setTarget step). However, during some experiments, I encountered a segfault in the JVM, so I figured I'd report it. The details (including the minimal test case) are at http://gist.github.com/113717.

That said, I'm curious about the appropriate way to wire this up. I'm rather new to all of this, so I'm probably missing something obvious.

--
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325


------------------------------------------------------------------------

_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (signature.cpp:60), pid=27520, tid=2954375168
#  Error: expecting (
#
# JRE version: 7.0
# Java VM: OpenJDK Server VM (15.0-b02 mixed mode bsd-x86 )
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x00822000):  VMThread [stack: 0xb0103000,0xb0183000] 
[id=-1340592128]

Stack: [0xb0103000,0xb0183000],  sp=0xb0181ab0,  free space=506k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x6a727e]
V  [libjvm.dylib+0x256bd0]
V  [libjvm.dylib+0x5ee2c7]
V  [libjvm.dylib+0x2fa185]
V  [libjvm.dylib+0x2fd02d]
V  [libjvm.dylib+0x2fefe2]
V  [libjvm.dylib+0x2ff4eb]
V  [libjvm.dylib+0x2ff839]
V  [libjvm.dylib+0x54fd88]
V  [libjvm.dylib+0x550baf]
V  [libjvm.dylib+0x550e02]
V  [libjvm.dylib+0x334835]
V  [libjvm.dylib+0x5274f6]
V  [libjvm.dylib+0x2c1038]
V  [libjvm.dylib+0x2c11c6]
V  [libjvm.dylib+0x654675]
V  [libjvm.dylib+0x654a39]
V  [libjvm.dylib+0x5d4569]
V  [libjvm.dylib+0x2f3316]
V  [libjvm.dylib+0x25b8ae]
V  [libjvm.dylib+0x2f50ce]
V  [libjvm.dylib+0x2058b3]
V  [libjvm.dylib+0x2f2ca5]
V  [libjvm.dylib+0x6a835b]
V  [libjvm.dylib+0x6acb45]
V  [libjvm.dylib+0x6ab21d]
V  [libjvm.dylib+0x6abe8c]
V  [libjvm.dylib+0x6ac17c]
V  [libjvm.dylib+0x558b25]
C  [libSystem.B.dylib+0x32155]  _pthread_start+0x141
C  [libSystem.B.dylib+0x32012]  thread_start+0x22

VM_Operation (0xb01006ac): GenCollectForAllocation, mode: safepoint, requested 
by thread 0x00800800


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x00839400 JavaThread "Low Memory Detector" daemon [_thread_blocked, 
id=-1335300096, stack(0xb058f000,0xb068f000)]
  0x00837c00 JavaThread "CompilerThread1" daemon [_thread_blocked, 
id=-1336356864, stack(0xb050d000,0xb058d000)]
  0x00837000 JavaThread "CompilerThread0" daemon [_thread_blocked, 
id=-1336889344, stack(0xb048b000,0xb050b000)]
  0x0082a400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, 
id=-1337421824, stack(0xb0389000,0xb0489000)]
  0x00826c00 JavaThread "Finalizer" daemon [_thread_blocked, id=-1338478592, 
stack(0xb0287000,0xb0387000)]
  0x00822c00 JavaThread "Reference Handler" daemon [_thread_blocked, 
id=-1339535360, stack(0xb0185000,0xb0285000)]
  0x00800800 JavaThread "main" [_thread_blocked, id=-1341124608, 
stack(0xb0001000,0xb0101000)]

Other Threads:
=>0x00822000 VMThread [stack: 0xb0103000,0xb0183000] [id=-1340592128]
  0x0083a000 WatcherThread [stack: 0xb0691000,0xb0711000] [id=-1334767616]

VM state:at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread:  ([mutex/lock_event])
[0x00103160] Threads_lock - owner thread: 0x00822000
[0x00103520] Heap_lock - owner thread: 0x00800800

Heap
 def new generation   total 960K, used 960K [0x04dd0000, 0x04ed0000, 0x08550000)
  eden space 896K, 100% used [0x04dd0000, 0x04eb0000, 0x04eb0000)
  from space 64K, 100% used [0x04ec0000, 0x04ed0000, 0x04ed0000)
  to   space 64K,   0% used [0x04eb0000, 0x04eb0020, 0x04ec0000)
 tenured generation   total 4096K, used 1190K [0x08550000, 0x08950000, 
0x241d0000)
   the space 4096K,  29% used [0x08550000, 0x08679810, 0x08679a00, 0x08950000)
 compacting perm gen  total 16384K, used 10839K [0x241d0000, 0x251d0000, 
0x281d0000)
   the space 16384K,  66% used [0x241d0000, 0x24c65ce0, 0x24c65e00, 0x251d0000)
No shared spaces configured.

Dynamic libraries:
0x00000000      /usr/lib/libgcc_s.1.dylib
0x00000000      /usr/lib/libSystem.B.dylib
0x00000000      /usr/lib/system/libmathCommon.A.dylib
0x01000000      
/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/lib/i386/server/libjvm.dylib
0x00000000      /usr/lib/libstdc++.6.dylib
0x0001d000      
/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/lib/i386/libverify.dylib
0x0002b000      
/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/lib/i386/libjava.dylib
0x00052000      
/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/lib/i386/native_threads/libhpi.dylib
0x00065000      
/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/lib/i386/libzip.dylib
0x007df000      
/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/lib/i386/libnet.dylib
0x007f3000      
/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/lib/i386/libmanagement.dylib
0x281e0000      
/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/lib/i386/libnio.dylib
0x2821d000      /private/var/tmp/jna56014.tmp
0x28235000      /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM
0x00000000      
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x00000000      /usr/lib/libobjc.A.dylib
0x00000000      
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x00000000      /usr/lib/libicucore.A.dylib
0x28244000      /usr/lib/libxml2.2.dylib
0x00000000      /usr/lib/libz.1.dylib
0x00000000      
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x00000000      
/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x00000000      
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x00000000      
/System/Library/Frameworks/Security.framework/Versions/A/Security
0x00000000      /usr/lib/libauto.dylib
0x00000000      /usr/lib/libsqlite3.0.dylib
0x00000000      /usr/lib/libresolv.9.dylib
0x00000000      
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x00000000      
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x00000000      
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x00000000      
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x00000000      
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x00000000      
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x00000000      
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
0x00000000      /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x00000000      
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x00000000      /usr/lib/libbsm.dylib
0x00000000      /usr/lib/libxslt.1.dylib

VM Arguments:
jvm_args: -Djruby.memory.max=500m -Djruby.stack.max=1024k -Xmx500m -Xss1024k 
-Djna.boot.library.path=/Users/headius/projects/jruby/lib/native/darwin 
-Djffi.boot.library.path=/Users/headius/projects/jruby/lib/native/*Darwin 
-Dfile.encoding=UTF-8 -XX:+EnableInvokeDynamic 
-Djruby.compile.invokedynamic=true -Dfile.encoding=UTF-8 
-Xbootclasspath/a:/Users/headius/projects/jruby/lib/jruby.jar:/Users/headius/projects/jruby/lib/bsf.jar
 -Djruby.home=/Users/headius/projects/jruby 
-Djruby.lib=/Users/headius/projects/jruby/lib -Djruby.script=jruby 
-Djruby.shell=/bin/sh 
java_command: org.jruby.Main -e def foo(a); a; end; a = 1; while a < 1_000_000; 
foo(a); a += 1; end
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/
PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin:/Users/headius/projects/jruby/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/opt/local/sbin
SHELL=/bin/bash
DISPLAY=/tmp/launch-nNh4JU/:0
DYLD_FALLBACK_LIBRARY_PATH=/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/lib/i386/server:/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/lib/i386:/Users/headius/projects/davinci/sources/build/bsd-i586/j2sdk-image/jre/../lib/i386

Signal Handlers:
SIGSEGV: [libjvm.dylib+0x6a7cb0], sa_mask[0]=0xfffefeff, sa_flags=0x00000042
SIGBUS: [libjvm.dylib+0x6a7cb0], sa_mask[0]=0xfffefeff, sa_flags=0x00000042
SIGFPE: [libjvm.dylib+0x5549b0], sa_mask[0]=0xfffefeff, sa_flags=0x00000042
SIGPIPE: [libjvm.dylib+0x5549b0], sa_mask[0]=0xfffefeff, sa_flags=0x00000042
SIGXFSZ: [libjvm.dylib+0x5549b0], sa_mask[0]=0xfffefeff, sa_flags=0x00000042
SIGILL: [libjvm.dylib+0x5549b0], sa_mask[0]=0xfffefeff, sa_flags=0x00000042
SIGUSR1: SIG_DFL, sa_mask[0]=0x63807efb, sa_flags=0x00000000
SIGUSR2: [libjvm.dylib+0x555be0], sa_mask[0]=0x00000000, sa_flags=0x00000042
SIGHUP: [libjvm.dylib+0x5572e0], sa_mask[0]=0xfffefeff, sa_flags=0x00000042
SIGINT: [libjvm.dylib+0x5572e0], sa_mask[0]=0xfffefeff, sa_flags=0x00000042
SIGTERM: [libjvm.dylib+0x5572e0], sa_mask[0]=0xfffefeff, sa_flags=0x00000042
SIGQUIT: [libjvm.dylib+0x5572e0], sa_mask[0]=0xfffefeff, sa_flags=0x00000042


---------------  S Y S T E M  ---------------

OS:Bsd
uname:Darwin 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009; 
root:xnu-1228.12.14~1/RELEASE_I386 i386
rlimit: STACK 8192k, CORE 0k, NPROC 266, NOFILE 10240
CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping 
10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1

Memory: 4k page, physical 1446824k(361706k free)

vm_info: OpenJDK Server VM (15.0-b02) for bsd-x86 JRE 
(1.7.0-internal-headius_2009_05_18_01_16-b00), built on May 18 2009 01:23:44 by 
"headius" with gcc 4.0.1 (Apple Inc. build 5490)

time: Mon May 18 17:55:20 2009
elapsed time: 1 seconds

_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to