From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Olivier Dion Newsgroups: gmane.lisp.guile.bugs Subject: bug#74422: Wrong expected column number while backtracing? Date: Mon, 18 Nov 2024 14:00:59 -0500 Organization: EfficiOS Message-ID: <87ldxg4b9w.fsf@laura> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5337"; mail-complaints-to="usenet@ciao.gmane.io" To: 74422@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Mon Nov 18 20:02:34 2024 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tD717-0001Fy-6Z for guile-bugs@m.gmane-mx.org; Mon, 18 Nov 2024 20:02:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tD70g-0003De-5R; Mon, 18 Nov 2024 14:02:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tD70d-0003D8-Bs for bug-guile@gnu.org; Mon, 18 Nov 2024 14:02:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tD70d-0006xf-2x for bug-guile@gnu.org; Mon, 18 Nov 2024 14:02:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=J07iAOzxPj9MtnlD1mBs2uFUA83IHOL97OXuNEuvmhM=; b=NByvgIiAPCqeFVxb3lD4nTWi5mHolwe45qA0rD10kFWgCp6z//Pt5b/+YbSQ7ZS16FYFJz3AQC+/NdYo6b0jYhlesziQeBsmdbVlx0JJBH7n4gf8EO7pTeiTwlL2BqfZwwTDf1CpMaXbcnR6yHUxyBey8vix2S+r/w9dHDX5BsvwbwRuz8OkKtsdf2nZXCQDWp50nBcEgwSRdRnlj9VSOVon7aU2Yqvb4bwcQBnOb2AYoS5zW8vUb7xcMSdSMrLLuqb+rthdQJpakdp3rawZjJ/iDRiB9R5mR1CHHtgDbRSh1HiSq7fE1S//Uc2+evTfaednNUFvHEgKcq4Li0+tzA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tD70c-0001R3-IF for bug-guile@gnu.org; Mon, 18 Nov 2024 14:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Olivier Dion Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 18 Nov 2024 19:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74422 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17319564755446 (code B ref -1); Mon, 18 Nov 2024 19:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Nov 2024 19:01:15 +0000 Original-Received: from localhost ([127.0.0.1]:35160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tD6zq-0001Pj-Ox for submit@debbugs.gnu.org; Mon, 18 Nov 2024 14:01:15 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tD6zn-0001Pb-VM for submit@debbugs.gnu.org; Mon, 18 Nov 2024 14:01:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tD6zl-0003B2-Uu for bug-guile@gnu.org; Mon, 18 Nov 2024 14:01:11 -0500 Original-Received: from smtpout.efficios.com ([2607:5300:203:b2ee::31e5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tD6zh-0006vU-NZ for bug-guile@gnu.org; Mon, 18 Nov 2024 14:01:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1731956461; bh=2DROXrMY4WsPo5vwc7ohNNSVsGhVcb+QVQ2iFKA1eRw=; h=From:To:Subject:Date:From; b=stCTjU66fZ34tFIIgVZMxbcvMzz7v8bam1UO7/sBWL+OxgSeDJk7L/QVJhW0ntmUY iihCnECCuwMR5Pkrlvm4zibaxmlw1+Ad7xiiSRgCly/YER3K7Grcvn23c9K9XUSPQO W7bbV5MHZJQxbylj4tEB27hENLzAaXoL4GzC5rxKd+b0MuUzitzXNAtGajV4QIvLn1 /EZE6Viq4Hc0gvgo3RSsiVtB58WskxbdYHwxAmcmY9/Lmx6rwT3uhGTJuV8Q1Cuft3 2mrjLPx+eumNZK75G3AvlYHDyDSFvA6yByXrSA6Grn0xCKRSfU1tpf89P7iQ1gDCpv nAeebP2qIBK8w== Original-Received: from localhost (157-208-8-209.mc.derytele.com [157.208.8.209]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4XscR10JNGzN0k for ; Mon, 18 Nov 2024 14:01:01 -0500 (EST) Received-SPF: pass client-ip=2607:5300:203:b2ee::31e5; envelope-from=odion@efficios.com; helo=smtpout.efficios.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:11103 Archived-At: Hi, Sometime, the printed backtrace from Guile gives wrong column numbers. This seems to happen when referencing free variables. Here is a dummy example that represents the problem: --8<---------------cut here---------------start------------->8--- ;; test.scm (use-modules (foo)) (define (main _) (foo)) ;; foo.scm (define-module (foo) #:use-module (system vm debug) #:use-module (system vm frame) #:use-module (system vm program) #:export (foo)) (define (bar) (lambda () (throw 'bar))) (define (foo) (catch #t (bar) (const #f) (lambda _ (let ((stack (make-stack #t))) (let lp ((frame (stack-ref stack 0))) (when frame (let ((source (frame-source frame))) (pk (and=> source source:file) (and=> source source:line-for-user) (and=> source source:column))) (lp (frame-previous frame)))))))) --8<---------------cut here---------------end--------------->8--- Then `guile -L . -e main -s test.scm: ;;; note: source file ./foo.scm ;;; newer than compiled /home/old/.cache/guile/ccache/3.0-LE-8-4.6/home/old/foo.scm.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling ./foo.scm ;;; compiled /home/old/.cache/guile/ccache/3.0-LE-8-4.6/home/old/foo.scm.go ;;; (#f #f #f) ;;; ("foo.scm" 15 20) ;;; ("ice-9/boot-9.scm" 1780 13) ;;; ("ice-9/boot-9.scm" 1685 16) ;;; ("foo.scm" 8 13) ;;; ("ice-9/boot-9.scm" 1752 10) ;;; ("ice-9/boot-9.scm" 1747 15) ;;; ("ice-9/eval.scm" 619 8) ;;; ("ice-9/boot-9.scm" 724 2) ;;; (#f #f #f) ;;; ("ice-9/boot-9.scm" 1752 10) See how the columns for foo.scm are weird: foo.scm:15:20: (let ((stack (make-stack #t))) ^ foo.scm:8:13: (lambda () (throw 'bar))) ^ When I would have expected the following: foo.scm:15:20: (let ((stack (make-stack #t))) ^ foo.scm:8:13: (lambda () (throw 'bar))) ^ Thanks, Olivier -- Olivier Dion EfficiOS Inc. https://www.efficios.com