This is the mail archive of the guile@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]

SCM type as union (Re: G-wrap to help with translations)


> It took me about twice
> as long as I expected to get this to work; I'd suggest that Guile needs
> better error checking -- several times I absent-mindedly did something
> like gh_define("var",0).  The result is a seg fault in Guile's GC with
> no obvious way to trace back to the offending line of code.

See? It's not just me that it happens to... another argument for
the SCM type to be a union rather than an unguarded long.

	- Tel

> was gh_scm2int(gh_lookup("mistyped-name")) -> segfault with a stack
> trace that had only the Guile top-level (no indication of where the
> problem was).  Snd has about 68000 lines of C, so a bug with no stack
> trace is a real annoyance!

Run it inside gdb and it grabs the segfault. The guile library compiles
with debugging symbols (and -O2 which can confuse debugging at times)
so you can generally up up up to the stack frame in your program that
caused the problem. You might have to link with blah/libguile/.libs/libguile.a
rather than the dynamic library I don't know all the tricks with gdb
and tracing through dynamic libraries.

> Also the docs are not very useful -- I
> now just read the code, and ignore the documentation.

So I'm not the only one who does this either... <grin>

	- Tel