vmkit runtime errors

Hi LLVM developers,

I have successfully installed LLVM 2.9 on an ubuntu linux box, with a LLVM-based frontend support of gcc and g++. After installing successfully vmkit I have tried running my java applications, but it failed. I have installed the latest stable release of vmkit (0.29) using the introduction text of the LLVM website.

The application does consist of two programs. The first one is a network-based class loader, the other one is a clojure-based Lisp-environment.

The network class loader starts slowly with j3, but all is fine at the first moment. After requesting to load some classes and clojure files via an emacs session to the second program, I get following exception trace:

Exception in thread "pool-2-thread-1" java.lang.UnsatisfiedLinkError: sun.misc.Unsafe.putObject(Ljava/lang/Object;JLjava/lang/Object;)V
    at sun.misc.Unsafe.putObject(Unsafe.java:0)
    at java.util.concurrent.locks.LockSupport.setBlocker(LockSupport.java:107)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
    at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
    at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
    at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:506)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:703)
    at java.lang.Thread.run(Thread.java:743)
    at java.lang.VMThread.run(VMThread.java:120)

The second program is at this moment started with a SUN (ORACLE) runtime standard edition and is in good condition.

If I try also to start the clojure environment with j3 I get the following exception trace:

./clojure_swank_server.sh
Exception in thread "main" java.lang.ExceptionInInitializerError
    at opencommunication.InitClojure.main(InitClojure.java:60)
Caused by: java.lang.RuntimeException: java.lang.Exception: Unable to resolve symbol: def in this context (core.clj:13)
    at clojure.lang.RT.<clinit>(RT.java:368)
    at opencommunication.InitClojure.main(InitClojure.java:60)
Caused by: java.lang.Exception: Unable to resolve symbol: def in this context (core.clj:13)
    at clojure.lang.Compiler.analyze(Compiler.java:5199)
    at clojure.lang.Compiler.analyze(Compiler.java:5148)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3076)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:5363)
    at clojure.lang.Compiler.analyze(Compiler.java:5186)
    at clojure.lang.Compiler.analyze(Compiler.java:5148)
    at clojure.lang.Compiler.eval(Compiler.java:5412)
    at clojure.lang.Compiler.load(Compiler.java:5798)
    at clojure.lang.RT.loadResourceScript(RT.java:407)
    at clojure.lang.RT.loadResourceScript(RT.java:397)
    at clojure.lang.RT.load(RT.java:474)
    at clojure.lang.RT.load(RT.java:447)
    at clojure.lang.RT.doInit(RT.java:482)
    at clojure.lang.RT.<clinit>(RT.java:366)
    ...1 more
Caused by: java.lang.Exception: Unable to resolve symbol: def in this context
    at clojure.lang.Compiler.resolveIn(Compiler.java:5645)
    at clojure.lang.Compiler.resolve(Compiler.java:5597)
    at clojure.lang.Compiler.analyzeSymbol(Compiler.java:5561)
    at clojure.lang.Compiler.analyze(Compiler.java:5168)
    ...14 more

The class loader has problems to load the core system of clojure. With the standard JDK from SUN all starts fine.

I would appreciate any help to solve this issue.

Best regards, Ingmar

Hi Ingmar,

Hi LLVM developers,

I have successfully installed LLVM 2.9 on an ubuntu linux box, with a
LLVM-based frontend support of gcc and g++. After installing
successfully vmkit I have tried running my java applications, but it
failed. I have installed the latest stable release of vmkit (0.29) using
the introduction text of the LLVM website.

The application does consist of two programs. The first one is a
network-based class loader, the other one is a clojure-based
Lisp-environment.

The network class loader starts slowly with j3, but all is fine at the
first moment.

Yeah, startup time is really not good in j3, I am working on this and hopefully will have something before llvm 3.0.

After requesting to load some classes and clojure files
via an emacs session to the second program, I get following exception trace:

Exception in thread “pool-2-thread-1” java.lang.UnsatisfiedLinkError:
sun.misc.Unsafe.putObject(Ljava/lang/Object;JLjava/lang/Object;)V
at sun.misc.Unsafe.putObject(Unsafe.java:0)
at
java.util.concurrent.locks.LockSupport.setBlocker(LockSupport.java:107)
at
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
at
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
at
java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
at
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:506)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:703)
at java.lang.Thread.run(Thread.java:743)
at java.lang.VMThread.run(VMThread.java:120)

That’s because I haven’t implemented putObject in J3. I don’t think that’s a big deal to implement, but I suspect that the use of java.util.concurrent will also lead you to implement Thread.park/unpark, which is less trivial. After my work on startup time, I can take a look at it.

The second program is at this moment started with a SUN (ORACLE) runtime
standard edition and is in good condition.

If I try also to start the clojure environment with j3 I get the
following exception trace:

./clojure_swank_server.sh
Exception in thread “main” java.lang.ExceptionInInitializerError
at opencommunication.InitClojure.main(InitClojure.java:60)
Caused by: java.lang.RuntimeException: java.lang.Exception: Unable to
resolve symbol: def in this context (core.clj:13)
at clojure.lang.RT.(RT.java:368)
at opencommunication.InitClojure.main(InitClojure.java:60)
Caused by: java.lang.Exception: Unable to resolve symbol: def in this
context (core.clj:13)
at clojure.lang.Compiler.analyze(Compiler.java:5199)
at clojure.lang.Compiler.analyze(Compiler.java:5148)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3076)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:5363)
at clojure.lang.Compiler.analyze(Compiler.java:5186)
at clojure.lang.Compiler.analyze(Compiler.java:5148)
at clojure.lang.Compiler.eval(Compiler.java:5412)
at clojure.lang.Compiler.load(Compiler.java:5798)
at clojure.lang.RT.loadResourceScript(RT.java:407)
at clojure.lang.RT.loadResourceScript(RT.java:397)
at clojure.lang.RT.load(RT.java:474)
at clojure.lang.RT.load(RT.java:447)
at clojure.lang.RT.doInit(RT.java:482)
at clojure.lang.RT.(RT.java:366)
…1 more
Caused by: java.lang.Exception: Unable to resolve symbol: def in this
context
at clojure.lang.Compiler.resolveIn(Compiler.java:5645)
at clojure.lang.Compiler.resolve(Compiler.java:5597)
at clojure.lang.Compiler.analyzeSymbol(Compiler.java:5561)
at clojure.lang.Compiler.analyze(Compiler.java:5168)
…14 more

That’s interesting. Could you send me the steps to get and execute the program, see if I can reproduce it? I will then take a look.

Cheers,
Nicolas