Gray streams stream-file-position type error

Bug #1816670 reported by Elijah Malaby
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

Either the type on file-position needs to be relaxed or sb-gray:stream-file-position needs to be documented as more restrictive about return values than file-position in the spec.

Passing :end to file-position on a trivial-gray-streams input stream (specifically a flexi-streams in-memory-input-stream in my original testing) produces an error about :end not being of type (or unsigned-byte boolean), instead of properly setting the position. Some further digging indicates this is because trivial-gray-streams exposes handling setting file-position with a setf function, so flexi-streams' setf method returns the assigned value :end back which trivial-gray-streams returns from their implementation of sb-gray:file-position. I'm reporting the issue here because, by the spec, file-position is allowed to return a generalized boolean and so, given the limited documentation on the sb-gray functions, it seems reasonable to assume that methods on sb-gray:file-position ought to have the same flexibility.

My original test boils down to:
(ql:quickload :flexi-streams)
(file-position (flexi-streams:make-in-memory-input-stream #()) :end)

SBCL version: SBCL 1.4.16

uname -a:
Linux XANA-DG-laptop 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

*features*:
(:SLYNK :QUICKLISP :QUICKLISP-SUPPORT-HTTPS :SB-BSD-SOCKETS-ADDRINFO :ASDF3.3
 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX :NON-BASE-CHARS-EXIST-P
 :ASDF-UNICODE :ROS.INIT :X86-64 :64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS
 :ANSI-CL :AVX2 :C-STACK-IS-CONTROL-STACK :CALL-SYMBOL :COMMON-LISP
 :COMPACT-INSTANCE-HEADER :COMPARE-AND-SWAP-VOPS :CYCLE-COUNTER :ELF
 :FP-AND-PC-STANDARD-SAVE :GENCGC :IEEE-FLOATING-POINT :IMMOBILE-CODE
 :IMMOBILE-SPACE :INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE :LINUX
 :LITTLE-ENDIAN :OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN
 :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-POLL :OS-PROVIDES-PUTWC
 :OS-PROVIDES-SUSECONDS-T :PACKAGE-LOCAL-NICKNAMES :RELOCATABLE-HEAP :SB-DOC
 :SB-EVAL :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SIMD-PACK-256
 :SB-SOURCE-LOCATIONS :SB-THREAD :SB-UNICODE :SBCL :STACK-ALLOCATABLE-CLOSURES
 :STACK-ALLOCATABLE-FIXED-OBJECTS :STACK-ALLOCATABLE-LISTS
 :STACK-ALLOCATABLE-VECTORS :STACK-GROWS-DOWNWARD-NOT-UPWARD
 :UNDEFINED-FUN-RESTARTS :UNIX :UNWIND-TO-FRAME-AND-CALL-VOP)

Stas Boukarev (stassats)
Changed in sbcl:
status: New → Confirmed
assignee: nobody → Stas Boukarev (stassats)
Revision history for this message
Stas Boukarev (stassats) wrote :

90cf89f10044138932d893ee1b5e558b40bb7146

Changed in sbcl:
status: Confirmed → Fix Committed
assignee: Stas Boukarev (stassats) → nobody
Stas Boukarev (stassats)
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.