SB-C::REPACK-XREF breaks on an aref with an invalid index
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
it happens only sometimes, probably depends on the actual code/symbols loaded.
SBCL is HEAD as of today: 98ae2f63f69fea4
SAVE-LISP-AND-DIE calls SB-C::REPACK-XREF, it breaks into the debugger with an error, i started a swank server, and in this state i can even reproduce it from a slime repl by calling it by hand with:
(SB-C::REPACK-XREF :COMPACT-NAME-COUNT 256 :VERBOSE NIL)
the actual access is this line (inside the lambda returned by index->name):
(aref vector (+ index 1 (- common-count)))
either VECTOR is not what it should be, or it's accessed with the wrong assumptions. maybe using typed structures, or explicit accessor functions would help avoiding this, or at least debugging such errors.
Invalid index 257 for (SIMPLE-VECTOR 2), should be a non-negative integer below 2.
[Condition of type SB-INT:
Restarts:
2: RETRY Retry SLIME REPL evaluation request.
1: *ABORT Return to SLIME's top level.
0: ABORT abort thread (#<THREAD "repl-thread" RUNNING {1004D8FFA3}>)
Backtrace:
0: ((SB-IMPL:
1: ((LAMBDA (SB-INT:INDEX) :IN SB-C::INDEX->NAME) 256)
Locals:
VECTOR = #(#(9 3 1 128 18) SWANK-REPL:
2: (SB-C::
Locals:
DECODER = #<CLOSURE (LAMBDA (INTEGER) :IN SB-C::INDEX-
FUNCTION = #<CLOSURE (LAMBDA (SB-C::KIND SB-C::NAME NUMBER) :IN SB-C::REPACK-XREF) {1003FD02AB}>
FUNCTION#1 = #<CLOSURE (LAMBDA (SB-C::KIND SB-C::NAME NUMBER) :IN SB-C::REPACK-XREF) {1003FD02AB}>
INDEX = 256
KIND = :CALLS
KIND-NUMBER = 1
LOOKUP = #<CLOSURE (LAMBDA (SB-INT:INDEX) :IN SB-C::INDEX->NAME) {1003FD02DB}>
NUMBER = 4
OFFSET = 5
PACKED = #(9 3 1 128 18)
XREF-DATA = #(#(9 3 1 128 18) SWANK-REPL:
3: ((LAMBDA (SB-C::NAME SB-C::FUN) :IN SB-C::REPACK-XREF) #<unused argument> #<FUNCTION SWANK-REPL:
Locals:
SB-C::FUN = #<FUNCTION SWANK-REPL:
SB-C::SEEN = #<HASH-TABLE :TEST EQUAL :COUNT 0 {1003FD01E3}>
SB-C::XREFS = #(#(9 3 1 128 18) SWANK-REPL:
4: (SB-C::
5: (SB-C::REPACK-XREF :COMPACT-NAME-COUNT 256 :VERBOSE NIL)
Locals:
COUNTS = NIL
NEW-SIZE = 0
OLD-SIZE = 21
Changed in sbcl: | |
assignee: | nobody → Jan Moringen (scymtym) |
importance: | Undecided → Medium |
Changed in sbcl: | |
status: | New → Fix Committed |
assignee: | Jan Moringen (scymtym) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |