#p"\\\\" gives SB-KERNEL:BOUNDING-INDICES-BAD-ERROR

Bug #489698 reported by Willem Broekema
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Alastair Bridgewater

Bug Description

0] #p"\\\\"

debugger invoked on a SB-KERNEL:BOUNDING-INDICES-BAD-ERROR:
  The bounding indices 3 and 2 are bad for a sequence of length 2.
See also:
  The ANSI Standard, Glossary entry for "bounding index designator"
  The ANSI Standard, writeup for Issue SUBSEQ-OUT-OF-BOUNDS:IS-AN-ERROR

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

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

(SB-INT:SEQUENCE-BOUNDING-INDICES-BAD-ERROR "\\\\" 3 2)
0[2] backtrace

0: (SB-INT:SEQUENCE-BOUNDING-INDICES-BAD-ERROR "\\\\" 3 2)
1: (SB-KERNEL:%FIND-POSITION
    #\\
    "\\\\"
    NIL
    3
    2
    #<FUNCTION IDENTITY>
    #<FUNCTION EQL>)
2: (SB-IMPL::EXTRACT-DEVICE "\\\\" 0 2)
3: (SB-IMPL::PARSE-WIN32-NAMESTRING #<unavailable argument> 0 2)
4: (SB-IMPL::%PARSE-NAMESTRING
    "\\\\"
    NIL
    #P"c:\\Willem\\lisp\\slime\\contrib\\"
    0
    NIL
    NIL)
5: (PARSE-NAMESTRING
    "\\\\"
    NIL
    #P"c:\\Willem\\lisp\\slime\\contrib\\"
    :START
    0
    :END
    NIL
    :JUNK-ALLOWED
    NIL)
6: (SB-IMPL::%READ-PRESERVING-WHITESPACE
    #<SYNONYM-STREAM :SYMBOL *TERMINAL-IO* {223D3A99}>
    NIL
    (NIL)
    T)

description: updated
summary: - (PATHNAME-NAME "\\\\") gives SB-KERNEL:BOUNDING-INDICES-BAD-ERROR
+ #p"\\\\" gives SB-KERNEL:BOUNDING-INDICES-BAD-ERROR
Revision history for this message
Alastair Bridgewater (alastair-bridgewater) wrote :

Confirmed on 1.0.32.28 Win32.

The second branch of the COND in EXTRACT-DEVICE (src;code;win32-pathname.lisp) calls POSITION passing (+ START 3) as the start but only verifies (>= END (+ START 2)), causing an error for the specific case of (extract-device "\\\\").

Adding a test that there are at least three characters in the range to the AND in the test for the branch in question is sufficient to cause the function to indicate that there is no device component.

After this change, we have:

* (describe #p"\\\\")

#P"\\"
  [structure-object]

Slots with :INSTANCE allocation:
  HOST = #<SB-IMPL::WIN32-HOST {22423411}>
  DEVICE = NIL
  DIRECTORY = (:ABSOLUTE)
  NAME = NIL
  TYPE = NIL
  VERSION = NIL

, which is presumably correct.

Changed in sbcl:
status: New → In Progress
assignee: nobody → Alastair Bridgewater (alastair-bridgewater)
Revision history for this message
Alastair Bridgewater (alastair-bridgewater) wrote :

Fixed in 1.0.33.2.

Changed in sbcl:
status: In Progress → 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.