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
On Wed, 2004-08-18 at 11:54, Tobias Nurmiranta wrote:> 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.Okay. I'm not an expert on GC but I'll take a look ...> 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.I don't know what "Root" is but possibly the %p substitution with "*Root" isn't valid.> 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.Well, Root may be valid, but combining "%p" with *Root probably isn't.> Any ideas? > > Btw, can I run llvm-db with llvm assembly as source language?Yes, but you'd have to manually insert the debugging support information which would be tedious. You'd be better off doing something like writing a debug info insertion pass and applying it to the Module. This way you can use llvmAsmParser to get a module, apply the pass and then the bcwriter to create the bytecode with the debug info in it. Reid -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040818/94211baa/attachment.sig>
On Wed, 18 Aug 2004, Reid Spencer wrote:> On Wed, 2004-08-18 at 11:54, Tobias Nurmiranta wrote: > > Okay. I'm not an expert on GC but I'll take a look ...Thanks :)> > > 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. > > I don't know what "Root" is but possibly the %p substitution with > "*Root" isn't valid.Hmm, ok, that was in the file when I checked it out from the cvs. The point is that is crashes when using *Root, no matter how, even when not using it in the printf. , Tobias