From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.bugs Subject: bug#11215: [feature request] better backtraces Date: Wed, 11 Apr 2012 00:11:31 +0100 Message-ID: <87r4vv18t8.fsf@googlemail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1334099586 32138 80.91.229.3 (10 Apr 2012 23:13:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 Apr 2012 23:13:06 +0000 (UTC) To: 11215@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Apr 11 01:13:05 2012 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SHkFE-00068L-ES for guile-bugs@m.gmane.org; Wed, 11 Apr 2012 01:13:04 +0200 Original-Received: from localhost ([::1]:48162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHkFD-0001q4-Lm for guile-bugs@m.gmane.org; Tue, 10 Apr 2012 19:13:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHkFA-0001pg-R7 for bug-guile@gnu.org; Tue, 10 Apr 2012 19:13:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHkF8-0000xq-Tw for bug-guile@gnu.org; Tue, 10 Apr 2012 19:13:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHkF8-0000xk-R1 for bug-guile@gnu.org; Tue, 10 Apr 2012 19:12:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SHkGA-0004BD-70 for bug-guile@gnu.org; Tue, 10 Apr 2012 19:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ian Price Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 10 Apr 2012 23:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11215 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.133409959916002 (code B ref -1); Tue, 10 Apr 2012 23:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Apr 2012 23:13:19 +0000 Original-Received: from localhost ([127.0.0.1]:49508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SHkFR-0004A1-Fw for submit@debbugs.gnu.org; Tue, 10 Apr 2012 19:13:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37413) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SHkFN-00049r-K5 for submit@debbugs.gnu.org; Tue, 10 Apr 2012 19:13:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHkEK-0000u2-47 for submit@debbugs.gnu.org; Tue, 10 Apr 2012 19:12:09 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:43845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHkEK-0000ty-0r for submit@debbugs.gnu.org; Tue, 10 Apr 2012 19:12:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHkEI-0001pE-5I for bug-guile@gnu.org; Tue, 10 Apr 2012 19:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHkEG-0000tY-4n for bug-guile@gnu.org; Tue, 10 Apr 2012 19:12:05 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:54735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHkEF-0000tS-Tq for bug-guile@gnu.org; Tue, 10 Apr 2012 19:12:04 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SHkE6-0005a9-W4 for bug-guile@gnu.org; Wed, 11 Apr 2012 01:11:55 +0200 Original-Received: from host86-151-72-82.range86-151.btcentralplus.com ([86.151.72.82]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Apr 2012 01:11:54 +0200 Original-Received: from ianprice90 by host86-151-72-82.range86-151.btcentralplus.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Apr 2012 01:11:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: host86-151-72-82.range86-151.btcentralplus.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:F/w2bDuek7aLgJQJ/GC5LA8uPE8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6288 Archived-At: This is more of a feature request/reminder, than a bug report, but we don't have a wish list so,.... Tail calls, we all love them, but sometimes they conflict with error handling, and is often used as the scapegoat for why $language doesn't support them. shizzy0 posted the following example and output to the #guile IRC channel (define (g) (error "This is broken because ~a" 1)) (g) ;; $ guile -q --debug test-error.scm ;; Backtrace: ;; In ice-9/boot-9.scm: ;; 149: 10 [catch #t # ...] ;; 157: 9 [#] ;; In unknown file: ;; ?: 8 [catch-closure] ;; In ice-9/boot-9.scm: ;; 63: 7 [call-with-prompt prompt0 ...] ;; In ice-9/eval.scm: ;; 407: 6 [eval # #] ;; In ice-9/boot-9.scm: ;; 2111: 5 [save-module-excursion #] ;; 3653: 4 [#] ;; 1380: 3 [%start-stack load-stack ...] ;; 1385: 2 [#] ;; In unknown file: ;; ?: 1 [primitive-load "/Users/shane/School/uvm/CSYS-395-evolutionary-robotics/bullet-2.79/Demos/GuileDemo/test-error.scm"] ;; ?: 0 [scm-error misc-error #f "~A ~S" ("This is broken because ~a" 1) #f] ;; ;; ERROR: In procedure scm-error: ;; ERROR: This is broken because ~a 1 One issue was that he wasn't auto compiling guile code, but there are two tail calls here. One is the obvious one, in g. And the other, which surprised me, was with respect to the main program itself. Thus we get the limited backtrace in an unknown file. It is possible to provide full backtraces, and source location for error messages with tail calls, though it's usually more work and requires overhead, but it's something to think about for the --debug engine at least. It would also be nice as a specific counterexample of an implementation in practice for all the tail call naysayers. :) -- Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"