VMKIT: Assertion at build

Hello,

after completing the build i get

...
BUILD SUCCESSFUL
Total time: 5 seconds
llvm[2]: Building Release+Asserts mmtk-vmkit.jar all
vmjc: /home1/public/zakkak/llvm/lib/VMCore/Type.cpp:747: static llvm::PointerType *llvm::PointerType::get(llvm::Type *, unsigned int): Assertion `EltTy && "Can't get a pointer to <null> type!"' failed.
0 vmjc 0x0000000000d24e1f
1 vmjc 0x0000000000d25334
2 libpthread.so.0 0x00002b398f36b8f0
3 libc.so.6 0x00002b3990178a75 gsignal + 53
4 libc.so.6 0x00002b399017c5c0 abort + 384
5 libc.so.6 0x00002b3990171941 __assert_fail + 241
6 vmjc 0x0000000000cd7fde llvm::PointerType::get(llvm::Type*, unsigned int) + 478
7 vmjc 0x0000000000564317 j3::J3Intrinsics::init(llvm::Module*) + 199
8 vmjc 0x000000000054f86d j3::JavaAOTCompiler::JavaAOTCompiler(std::string const&) + 1597
9 vmjc 0x0000000000502b8d main + 141
10 libc.so.6 0x00002b3990163c4d __libc_start_main + 253
11 vmjc 0x0000000000502a39
Aborted
make[2]: *** [all] Error 134
make[2]: Leaving directory `/home1/public/zakkak/java/vmkit_build/mmtk/java'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home1/public/zakkak/java/vmkit_build/mmtk'
make: *** [all] Error 1

any ideas, how to fix this?

Thank you
Foivos

Hi Fivos,

I cannot reproduce on my machine (ubuntu 64bit, clang/llvm/vmkit on svn trunk). What’s your configuration?

Cheers,
Nicolas

Hello,

after completing the build, i get

...
BUILD SUCCESSFUL
Total time: 5 seconds
llvm[2]: Building Release+Asserts mmtk-vmkit.jar all
vmjc: /home1/public/zakkak/llvm/lib/VMCore/Type.cpp:747: static
llvm::PointerType *llvm::PointerType::get(llvm::Type *, unsigned int):
Assertion `EltTy && "Can't get a pointer to <null> type!"' failed.
0 vmjc 0x0000000000d24e1f
1 vmjc 0x0000000000d25334
2 libpthread.so.0 0x00002b398f36b8f0
3 libc.so.6 0x00002b3990178a75 gsignal + 53
4 libc.so.6 0x00002b399017c5c0 abort + 384
5 libc.so.6 0x00002b3990171941 __assert_fail + 241
6 vmjc 0x0000000000cd7fde
llvm::PointerType::get(llvm::Type*, unsigned int) + 478
7 vmjc 0x0000000000564317
j3::J3Intrinsics::init(llvm::Module*) + 199
8 vmjc 0x000000000054f86d
j3::JavaAOTCompiler::JavaAOTCompiler(std::string const&) + 1597
9 vmjc 0x0000000000502b8d main + 141
10 libc.so.6 0x00002b3990163c4d __libc_start_main + 253
11 vmjc 0x0000000000502a39
Aborted
make[2]: *** [all] Error 134
make[2]: Leaving directory `/home1/public/zakkak/java/vmkit_build/mmtk/java'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home1/public/zakkak/java/vmkit_build/mmtk'
make: *** [all] Error 1

any ideas, how to fix this?

Thank you
Foivos

PS: sorry if you received this mail multiple times

Hi,

My machine is running Ubuntu server 64-bit
And the revision from the trunk is 158095 for llvm, clang and vmkit

llvm configuration
…/…/llvm/configure --enable-doxygen --enable-optimized --disable-jit
vmkit configuration
…/…/llvm/vmkit/configure --with-llvmsrc=/home1/public/zakkak/llvm/ --with-llvmobj=/home1/public/zakkak/java/llvm/ --with-gnu-classpath-glibj=/home1/public/zakkak/java/classpath-0.97.2/lib/glibj.zip --with-gnu-classpath-libs=/home1/public/zakkak/java/classpath-0.97.2/lib/

Thank you
Foivos

Hi Fovios,

Hi,

My machine is running Ubuntu server 64-bit
And the revision from the trunk is 158095 for llvm, clang and vmkit

llvm configuration
…/…/llvm/configure --enable-doxygen --enable-optimized --disable-jit

Why do you disable the JIT? VMKit needs it to compile MMTk.

Cheers,
Nicolas

Hi Nicolas,

I thought MMTk is written in java and it is compiled by javac.

retried a clean build with JIT enabled

llvm configuration
…/…/llvm/configure --enable-doxygen --enable-optimized --enable-jit

vmkit configuration
…/…/llvm/vmkit/configure --with-llvmsrc=/home1/public/zakkak/llvm/ --with-llvmobj=/home1/public/zakkak/java/llvm/ --with-gnu-classpath-glibj=/home1/public/zakkak/java/classpath-0.97.2/lib/glibj.zip–with-gnu-classpath-libs=/home1/public/zakkak/java/classpath-0.97.2/lib/

and the problem persists

Foivos

Hi Nicolas,

I thought MMTk is written in java and it is compiled by javac.

It is compiled by javac to produce Java bytecode. Then vmkit runs the initialization code of MMTk (through the JIT) and generates the binary code through llvm.

retried a clean build with JIT enabled

llvm configuration
…/…/llvm/configure --enable-doxygen --enable-optimized --enable-jit

vmkit configuration
…/…/llvm/vmkit/configure --with-llvmsrc=/home1/public/zakkak/llvm/ --with-llvmobj=/home1/public/zakkak/java/llvm/ --with-gnu-classpath-glibj=/home1/public/zakkak/java/classpath-0.97.2/lib/glibj.zip–with-gnu-classpath-libs=/home1/public/zakkak/java/classpath-0.97.2/lib/

and the problem persists

Could you do make ENABLE_OPTIMIZED=1 clean and then make ENABLE_OPTIMIZED=1 ? Some files may have not been generated because of the missing JIT and that screwed up the Makefile.

Nicolas

Still the same.

Is there any chance that the placement of my directories are causing this?

Also the exact command that fails is

/home1/public/zakkak/java/vmkit/Release+Asserts/bin/vmjc -std-compile-opts -load=/home1/public/zakkak/java/vmkit/Release+Asserts/lib/MMTKRuntime.so -load=/home1/public/zakkak/java/vmkit/Release+Asserts/lib/MMTKMagic.so -LowerMagic /home1/public/zakkak/java/vmkit/mmtk/java/mmtk-vmkit.jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o mmtk-vmkit.bc -Dmmtk.properties=/home1/public/zakkak/java/vmkit/../../llvm/vmkit/mmtk/java/vmkit.properties -disable-stubs -assume-compiled

Thank you for your time
Foivos

Hi Fovios,

Do you have a ./lib/j3/LLVMRuntime/LLVMRuntime.inc file being generated? What does it contain?

Nicolas

Hi Nicolas,

it looks like there are missing things

$ more lib/j3/LLVMRuntime/LLVMRuntime.inc
// Generated by llvm2cpp - DO NOT MODIFY!

Module* makeLLVMModuleContents(Module *mod) {

mod->setModuleIdentifier("<stdin>");

// Type Definitions

// Function Declarations

// Global Variable Declarations

// Constant Definitions

// Global Variable Definitions

// Function Definitions

return mod;

}

Foivos

Hi guys --

I'm having a similar problem with VMKit - the build fails at the same point as it does for Foivos, although my stack trace is different:

This is the error reported by the vmjc command:

Thread 0x110000000 received a SIGSEGV: either the VM code or an external
native method is bogus. Aborting...
0 vmjc 0x0000000000eb05ff
1 vmjc 0x0000000000eb0ae9
2 libpthread.so.0 0x000000393180ebe0
3 libc.so.6 0x0000003930830285 gsignal + 53
4 libc.so.6 0x0000003930831d30 abort + 272
5 vmjc 0x0000000000583cb7 ThrowNullPointerException + 71
6 vmjc 0x000000000050cf38 j3::JavaMethod::invokeIntSpecialAP(j3::Jnjvm*, j3::Class*, j3::JavaObject*, __va_list_tag*) + 56
7 vmjc 0x000000000050d715 j3::JavaMethod::invokeIntSpecial(j3::Jnjvm*, j3::Class*, j3::JavaObject*, ...) + 117
8 vmjc 0x0000000000524af8 j3::JavaObjectClass::getDeclaredConstructors(j3::JavaObjectClass*, bool) + 520
9 vmjc 0x0000000000530496 Java_java_lang_VMClass_getDeclaredConstructors + 38
10 vmjc 0x00007f3400e46a40 Java_java_lang_VMClass_getDeclaredConstructors + 139861324555728

This is the stack trace reported by gdb:

#0 0x000000000050cf37 in j3::JavaMethod::invokeIntSpecialAP(j3::Jnjvm*, j3::Class*, j3::JavaObject*, __va_list_tag*) ()
#1 0x000000000050d715 in j3::JavaMethod::invokeIntSpecial(j3::Jnjvm*, j3::Class*, j3::JavaObject*, ...) ()
#2 0x0000000000524af8 in j3::JavaObjectClass::getDeclaredConstructors(j3::JavaObjectClass*, bool) ()
#3 0x0000000000530496 in Java_java_lang_VMClass_getDeclaredConstructors ()
#4 0x00007ffff5fbaa40 in ?? ()
#5 0x00000001100fdf80 in ?? ()
#6 0x00007ffff5fba9fb in ?? ()
#7 0x0000000002147dd0 in ?? ()
#8 0x0000000000000000 in ?? ()

My LLVMRuntime.inc /does/ have a lot of stuff in the "// Type Definitions" and "// Function Declarations" sections (and nothing in the other sections).

This error occurs on a CentOS 5.8 system. llvm, clang, and vmkit are all being built from SVN (llvm and clang themselves were built with gcc 4.6.2). I've seen the same error on an OS X machine (10.7.3).

thanks!

-- Alex

Okay, well I figured out the problem that I was having - I was trying to build vmkit against classpath 0.99 instead of classpath 0.97.

thanks!

-- Alex

Hi Nicolas,

I finally found the root of the problem. Build was unable to locate llvm-build because it was looking for it in
path/to/vmkit_src/utils/llvm-build while it was located in path/to/llvm_src/utils/llvm-build

Actually llvm-build's path is defined by the path/to/llvm_src/Makefile.rules and looks like this
LLVMBuildTool := $(PROJ_SRC_ROOT)/utils/llvm-build/llvm-build
however in the case of vmkit it should be
LLVMBuildTool := $(LLVM_SRC_ROOT)/utils/llvm-build/llvm-build

i Also noticed that in the vmkit's generated (by configure) Makefile.config there are defined PROJ_SRC_ROOT and VMKIT_SRC_ROOT as well as PROJ_OBJ_ROOT and VMKIT_OBJ_ROOT. What should be the difference between PROJ_* and VMKIT_* paths? In my case they where equal (so what's the need for 2 different variables?)

I hope the first section will help you to create a patch
(i edited my Makefile.rules just before configuring vmkit to make it work)

Thank you
Foivos

Thanks Favios for finding the problem! I have applied a patch to Makefile.rules, hopefully it now works without you editing some files.

About VMKIT_SRC_ROOT and PROJ_SRC_ROOT, it is fine to have both in the code. I find it clearer to use VMKIT_SRC_ROOT.

Nicolas

Hi Nicolas,

thanks, it works fine :slight_smile:

Is there any manual/documentation available for vmkit?
Do you know if there is an easy way to completely disable JIT and interpret the code instead?

Foivos

Hi Foivos,

Hi Nicolas,

thanks, it works fine :slight_smile:

Is there any manual/documentation available for vmkit?

vmkit.llvm.org is all there is :slight_smile: Otherwise, you can find published papers on the website, but they’re not very verbose on how the engineering works.

Do you know if there is an easy way to completely disable JIT and interpret the code instead?

vmkit was built with JIT in mind, and I’m not sure the interpreter implements all of vmkit’s requirements. So I would say no, I don’t know of an easy way to just use the interpreter.

Nicolas