GNU bug report logs - #74422
Wrong expected column number while backtracing?

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: Olivier Dion <odion@HIDDEN>; dated Mon, 18 Nov 2024 19:02:02 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Nov 2024 19:01:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 18 14:01:15 2024
Received: from localhost ([127.0.0.1]:35160 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tD6zq-0001Pj-Ox
	for submit <at> debbugs.gnu.org; Mon, 18 Nov 2024 14:01:15 -0500
Received: from lists.gnu.org ([209.51.188.17]:40888)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <odion@HIDDEN>) id 1tD6zn-0001Pb-VM
 for submit <at> debbugs.gnu.org; Mon, 18 Nov 2024 14:01:13 -0500
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 <odion@HIDDEN>)
 id 1tD6zl-0003B2-Uu
 for bug-guile@HIDDEN; Mon, 18 Nov 2024 14:01:11 -0500
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 <odion@HIDDEN>)
 id 1tD6zh-0006vU-NZ
 for bug-guile@HIDDEN; 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==
Received: from localhost (157-208-8-209.mc.derytele.com [157.208.8.209])
 by smtpout.efficios.com (Postfix) with ESMTPSA id 4XscR10JNGzN0k
 for <bug-guile@HIDDEN>; Mon, 18 Nov 2024 14:01:01 -0500 (EST)
From: Olivier Dion <odion@HIDDEN>
To: bug-guile@HIDDEN
Subject: Wrong expected column number while backtracing?
Organization: EfficiOS
Date: Mon, 18 Nov 2024 14:00:59 -0500
Message-ID: <87ldxg4b9w.fsf@laura>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2607:5300:203:b2ee::31e5;
 envelope-from=odion@HIDDEN; 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-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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





Acknowledgement sent to Olivier Dion <odion@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#74422; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.