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

Bug #1738071 reported by Paul F. Dietz on 2017-12-13
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

(elt '(0) 20849884900)


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

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
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.

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  Edit
Everyone can see this information.

Other bug subscribers