From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.user Subject: Re: Where is the backtrace? Date: Fri, 03 Jan 2014 13:03:46 -0500 Message-ID: <87a9fd0wot.fsf@netris.org> References: <87d2k9e4va.fsf@Kagami.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388772382 1104 80.91.229.3 (3 Jan 2014 18:06:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jan 2014 18:06:22 +0000 (UTC) Cc: "guile-user@gnu.org" To: Panicz Maciej Godek Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jan 03 19:06:27 2014 Return-path: Envelope-to: guile-user@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 1Vz98c-0006an-NL for guile-user@m.gmane.org; Fri, 03 Jan 2014 19:06:26 +0100 Original-Received: from localhost ([::1]:51115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz98c-0005wH-7d for guile-user@m.gmane.org; Fri, 03 Jan 2014 13:06:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz98K-0005nL-36 for guile-user@gnu.org; Fri, 03 Jan 2014 13:06:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz98B-0002tJ-FK for guile-user@gnu.org; Fri, 03 Jan 2014 13:06:08 -0500 Original-Received: from world.peace.net ([96.39.62.75]:37023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz98B-0002r3-CO for guile-user@gnu.org; Fri, 03 Jan 2014 13:05:59 -0500 Original-Received: from 209-6-197-194.c3-0.smr-ubr2.sbo-smr.ma.cable.rcn.com ([209.6.197.194] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Vz97t-0005lJ-9q; Fri, 03 Jan 2014 13:05:41 -0500 In-Reply-To: (Panicz Maciej Godek's message of "Fri, 3 Jan 2014 14:57:33 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10961 Archived-At: Panicz Maciej Godek writes: > I've checked this with other implementations. Racket, Gambit and Biwa > Scheme were equally uninformative. Kawa's backtrace was a nightmare to > me, but perhaps someone with more knowledge would be able to infer the > actual location of the error. Actually, the only implementation that > exposed the exact location was Chicken. It proves that there must be a > way to track this information in spite of TCO. I suspect the reason Chicken kept the information is that in Chicken, IIUC, tail calls are just normal C function calls, so the stack fills until it reaches a certain size and then is garbage collected. The solution I favor is that of MIT Scheme, which records the backtrace as a chain of rings. Each time a tail call is done, an entry is recorded in the topmost ring, so between every two non-tail calls, up to N tail calls are preserved. If more than N tail calls are done in a row, then the older ones are forgotten. Hopefully we'll have this for Guile some day. Mark