unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Need help finding heap corruption bug
@ 2006-09-17 18:13 Pat Lasswell
  2006-09-18  8:27 ` Ludovic Courtès
  2006-09-23 11:18 ` Neil Jerram
  0 siblings, 2 replies; 8+ messages in thread
From: Pat Lasswell @ 2006-09-17 18:13 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1944 bytes --]

In guile 1.6.8 on an intel mac, I've encountered reliable heap corruption
with steps like the following

% guile
guile> (use-modules (project all))
guile> (set-current-module (resolve-module '(project foo)))
guile> (load "foo.scm")
==> segmentation fault

(project all) is a module that loads all of the prerequisites and submodules
(about 4k lines total) and exports symbols.  These steps happen in the
directory 'project' containing 'main.scm' and 'foo.scm'.

I have two questions.  Is there something intrinsically wrong with with
setting the current module to the one on which I am actively working and
then just reloading that file rather than the entire suite?  (I.e., there
are usually a lot of testing steps between the 'set-current-module' form and
the 'load' form; however, the steps above will always produce a crash.)


My second question is this: given that the answer to 1) is no, how do I
track this pest down?  Placing an undefined identifier, say 'x', at various
points in one of the modules will sometimes produce the appropriate warning,
sometimes produce a segfault, other times a bus error or illegal instruction
or even an abort during gc.  I have run attached to gdb, but I get a deep
stack (131 frames) ending with, e.g.

#0  scm_gc_sweep () at ../../../src/guile-1.6.8/libguile/gc.c:1729
#1  0x0021f573 in scm_igc (what=0x26c720 "cells") at ../../../src/guile-
1.6.8/libguile/gc.c:1161
#2  0x0021fa83 in scm_gc_for_newcell (master=0x273440, freelist=0x273438) at
../../../src/guile-1.6.8/libguile/gc.c:985
#3  0x00238aef in scm_cons (x=0x6826c0, y=0x2974) at ../../../src/guile-
1.6.8/libguile/pairs.c:84
#4  0x00216b87 in scm_deval (x=0xc3028, env=0x682480) at ../../../src/guile-
1.6.8/libguile/eval.c:2835
#5  0x00219af5 in scm_deval (x=0xc3030, env=0x682480) at ../../../src/guile-
1.6.8/libguile/eval.c:2819

Are there guile primitives to verify the heap?

_Any_ help would be appreciated.


Thanks in advance
pat

[-- Attachment #1.2: Type: text/html, Size: 2123 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-09-23 18:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-17 18:13 Need help finding heap corruption bug Pat Lasswell
2006-09-18  8:27 ` Ludovic Courtès
2006-09-18 14:24   ` Pat Lasswell
2006-09-18 15:08     ` Ludovic Courtès
2006-09-18 15:08     ` Pat Lasswell
2006-09-18 23:57       ` Kevin Ryde
2006-09-23 11:18 ` Neil Jerram
     [not found]   ` <ca8589e00609231109j36f07390i8fe88c8d0e396079@mail.gmail.com>
2006-09-23 18:10     ` Pat Lasswell

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).