This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Why does the GC frees my function?


Miroslav Silovic <silovic@zesoi.fer.hr> a écrit :

> > Hum, I didn't found any function named scm_gc_protect. I tried with
> > other function like scm_gc_mark ou scm_object_protect but it doesn't
> > work.
> 
> scm_protect_object.

I allready tried this one and it doesn't work. It seems that the
problem is not my hook but the lambda function added to it. As a
matter of fact, it seems that init_hook is not freed:

107       run_hook1 (init_hook, version); 
(gdb) p *init_hook
$5 = 66943
(gdb) n
ERROR: In procedure string-append:
ERROR: Wrong type argument: #<freed cell 0x401946b8; GC missed a reference>

(add-hook! init
 	   (lambda (str)
	     (display
	      (string-append "Welcome to " str ".\n"))))

One of the operand of string-append is freed?
 
> It's in prefix/include/libguile/gc.h (reading headers is your friend :) )

Believe me, i've spent lots of time reading it :-)

-- 
ps: pour prouver que j'ai rien contre nos amies les linuxiennes je leur
fais un enormeeee bisou ;o)
-+- Daniel in Guide du linuxien pervers - "Le linuxien nouveau est arrivé"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]