From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pat Lasswell" Newsgroups: gmane.lisp.guile.user Subject: Need help finding heap corruption bug Date: Sun, 17 Sep 2006 11:13:53 -0700 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0345945667==" X-Trace: sea.gmane.org 1158516844 15824 80.91.229.2 (17 Sep 2006 18:14:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 17 Sep 2006 18:14:04 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Sep 17 20:14:03 2006 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GP19W-0006IJ-FB for guile-user@m.gmane.org; Sun, 17 Sep 2006 20:14:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GP19U-0006Hl-Rf for guile-user@m.gmane.org; Sun, 17 Sep 2006 14:14:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GP19P-0006Hb-Oy for guile-user@gnu.org; Sun, 17 Sep 2006 14:13:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GP19O-0006H5-3k for guile-user@gnu.org; Sun, 17 Sep 2006 14:13:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GP19O-0006H2-0q for guile-user@gnu.org; Sun, 17 Sep 2006 14:13:54 -0400 Original-Received: from [64.233.166.177] (helo=py-out-1112.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GP1C3-0004yi-H2 for guile-user@gnu.org; Sun, 17 Sep 2006 14:16:39 -0400 Original-Received: by py-out-1112.google.com with SMTP id d42so3906881pyd for ; Sun, 17 Sep 2006 11:13:53 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=E4J3N8NNPinol1gUZPJCX/VbdxoeRK3CGE47C1vV6eN/7UZDRu1Iw3X+BUd9rhYdwaoz8D1Ui+eQcLChNUR7e8t85/77+uzg10pyQDgYn3oQPXtAP3SdWoYTT2HjaQdysdQSBFAPXZ7JsoADdZjmShl9jSg4HExfER/jEuhsDyg= Original-Received: by 10.35.93.1 with SMTP id v1mr21987678pyl; Sun, 17 Sep 2006 11:13:53 -0700 (PDT) Original-Received: by 10.35.57.14 with HTTP; Sun, 17 Sep 2006 11:13:52 -0700 (PDT) Original-To: guile-user@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:5514 Archived-At: --===============0345945667== Content-Type: multipart/alternative; boundary="----=_Part_66685_24169876.1158516833005" ------=_Part_66685_24169876.1158516833005 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_66685_24169876.1158516833005 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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
------=_Part_66685_24169876.1158516833005-- --===============0345945667== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user --===============0345945667==--