From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.user Subject: Re: debugging guile test failure and segfault. Date: Thu, 07 Jun 2007 10:57:40 +0200 Organization: LAAS-CNRS Message-ID: <87myzcw397.fsf@laas.fr> References: <46644283.2070003@mtl.mit.edu> <87myzd4hj5.fsf@laas.fr> <46679313.6070100@mtl.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181206678 15437 80.91.229.12 (7 Jun 2007 08:57:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Jun 2007 08:57:58 +0000 (UTC) Cc: guile-user To: mcmahill@mtl.mit.edu Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Jun 07 10:57:57 2007 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.50) id 1HwDoZ-0004Fg-CL for guile-user@m.gmane.org; Thu, 07 Jun 2007 10:57:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HwDoX-0002jw-TV for guile-user@m.gmane.org; Thu, 07 Jun 2007 04:57:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HwDoT-0002gn-Ga for guile-user@gnu.org; Thu, 07 Jun 2007 04:57:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HwDoR-0002ff-Sv for guile-user@gnu.org; Thu, 07 Jun 2007 04:57:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HwDoR-0002fX-OJ for guile-user@gnu.org; Thu, 07 Jun 2007 04:57:47 -0400 Original-Received: from laas.laas.fr ([140.93.0.15]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HwDoP-0003n9-Li for guile-user@gnu.org; Thu, 07 Jun 2007 04:57:46 -0400 Original-Received: from messiaen.laas.fr (messiaen [IPv6:2001:660:6602:0:230:65ff:fed4:9d20]) by laas.laas.fr (8.13.8/8.13.8) with SMTP id l578vYDm002229; Thu, 7 Jun 2007 10:57:34 +0200 (MEST) Original-Received: by messiaen.laas.fr (sSMTP sendmail emulation); Thu, 07 Jun 2007 10:57:40 +0200 X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 19 Prairial an 215 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: mcmahill@mtl.mit.edu, guile-user In-Reply-To: <46679313.6070100@mtl.mit.edu> (Dan McMahill's message of "Thu, 07 Jun 2007 01:09:39 -0400") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Spam-Score: -0.001 () NO_RELAYS X-Scanned-By: MIMEDefang at CNRS-LAAS on IPv6:2001:660:6602::2 X-detected-kernel: Solaris 10 (beta) 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:5970 Archived-At: Hi, Dan McMahill writes: > a back trace showed that around line 834 of libguile/posix.c there is > a call to ttyname() which is returning NULL. Unfortunately that NULL > pointer is used a few lines later by some functions which try to run > strlen() on it. Thats where the segfault is. Good catch! I committed a patch similar to yours along with a test case in CVS. > Running r4rs.test > ERROR: In procedure ttyname: > ERROR: No such file or directory I can't see what's causing this in `r4rs.test'. Could you try running that test from the prompt and enter the debugger when the error is raised so that we get a Scheme stack trace? Roughly: $ ./pre-inst-guile guile> (module-set! (resolve-module '(test-suite guile-test)) 'test-suite \"$PWD/test-suite/tests\") guile> (module-set! (resolve-module '(test-suite guile-test)) 'tmp-dir "/tmp\) guile> (load "test-suite/tests/r4rs.test") [...] ERROR: ... guile> (debug) debug> bt > Running regexp.test > Segmentation fault (core dumped) > > > #0 0x00000001600d6bb4 in scm_is_pair (x=0x10001202cbd60) at inline.h:272 > #1 0x0000000160086434 in scm_sloppy_assq (key=0x1200673a0, > alist=0x10001202cbd60) at alist.c:53 > #2 0x00000001600d2a58 in scm_hash_fn_get_handle (table=0x120321ac0, > obj=0x1200673a0, hash_fn=0x1600d15ec , > assoc_fn=0x160086408 , closure=0x0) at hashtab.c:428 > #3 0x00000001600d2e20 in scm_hash_fn_ref (table=0x12009aba0, > obj=0x1200673a0, dflt=0x4, hash_fn=0x1600d15ec , > assoc_fn=0x160086408 , closure=0x0) at hashtab.c:500 > #4 0x00000001600d3304 in scm_hashq_ref (table=0x12009aba0, > key=0x1200673a0, dflt=0x4) at hashtab.c:613 > #5 0x00000001600dc904 in module_variable (module=0x12009ab40, > sym=0x1200673a0) at modules.c:289 > #6 0x00000001600dcabc in scm_eval_closure_lookup (eclo=0x1200f56d0, > sym=0x1200673a0, definep=0x4) at modules.c:337 > #7 0x00000001600dcf38 in scm_sym2var (sym=0x1200673a0, > proc=0x1200f56d0, definep=0x4) at modules.c:461 > #8 0x00000001600a2d6c in scm_lookupcar1 (vloc=0x12071b1e0, > genv=0x120228620, check=1) at eval.c:2861 > #9 0x00000001600a73b0 in ceval (x=0x12071b1e0, env=0x120228620) at > eval.c:4027 > #10 0x00000001600a4d54 in ceval (x=0x1202286d0, env=0x120228620) at > eval.c:3557 > #11 0x00000001600a3cb4 in ceval (x=0x12071adc0, env=0x12071aa10) at > eval.c:3384 > #12 0x00000001600aa168 in scm_apply (proc=0x1201522c0, arg1=0x404, > args=0x12071aa30) at eval.c:4997 > #13 0x00000001600a90b0 in scm_call_0 (proc=0x12071aaa0) at eval.c:4651 This one is certainly trickier. The stack trace above is that of a variable lookup (i.e., not related to regexps). Can you try running `regexp.test' alone just to make sure? Address X is 8-byte aligned, which corresponds to a non-immediate. Could you try printing (from the debugger) `* ((SCM *) x)' and `* ((SCM *) x + 1)'? I'm afraid it'll be quite hard to find out what's going wrong... Thanks for debugging! Ludovic. _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user