possible x86-64 assembler bug

Bug #1946009 reported by Douglas Katzman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
Undecided
Unassigned

Bug Description

Enabling both #+allocator-metrics and #+cons-profiling causes backpatching to fail:

#<THREAD "main thread" RUNNING {1001548143}>:
  The value
    137
  is not of type
    (SIGNED-BYTE 8)

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

((LAMBDA (SB-X86-64-ASM::SEGMENT SB-X86-64-ASM::POSN) :IN SB-X86-64-ASM::EMIT-BYTE-DISPLACEMENT-BACKPATCH) #<SB-ASSEM:SEGMENT {10015D4FF3}> 136)

Minimal input program:
(defun lll (&rest x) (declare (optimize (sb-c::instrument-consing 2))) x)

If I had to guess, the long-nop in the instrument-consing code is the problem, but that code has been in use for a very long time, so I don't see why it would choose now to go awry.

Revision history for this message
Douglas Katzman (dougk) wrote :

the cause is extra alignment, and use of JRCXZ in listify-rest-args. There is no 32-bit displacement form of JRCXZ. So this isn't an assembler bug, it's a misuse of the instruction.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.