From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter TB Brett Newsgroups: gmane.lisp.guile.user Subject: Re: Help needed debugging segfault with Guile 1.8.7 Date: Tue, 30 Nov 2010 19:43:55 +0000 Message-ID: References: <871v6sqbny.fsf@ambire.localdomain> <8739ql38pe.fsf@ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1291192904 25746 80.91.229.12 (1 Dec 2010 08:41:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 1 Dec 2010 08:41:44 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Dec 01 09:41:40 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PNiFv-0006Ro-A4 for guile-user@m.gmane.org; Wed, 01 Dec 2010 09:41:40 +0100 Original-Received: from localhost ([127.0.0.1]:41695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNiFu-00022H-Fq for guile-user@m.gmane.org; Wed, 01 Dec 2010 03:41:38 -0500 Original-Received: from [140.186.70.92] (port=47423 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNdm6-00041T-Pv for guile-user@gnu.org; Tue, 30 Nov 2010 22:54:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNW70-0005jW-9W for guile-user@gnu.org; Tue, 30 Nov 2010 14:43:39 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:43268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNW6z-0005bm-VR for guile-user@gnu.org; Tue, 30 Nov 2010 14:43:38 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PNW6v-0005vb-Nw for guile-user@gnu.org; Tue, 30 Nov 2010 20:43:33 +0100 Original-Received: from 109.170.137.199 ([109.170.137.199]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Nov 2010 20:43:33 +0100 Original-Received: from peter by 109.170.137.199 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Nov 2010 20:43:33 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Followup-To: gmane.lisp.guile.user Original-Lines: 69 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 109.170.137.199 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:lvFRKXtflO/UiQiqk7XOZHOOZ+4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:8253 Archived-At: --=-=-= Content-Transfer-Encoding: quoted-printable Neil Jerram writes: > [snip] > > I think your design is similar to what is outlined in the `Extending > Dia' node of the Guile manual. Were you aware of that doc before > working out your design? If not, I guess we need to make it more > prominent. If yes, I'd appreciate any suggestions you have for how it > may be improved. I wasn't aware of that document, despite using the Guile Manual every day! Could I please suggest that filing it under "Programming Overview" probably isn't the best place for it? I think it should be highlighted that adding a Guile-specific field to dia_shape (or its equivalent) may not always be possible, e.g. if Guile is just one of several language bindings. >> So, where was the bug? When a smob is GC'd, and if the pointer it >> contains hasn't already been cleared, [...] > > Now that you've successfully debugged this, is there any general > advice that you would offer for "how to investigate a free list > corruption?" I would guess not, as corruption is fundamentally a > general thing and has infinite possible causes - but perhaps I'm > missing something. One thing that would have been *AWESOME* is if Guile 1.8.x's GC had used the macros defined in Valgrind's `memcheck.h' (which is BSD licensed IIRC). It would make running programs with libguile under Valgrind so much more useful, and would have *instantly* highlighted what was going wrong with my code -- it would probably have saved me a couple of days of beating my head against what turned out to be a really simple bug. (There's literally no runtime overhead if a program's not being run under Valgrind). >> I hope that explained things reasonably precisely! > > Thank you, it certainly did. To conclude, I'll just note that in the > Guile 2.0 future we won't have such difficult problems, because of > using libgc - which will automatically find active references anywhere > in the whole application. (And of course I understand that your code > still needs to work with Guile 1.8.x now.) Thanks for the info. Judging by previous experience, gEDA will need to support Guile 1.8.x for at least two years after Guile 2.x arrives. It's probably going to be painful. :-/ Peter =2D-=20 Peter Brett Remote Sensing Research Group Surrey Space Centre --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAkz1U/sACgkQZ7Gbq7g7vpriGgCfaBZgzSYqPVBDAyhV+R1U6c1j QDcAnRhzLiIXSRHhjv+qMBzf2ILNJqUJ =kh2w -----END PGP SIGNATURE----- --=-=-=--