Le 14/11/2009 10:22, Lukas Stadler a écrit :
Ah, yes... I forgot to mention: it's currently only implemented in C1,
and it doesn't even compile on C2 because I had to extend the compiler
interface. But I'll probably get rid of that, and then it will be a lot
easier to get C2 working as well.

You're of course right about the graceful shutdown - I will do that as
well. And if at runtime you're getting crashes in weird places: chances
are that -Xcomp will fix it.

- Lukas

Hi Lukas,
Your example doesn't work on my laptop:

0
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (nmethod.cpp:1997), pid=32273, tid=14347120
# Error: guarantee(cont_offset != 0,"unhandled implicit exception in compiled code")
#
# JRE version: 7.0-b75
# Java VM: OpenJDK Client VM (17.0-b03-internal compiled mode linux-x86 )
# An error report file with more information is saved as:
# /home/forax/java/workspace/coroutine-test/hs_err_pid32273.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

I've attached the hotspot error log.

I've the same error using Fiber or Continuation.

Rémi


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

public class FiberTest {

  static class MyFiber extends Fiber {
    @Override
    protected Object generate(Object arg) {
      System.out.println("generate called with "+arg);

      return null;
    }
  }

  @Continuable
  public static void main(String[] args) {
    MyFiber fiber=new MyFiber();

    Object result = fiber.resume("toto");

    System.out.println("resume output "+result);
  }
}

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

public class CoroutineTest extends Coroutine {
    public CoroutineTest(CoroutineContext context) {
        super(context);
    }

    public static void main(String[] args) {
        CoroutineContext context = new CoroutineContext();
        new CoroutineTest(context);
        new CoroutineTest(context);
        context.start(null);
    }

    @Continuable
    protected Object run(Object value) {
        for (int i = 0; i<  10; i++) {
            System.out.println(i);
            yield(null);
        }
        return null;
    }
}



Rémi Forax wrote:
Hi Lukas, hi all,

C1 seems to work but not C2 (see further).

Furthermore by default, hotspot requires that package javax.stack exists
instead of gracefully disable coroutine if javax.stack is not here
(which is the case of the first build, i.e when you use jdk6 to compile
jdk7).

I will test it tomorrow,
Rémi

_______________________________________________
mlvm-dev mailing list
[email protected]
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (nmethod.cpp:1997), pid=32273, tid=14347120
#  Error: guarantee(cont_offset != 0,"unhandled implicit exception in compiled 
code")
#
# JRE version: 7.0-b75
# Java VM: OpenJDK Client VM (17.0-b03-internal compiled mode linux-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 (0xb7705000):  JavaThread "main" [_thread_in_Java, id=32275, 
stack(0x00d5e000,0x00daf000)]

Stack: [0x00d5e000,0x00daf000],  sp=0xb57fb980,  free space=ffed2a76b57fb9d4k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x3e9795]
V  [libjvm.so+0x3e9a0c]
V  [libjvm.so+0x186f2b]
V  [libjvm.so+0x2f6370]
V  [libjvm.so+0x34fe98]
V  [libjvm.so+0x311392]
V  [libjvm.so+0x30baa6]


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

Java Threads: ( => current thread )
  0xb7765800 JavaThread "Low Memory Detector" daemon [_thread_blocked, 
id=32284, stack(0x0039b000,0x003ec000)]
  0xb7763800 JavaThread "CompilerThread0" daemon [_thread_in_vm, id=32283, 
stack(0x002fa000,0x0037b000)]
  0xb7762000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=32282, 
stack(0x00bd4000,0x00c25000)]
  0xb7752800 JavaThread "Finalizer" daemon [_thread_blocked, id=32281, 
stack(0x002a9000,0x002fa000)]
  0xb7751400 JavaThread "Reference Handler" daemon [_thread_blocked, id=32280, 
stack(0x0064e000,0x0069f000)]
=>0xb7705000 JavaThread "main" [_thread_in_Java, id=32275, 
stack(0x00d5e000,0x00daf000)]

Other Threads:
  0xb774c000 VMThread [stack: 0x0087a000,0x008fb000] [id=32279]
  0xb7767800 WatcherThread [stack: 0x003ec000,0x0046d000] [id=32285]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 960K, used 197K [0xad680000, 0xad780000, 0xadb60000)
  eden space 896K,  22% used [0xad680000, 0xad6b1758, 0xad760000)
  from space 64K,   0% used [0xad760000, 0xad760000, 0xad770000)
  to   space 64K,   0% used [0xad770000, 0xad770000, 0xad780000)
 tenured generation   total 4096K, used 0K [0xadb60000, 0xadf60000, 0xb1680000)
   the space 4096K,   0% used [0xadb60000, 0xadb60000, 0xadb60200, 0xadf60000)
 compacting perm gen  total 12288K, used 1770K [0xb1680000, 0xb2280000, 
0xb5680000)
   the space 12288K,  14% used [0xb1680000, 0xb183aa78, 0xb183ac00, 0xb2280000)
No shared spaces configured.

Dynamic libraries:
00110000-0027b000 r-xp 00000000 fd:00 8603       /lib/libc-2.10.1.so
0027b000-0027d000 r--p 0016b000 fd:00 8603       /lib/libc-2.10.1.so
0027d000-0027e000 rw-p 0016d000 fd:00 8603       /lib/libc-2.10.1.so
0027e000-00281000 rw-p 00000000 00:00 0 
00281000-002a7000 r-xp 00000000 fd:00 14800      /lib/libm-2.10.1.so
002a7000-002a8000 r--p 00025000 fd:00 14800      /lib/libm-2.10.1.so
002a8000-002a9000 rw-p 00026000 fd:00 14800      /lib/libm-2.10.1.so
002a9000-002ac000 ---p 00000000 00:00 0 
002ac000-002fa000 rwxp 00000000 00:00 0 
002fa000-002fd000 ---p 00000000 00:00 0 
002fd000-0037b000 rwxp 00000000 00:00 0 
00392000-00399000 r-xp 00000000 fd:00 15715      /lib/librt-2.10.1.so
00399000-0039a000 r--p 00006000 fd:00 15715      /lib/librt-2.10.1.so
0039a000-0039b000 rw-p 00007000 fd:00 15715      /lib/librt-2.10.1.so
0039b000-0039e000 ---p 00000000 00:00 0 
0039e000-003ec000 rwxp 00000000 00:00 0 
003ec000-003ed000 ---p 00000000 00:00 0 
003ed000-0046d000 rwxp 00000000 00:00 0 
004dc000-004f3000 r-xp 00000000 fd:00 1616750    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/libzip.so
004f3000-004f4000 rw-p 00016000 fd:00 1616750    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/libzip.so
00507000-0050a000 r-xp 00000000 fd:00 14759      /lib/libdl-2.10.1.so
0050a000-0050b000 r--p 00002000 fd:00 14759      /lib/libdl-2.10.1.so
0050b000-0050c000 rw-p 00003000 fd:00 14759      /lib/libdl-2.10.1.so
0055c000-00562000 r-xp 00000000 fd:00 1616722    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/native_threads/libhpi.so
00562000-00563000 rw-p 00006000 fd:00 1616722    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/native_threads/libhpi.so
00602000-00622000 r-xp 00000000 fd:00 11258      /lib/ld-2.10.1.so
00622000-00623000 r--p 0001f000 fd:00 11258      /lib/ld-2.10.1.so
00623000-00624000 rw-p 00020000 fd:00 11258      /lib/ld-2.10.1.so
0064e000-00651000 ---p 00000000 00:00 0 
00651000-0069f000 rwxp 00000000 00:00 0 
0086b000-00877000 r-xp 00000000 fd:00 1616737    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/libverify.so
00877000-00878000 rw-p 0000c000 fd:00 1616737    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/libverify.so
0087a000-0087b000 ---p 00000000 00:00 0 
0087b000-008fb000 rwxp 00000000 00:00 0 
00a2b000-00a3d000 r-xp 00000000 fd:00 1616736    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/jli/libjli.so
00a3d000-00a3e000 rw-p 00012000 fd:00 1616736    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/jli/libjli.so
00a4b000-00a6f000 r-xp 00000000 fd:00 1616746    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/libjava.so
00a6f000-00a71000 rw-p 00023000 fd:00 1616746    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/libjava.so
00b1c000-00b32000 r-xp 00000000 fd:00 15444      /lib/libpthread-2.10.1.so
00b32000-00b33000 ---p 00016000 fd:00 15444      /lib/libpthread-2.10.1.so
00b33000-00b34000 r--p 00016000 fd:00 15444      /lib/libpthread-2.10.1.so
00b34000-00b35000 rw-p 00017000 fd:00 15444      /lib/libpthread-2.10.1.so
00b35000-00b37000 rw-p 00000000 00:00 0 
00b50000-00b67000 r-xp 00000000 fd:00 14841      /lib/libnsl-2.10.1.so
00b67000-00b68000 r--p 00016000 fd:00 14841      /lib/libnsl-2.10.1.so
00b68000-00b69000 rw-p 00017000 fd:00 14841      /lib/libnsl-2.10.1.so
00b69000-00b6b000 rw-p 00000000 00:00 0 
00bd4000-00bd7000 ---p 00000000 00:00 0 
00bd7000-00c25000 rwxp 00000000 00:00 0 
00d5e000-00d61000 ---p 00000000 00:00 0 
00d61000-00daf000 rwxp 00000000 00:00 0 
00f1a000-00f25000 r-xp 00000000 fd:00 14845      /lib/libnss_files-2.10.1.so
00f25000-00f26000 r--p 0000a000 fd:00 14845      /lib/libnss_files-2.10.1.so
00f26000-00f27000 rw-p 0000b000 fd:00 14845      /lib/libnss_files-2.10.1.so
00fba000-00fbb000 r-xp 00000000 00:00 0          [vdso]
00fbb000-01419000 r-xp 00000000 fd:00 1690457    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/coroutine/libjvm.so
01419000-01433000 rw-p 0045d000 fd:00 1690457    
/usr/jdk/jdk1.7.0b75/jre/lib/i386/coroutine/libjvm.so
01433000-0184f000 rw-p 00000000 00:00 0 
08048000-08049000 r-xp 00000000 fd:00 1542991    /usr/jdk/jdk1.7.0b75/bin/java
08049000-0804a000 rw-p 00000000 fd:00 1542991    /usr/jdk/jdk1.7.0b75/bin/java
084c0000-084e1000 rw-p 00000000 00:00 0          [heap]
acf00000-ad100000 r--p 00000000 fd:00 6602753    /usr/lib/locale/locale-archive
ad100000-ad121000 rw-p 00000000 00:00 0 
ad121000-ad200000 ---p 00000000 00:00 0 
ad200000-ad221000 rw-p 00000000 00:00 0 
ad221000-ad300000 ---p 00000000 00:00 0 
ad300000-ad400000 rw-p 00000000 00:00 0 
ad40c000-ad454000 rw-p 00000000 00:00 0 
ad454000-ad600000 r--s 03768000 fd:00 1551243    
/usr/jdk/jdk1.7.0b75/jre/lib/rt.jar
ad600000-ad607000 rw-p 00000000 00:00 0 
ad607000-ad621000 rw-p 00000000 00:00 0 
ad621000-ad624000 rw-p 00000000 00:00 0 
ad624000-ad63f000 rw-p 00000000 00:00 0 
ad63f000-ad640000 rw-p 00000000 00:00 0 
ad640000-ad641000 rw-p 00000000 00:00 0 
ad641000-ad644000 rw-p 00000000 00:00 0 
ad644000-ad65f000 rw-p 00000000 00:00 0 
ad65f000-ad665000 rw-p 00000000 00:00 0 
ad665000-ad67f000 rw-p 00000000 00:00 0 
ad67f000-ad780000 rw-p 00000000 00:00 0 
ad780000-adb60000 rw-p 00000000 00:00 0 
adb60000-adf60000 rw-p 00000000 00:00 0 
adf60000-b1680000 rw-p 00000000 00:00 0 
b1680000-b2280000 rw-p 00000000 00:00 0 
b2280000-b5680000 rw-p 00000000 00:00 0 
b5680000-b5685000 rw-p 00000000 00:00 0 
b5685000-b5700000 rw-p 00000000 00:00 0 
b5700000-b5808000 rwxp 00000000 00:00 0 
b5808000-b776e000 rw-p 00000000 00:00 0 
b776e000-b7800000 ---p 00000000 00:00 0 
b7812000-b7814000 rw-p 00000000 00:00 0 
b781c000-b781d000 r--s 00002000 fd:00 2730833    
/home/forax/java/workspace/coroutine-test/coroutine.jar
b781d000-b7825000 rw-s 00000000 fd:00 1002358    /tmp/hsperfdata_forax/32273
b7825000-b7826000 r--p 00000000 00:00 0 
b7826000-b7827000 rw-p 00000000 00:00 0 
bfae7000-bfafb000 rwxp 00000000 00:00 0          [stack]
bfafb000-bfafc000 rw-p 00000000 00:00 0 

VM Arguments:
jvm_args: -Xcomp -Xbootclasspath/p:coroutine.jar -Dfile.encoding=UTF-8 
java_command: fr.umlv.coroutine.CoroutineTest
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=/usr/java
PATH=/usr/java/bin:/home/forax/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/forax/bin
USERNAME=forax
LD_LIBRARY_PATH=/usr/jdk/jdk1.7.0b75/jre/lib/i386/coroutine:/usr/jdk/jdk1.7.0b75/jre/lib/i386:/usr/jdk/jdk1.7.0b75/jre/../lib/i386:/usr/jdk/jdk1.7.0/jre/lib/i386/client:/usr/jdk/jdk1.7.0/jre/lib/i386:/usr/lib/xulrunner-1.9.1:/usr/lib/xulrunner-1.9.1
SHELL=/bin/bash
DISPLAY=:0.0

Signal Handlers:
SIGSEGV: [libjvm.so+0x3ea430], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGBUS: [libjvm.so+0x3ea430], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGFPE: [libjvm.so+0x30ba80], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGPIPE: [libjvm.so+0x30ba80], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGXFSZ: [libjvm.so+0x30ba80], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGILL: [libjvm.so+0x30ba80], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: [libjvm.so+0x30b1c0], sa_mask[0]=0x00000004, sa_flags=0x10000004
SIGHUP: [libjvm.so+0x30d530], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGINT: [libjvm.so+0x30d530], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGTERM: [libjvm.so+0x30d530], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGQUIT: [libjvm.so+0x30d530], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004


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

OS:Fedora release 11 (Leonidas)

uname:Linux 2.6.30.9-96.fc11.i586 #1 SMP Tue Nov 3 23:33:04 EST 2009 i686
libc:glibc 2.10.1 NPTL 2.10.1 
rlimit: STACK 10240k, CORE 0k, NPROC 1024, NOFILE 1024, AS infinity
load average:0.13 0.14 0.13

CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping 6, 
cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1

Memory: 4k page, physical 3567532k(567832k free), swap 5636088k(5636088k free)

vm_info: OpenJDK Client VM (17.0-b03-internal) for linux-x86 JRE (1.7.0), built 
on Nov 14 2009 17:49:41 by "forax" with gcc 4.4.1 20090725 (Red Hat 4.4.1-2)

time: Sat Nov 14 18:55:19 2009
elapsed time: 0 seconds

_______________________________________________
mlvm-dev mailing list
[email protected]
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to