ELT takes a very long time on large, out of range index

Bug #1738071 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Wishlist
Unassigned

Bug Description

(elt '(0) 20849884900)

==>

hangs for a long time before signaling that the index is out of bounds

Revision history for this message
Stas Boukarev (stassats) wrote :

It's not easy to do efficiently, and this doesn't lead to an any unsafe situations.

Changed in sbcl:
importance: Undecided → Wishlist
Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

This came up in mutation testing. I'm mutating valid forms by randomly inserting fragments of other valid forms, looking for situations that would cause SB-INT:BUG to be thrown by the compiler, or the compiler to outright crash (the previous bug with ASH/etc. running out of memory came up this way too). For this to work, errors should be catchable. I can get around it here by using timeouts, so this is not critical, but in general I'd prefer all problem to show themselves quickly.

Here, it would just require that ELT specially handle the case of large fixnums. In the common case of short lists this would mean just one extra check would be needed.

Revision history for this message
Stas Boukarev (stassats) wrote :

ELT on a small list called a lot of times would still incur the cost of additional checks.

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.