From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Christopher Allan Webber Newsgroups: gmane.lisp.guile.bugs Subject: bug#26662: Setting break on find-tail breaks the repl Date: Tue, 25 Apr 2017 22:36:23 -0500 Message-ID: <87wpa7u9fs.fsf@dustycloud.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1493178692 15754 195.159.176.226 (26 Apr 2017 03:51:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Apr 2017 03:51:32 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.2.1 To: 26662@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Apr 26 05:51:27 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3DzC-0003uP-Vs for guile-bugs@m.gmane.org; Wed, 26 Apr 2017 05:51:27 +0200 Original-Received: from localhost ([::1]:52500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3DzG-0007bC-V1 for guile-bugs@m.gmane.org; Tue, 25 Apr 2017 23:51:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3DlK-0004kr-5p for bug-guile@gnu.org; Tue, 25 Apr 2017 23:37:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3DlH-0002FM-1Y for bug-guile@gnu.org; Tue, 25 Apr 2017 23:37:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42182) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d3DlG-0002FH-UJ for bug-guile@gnu.org; Tue, 25 Apr 2017 23:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d3DlG-0000K8-Lf for bug-guile@gnu.org; Tue, 25 Apr 2017 23:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christopher Allan Webber Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 26 Apr 2017 03:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26662 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14931778001199 (code B ref -1); Wed, 26 Apr 2017 03:37:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Apr 2017 03:36:40 +0000 Original-Received: from localhost ([127.0.0.1]:40381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3Dku-0000JG-1D for submit@debbugs.gnu.org; Tue, 25 Apr 2017 23:36:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53048) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3Dkt-0000J2-27 for submit@debbugs.gnu.org; Tue, 25 Apr 2017 23:36:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3Dkm-00026N-Hd for submit@debbugs.gnu.org; Tue, 25 Apr 2017 23:36:33 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57389) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3Dkm-00026J-Eb for submit@debbugs.gnu.org; Tue, 25 Apr 2017 23:36:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3Dkl-00049k-8p for bug-guile@gnu.org; Tue, 25 Apr 2017 23:36:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3Dki-00024h-4N for bug-guile@gnu.org; Tue, 25 Apr 2017 23:36:31 -0400 Original-Received: from dustycloud.org ([50.116.34.160]:56142) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3Dkh-00023g-Us for bug-guile@gnu.org; Tue, 25 Apr 2017 23:36:28 -0400 Original-Received: from oolong (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id D5D20265EE for ; Tue, 25 Apr 2017 23:36:23 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8791 Archived-At: --=-=-= Content-Type: text/plain Setting a break on find-tail breaks everything at the repl: scheme@(guile-user)> ,break find-tail Trap 2: Breakpoint at #. scheme@(guile-user)> (+ 1 2 3) system/vm/traps.scm:127:31: system/vm/traps.scm:127:31: In procedure <: Wrong type: #f Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> ,bt In system/repl/repl.scm: 158:22 3 (_) In unknown file: 2 (_) In system/vm/traps.scm: 141:10 1 (apply-hook #) 127:31 0 (_ _) scheme@(guile-user) [1]> Not sure why, doesn't seem to happen with some other methods I've tried... doesn't happen with map for instance. I do have a patch, though I don't entirely understand what's going on. Here's the relevant snippet of code: (define (frame-matcher proc) ;; [...] (let ((start (program-code proc)) (end (program-last-ip proc))) (lambda (frame) (let ((ip (frame-instruction-pointer frame))) (and start end (<= start ip) (< ip end)))))) For some reason, `end' was #f in this scenario, which is how things broke. Well, patch attached! --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-frame-matcher-for-when-nothing-is-found-for-prog.patch >From 6bd0e814801d17df04ef23480647792480c08c26 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Tue, 25 Apr 2017 22:28:09 -0500 Subject: [PATCH] Fix frame-matcher for when nothing is found for program-last-ip. * module/system/vm/traps.scm (frame-matcher): Check for end before we compare it to anything, since it might be #f. --- module/system/vm/traps.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/system/vm/traps.scm b/module/system/vm/traps.scm index c4861c925..43a067a76 100644 --- a/module/system/vm/traps.scm +++ b/module/system/vm/traps.scm @@ -124,7 +124,7 @@ (end (program-last-ip proc))) (lambda (frame) (let ((ip (frame-instruction-pointer frame))) - (and (<= start ip) (< ip end)))))) + (and end (<= start ip) (< ip end)))))) ((struct? proc) (frame-matcher (procedure proc))) (else -- 2.12.2 --=-=-=--