[LLVMdev] process_root.

Tobias Nurmiranta spyck at lysator.liu.se
Wed Aug 18 11:54:00 PDT 2004


Hi,

This is regarding the backend for garbage collection. My problem might be
related to some strange memory fault created by my frontend, but I'll try
here to get some feedback.

For some strange reason I get segmentation fault in process_pointer in
semispace.c (I've implemented a small collector, hopefully :). The fault
occurs when I do:

 printf("process_root[0x%p] = 0x%p\n", (void*) Root, (void*) *Root);

I.e, when I reference Root.

My frontend creates llvm assembly with llvm-gcroot in the following
manner:

 ...
 %r22 = alloca uint ;; typetagged integers/pointers
 %r23 = cast uint* %r22 to sbyte**
 call void %llvm.gcroot(sbyte** %r23, sbyte* null)
 ...

So Root should be a valid pointer to the program stack. It traces two
roots before the segmentation fault.

Any ideas?

Btw, can I run llvm-db with llvm assembly as source language? Haven't
found any suitable flags.

regards,	Tobias


ps. I run my test like this:

llvm-as test.ll|opt -f -lowergc -o=test2.bc;llvm-link test2.bc
~/llvm/llvm/runtime/GC/SemiSpace/BytecodeObj/semispace.bc -f
-o=test3.bc;lli test3.bc

.ds




More information about the llvm-dev mailing list