[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Segfault when using readline and dynamically linked code
From: |
rm |
Subject: |
Re: Segfault when using readline and dynamically linked code |
Date: |
Sun, 7 Oct 2001 13:04:22 +0200 |
User-agent: |
Mutt/1.0.1i |
On Fri, Oct 05, 2001 at 08:29:04PM +0100, Neil Jerram wrote:
> >>>>> "ralf" == ralf <address@hidden> writes:
>
> ralf> Hello everyone, i just encountered a strange problem: i
> ralf> wrote some small wrapper code that creates guile bindings
> ralf> for some external library. Everything works fine (thank's
> ralf> for the nice documentation) _unless_ i activate readline
> ralf> support. As soon as i use the tab key guile segfaults.
> ralf> Using readline without my custom module works without any
> ralf> problems, so i assume the segfault is caused by my code. As
> ralf> a starting point i compiled guile and my module with
> ralf> debuging support, but the backtraces i get aren't very
> ralf> helpfull:
>
> ralf> smobs. Any pointers to where i might start looking?
>
> The backtrace shows the GC coming to a null pointer. My guess would
> be that you've written a SMOB mark function that is telling the GC to
> mark something that is actually NULL.
Thank you for our fast reply! Yes, that was indeed the case (as i figured
out after a bit more thinking and gdb-ing ...). I switched from 'heavy' smobs
(smobs containing references to other SCM values) to 'light' ones (where the
smob is just a wrapper arround a pointer to a C struct but missed to change
one of the smob-mark functions. Darn! Sorry for this unneccessary work :-/
Just out of curiosity: I find it rather interessting that the gc behaves
so different if readline is activated. I wasn't able to produce a coredump
without readline, even under heavy memory load.
Thanks again for your help (and the great work on guile)
Ralf Mattes