This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: How to solve a garbage collection problem ?
- To: Thierry Bezecourt <thbz at worldnet dot fr>
- Subject: Re: How to solve a garbage collection problem ?
- From: Michael Livshin <mlivshin at bigfoot dot com>
- Date: 09 Apr 2000 15:40:13 +0200
- Cc: guile at sourceware dot cygnus dot com
- Organization: who? me?
- References: <m2hfdbwgkc.fsf@worldnet.fr>
Thierry Bezecourt <thbz@worldnet.fr> writes:
> One of my programs produces the following error:
>
> ERROR: In procedure apply in expression (expat:parse parser13 line ...):
> ERROR: Wrong type argument in position 1: #<freed cell 0x402147b8; GC
> missed a reference>
>
> - Should I look into my Scheme code ? In other words, can Scheme code
> produce GC errors (assuming there is no bug in the garbage
> collector) ?
it shouldn't, unless you found a genuine Guile bug.
> - Should I look into the C extension this code is using ? In other
> words, can C extensions produce GC errors ?
that's the purpose of C extensions ;).
> what are the available techniques, if any, to track GC problems ?
if you feel completely lost, then the brute-force approach is to
configure Guile with --enable-debug-freelist, and putting
(gc-set-debug-check-freelist! #t)
into your .guile (or into your Scheme code if you run it
non-interactively).
this will GC before each cons, so it hopefully will help you get
closer to the source of your problem.
note: it also makes Guile painfully slow.
> Or do I have
> to read my source code again, line by line, and check that I always
> mark and free cells as indicated in data-rep.info ?
well, when all else fails...
--
Those who do not learn from history, loop.