sb-simple-streams:open silently ignores unknown stream class

Bug #969352 reported by Kambiz Darabi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Low
Unassigned

Bug Description

Calling open with a non-existent or non-stream :class argument

(sb-simple-streams:open "/etc/hosts" :class 'class-which-does-not-exist)

returns NIL without any error.

I have attached a patch which changes the cond form in open to signal
an error in that case. Two test cases are included.

This is the thread on the sbcl-devel mailing list:

http://sf.net/mailarchive/message.php?msg_id=28629268

I'm using SBCL 1.0.53.39 on Ubuntu Oneiric

Linux 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011 i686 i686 i386 GNU/Linux

*FEATURES*

(:IOLIB-DEBUG :ASDF2 :ASDF :ASDF-UNIX :ANSI-CL :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS
 :IEEE-FLOATING-POINT :X86 :UNIX :ELF :LINUX :SB-THREAD :SB-FUTEX :LARGEFILE :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD :C-STACK-IS-CONTROL-STACK
 :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP :RAW-INSTANCE-INIT-VOPS :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS :STACK-ALLOCATABLE-LISTS
 :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS :CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS :LINKAGE-TABLE :OS-PROVIDES-DLOPEN
 :OS-PROVIDES-DLADDR :OS-PROVIDES-PUTWC :OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-SUSECONDS-T :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-POLL)

Revision history for this message
Kambiz Darabi (darabi) wrote :
Stas Boukarev (stassats)
Changed in sbcl:
status: New → Confirmed
importance: Undecided → Low
status: Confirmed → Triaged
Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: Triaged → In Progress
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

commit ac28b4bc430e89db490c9bb23ec7aa8d7cfe318a
Author: Kambiz Darabi <email address hidden>
Date: Fri Jan 6 09:11:36 2012 +0100

    sb-simple-streams: signal an error for bad stream classes in OPEN

      Instead of silently returning NIL, signal an error if the class does not
      exist (if argument :class is a symbol) or is not a stream class.

      lp#969352

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
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.