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: How to solve a garbage collection problem ?



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.

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