* alloca, continuations and debug info
@ 2004-08-26 23:15 Neil Jerram
2004-08-27 0:07 ` Kevin Ryde
0 siblings, 1 reply; 3+ messages in thread
From: Neil Jerram @ 2004-08-26 23:15 UTC (permalink / raw)
I just traced a crash while displaying a backtrace to a build problem
whereby the alloca.c in libguile is unnecessarily picked up (on Windows
2000, which actually has alloca defined as a macro). And I was
wondering whether it would be better to remove libguile/alloca.c
altogether from the distribution.
The problem with the "portable" implementation of alloca in
libguile/alloca.c is that the memory which it allocates is not on the
stack. Therefore, if you capture a continuation while running the debug
evaluator, then invoke the continuation, then do something to cause a
backtrace, the scm_t_debug_info's are likely to be garbage because they
weren't properly saved and restored by the continuation code.
So on any platform which needs libguile/alloca.c - because that platform
doesn't have a proper alloca - Guile may crash. I therefore suggest
maybe removing libguile/alloca.c from the distribution, and considering
other options for the places where alloca is used:
- On platforms that have GCC but not alloca (if this is possible), Guile
could use GCC's ability to declare variable sized arrays on the stack
instead.
- Or if GCC not available, Guile could declare a constant sized array
for the scm_t_debug_info's.
- As a last resort, you could just say: no proper alloca, no Guile!
Regards,
Neil
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-09-08 15:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-26 23:15 alloca, continuations and debug info Neil Jerram
2004-08-27 0:07 ` Kevin Ryde
2004-09-08 15:12 ` Marius Vollmer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).