Regression in 2.1.11 - miscompilation

Bug #1954330 reported by Daniel Kochmański
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

After updating SBCL from opensuse repositories a regression in 2.1.11 is happening when running some McCLIM code. I've also recompiled SBCL from 2c6b8ff4cf70afd58a823d57370b8af158bf50d7 and the problem persists. @scymtym mentioned that he can't reproduce the problem on 4da4ae219.

The issue is happening with the following optimization settings:

(restrict-compiler-policy 'debug 3 3)
(restrict-compiler-policy 'speed 0 0)

The version of McCLIM is irrelevant.

Steps to reproduce:
1. (ql:quickload 'clim-examples)
2. (clim-demo:demodemo)
3. Start the "Logic Cube" demo (alternatively "File Manager" demo according to @scymtym)

Expected: a running demo
Observed: "Unhandled memory fault at #x5E8ECA8." or miscompiled results of some of internal functions.

I've tried to minimize the reproducible test case:
https://plaster.tymoon.eu/view/2768#2768

The minimized test case shows the problem with miscompiled result, but I didn't observe with it the unhandled memory fault. @Krystof and @scymtym were able to reproduce the issue.

Steps to reproduce:
1. compile-load the test-case.lisp file
2. (draw-logic-cube nil)

Expected: undefined function error (the last function is not defined)
Observed: error that one of values is not a vector (but they all should be 3-element vectors) in the function (backface-p camera-points), camera-points first element is some garbage number

Note: commenting out the form in the last line that is not executed due to the error in backface-p

(setf camera-points (qlc-...))

results in a different error, so something is propagated from there influencing the behavior.

I'm including a memory fault backtrace from the clim demo (not observed in the minimized test case)

Unhandled memory fault at #x85E8ECA8.
   [Condition of type SB-SYS:MEMORY-FAULT-ERROR]

Restarts:
 0: [ABORT] Return to application command loop.
 1: [ABORT] Return to application command loop.
 2: [RETRY] Retry SLIME REPL evaluation request.
 3: [*ABORT] Return to SLIME's top level.
 4: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {10015103A3}>)

Backtrace:
  0: (SB-PCL::CACHE-MISS-VALUES #<STANDARD-GENERIC-FUNCTION SB-SEQUENCE:MAKE-SEQUENCE-ITERATOR (4)> #<error printing CONS {10104E5437}> SB-PCL::ACCESSOR)
  1: (SB-PCL::INITIAL-DFUN #<STANDARD-GENERIC-FUNCTION SB-SEQUENCE:MAKE-SEQUENCE-ITERATOR (4)> #<error printing CONS {10104E5437}>)
  2: (SB-IMPL::%MAP-FOR-EFFECT #<FUNCTION (FLET SB-IMPL::F :IN SB-IMPL::%MAP-TO-VECTOR) {10104E541B}> #<error printing CONS {7F571A4E1817}>)
  3: (SB-KERNEL:%MAP VECTOR #<FUNCTION -> #<error printing object> (#(-0.6666667 -0.6666667 1.5) #(-0.4 -0.6666667 1.5) #(-0.4 -0.4 1.5) #(-0.6666667 -0.4 1.5)))
  4: (SB-KERNEL:%MAP VECTOR #<FUNCTION -> #<error printing object> (#(-0.6666667 -0.6666667 1.5) #(-0.4 -0.6666667 1.5) #(-0.4 -0.4 1.5) #(-0.6666667 -0.4 1.5))) [more]
  5: (CLIM-DEMO::LC-V- #<error printing object> (#(-0.6666667 -0.6666667 1.5) #(-0.4 -0.6666667 1.5) #(-0.4 -0.4 1.5) #(-0.6666667 -0.4 1.5)))
  6: (CLIM-DEMO::LC-FACE-NORMAL #<error printing CONS {10104E5087}>)
  7: (CLIM-DEMO::BACKFACE-P #<error printing CONS {10104E5087}>)

jack@localhost:~> sbcl --version
SBCL 2.1.11.67-2c6b8ff4c
jack@localhost:~> uname -a
Linux localhost.localdomain 5.15.6-1-default #1 SMP Wed Dec 1 08:32:12 UTC 2021 (c2ce213) x86_64 x86_64 x86_64 GNU/Linux
jack@localhost:~> sbcl
This is SBCL 2.1.11.67-2c6b8ff4c, 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.
* *features*
(:QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :X86-64 :GENCGC :64-BIT :ANSI-CL
 :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN
 :PACKAGE-LOCAL-NICKNAMES :SB-LDB :SB-PACKAGE-LOCKS :SB-THREAD :SB-UNICODE
 :SBCL :UNIX)
*

Revision history for this message
Daniel Kochmański (jackdaniel) wrote :
Stas Boukarev (stassats)
Changed in sbcl:
status: New → Fix Committed
Revision history for this message
Daniel Kochmański (jackdaniel) wrote :

I've verified that the fix works here too, thank you.

Changed in sbcl:
status: Fix Committed → Confirmed
status: Confirmed → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
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.