Disassembling certain functions outputs the source filename to *DEBUG-IO*

Bug #1251861 reported by Lutz Euler on 2013-11-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

This is SBCL 1.1.13.47, x86-64 under Linux.

Disassembling a certain function unexpectedly outputs its source filename several times:

$ sh run-sbcl.sh --no-sysinit --no-userinit
(running SBCL from: .)
This is SBCL 1.1.13.47-b14a61c, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (require 'asdf)

("ASDF")
* (disassemble 'uiop/common-lisp::frob-substrings)

; file: SYS:CONTRIB;ASDF;ASDF.LISP.NEWEST

; file: SYS:CONTRIB;ASDF;ASDF.LISP.NEWEST

; file: SYS:CONTRIB;ASDF;ASDF.LISP.NEWEST

; file: SYS:CONTRIB;ASDF;ASDF.LISP.NEWEST

; file: SYS:CONTRIB;ASDF;ASDF.LISP.NEWEST

; file: SYS:CONTRIB;ASDF;ASDF.LISP.NEWEST
; disassembly for UIOP/COMMON-LISP::FROB-SUBSTRINGS
; Size: 727 bytes
; 02B75E56: 498B442450 MOV RAX, [R12+80] ; no-arg-parsing entry point
; 5E5B: 4883C010 ADD RAX, 16
[...]

It turns out that the "; file: ..." lines and the empty lines inbetween them are output to *DEBUG-IO*.

It seems that high debug optimization and eval-when (as seen in the source of frob-substrings) are needed to provoke this behaviour.

Reduced test case:

Put the following expression into a file, say "/tmp/f.lisp",

(eval-when (:load-toplevel :compile-toplevel :execute)
  (defun f ()
    (declare (optimize debug))))

then enter the following at the lisp prompt:

* (compile-file "/tmp/f.lisp")
[...]
* (load "/tmp/f.fasl")
[...]
* (disassemble 'f)

; file: /tmp/f.lisp
; disassembly for F
; Size: 72 bytes
; 04613254: 498B442450 MOV RAX, [R12+80] ; no-arg-parsing entry point
; 59: 4883C010 ADD RAX, 16
[...]

Here the filename is output only once, but nevertheless unexpectedly.

I have not tried to find out which of the three eval-when situations is/are needed.

Lutz Euler (lutz-euler) wrote :

This is a regression. Bisecting points to 1.0.57.7:

a6a12ed609d5467ec43b411283e5b3568fee81df is the first bad commit
commit a6a12ed609d5467ec43b411283e5b3568fee81df
Author: Nikodemus Siivola <email address hidden>
Date: Sat May 19 14:57:06 2012 +0300

    refactor GET-TOPLEVEL-FORM &co between debugger and disassembler

      * Merge the implementations in debug.lisp and target-disassembler.lisp.

      * Get rid of most of the cacheing.

      * Prefer the DEBUG-SOURCE-FORM if it exists: thanks to *SOURCE-NAMESTRING*
        we can have misleading namestrings for functions generated by calls to
        EVAL during LOAD, etc.

Note that 1.0.57.7 doesn't build. One needs to apply the change from 1.0.57.10 (77a1e282295a11dff7714bdb7ebce0bd786f6334) to be able to build it.

tags: added: regression
Stas Boukarev (stassats) wrote :

In 124d92dd8b420752bbf655b8d47bea0b0c8453e9.

Changed in sbcl:
status: New → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers