[armedbear-ticket] [armedbear] #342: missing default method for gray-streams:stream-finish-output
#342: missing default method for gray-streams:stream-finish-output ------------------------+----------------------- Reporter: avodonosov | Owner: Type: defect | Status: new Priority: major | Milestone: Component: streams | Version: 1.3.0-dev Keywords: | ------------------------+----------------------- Test case: {{{ (ql:quickload :flexi-streams) (let* ((binary-stream (flexi-streams:make-in-memory-output-stream))) (finish-output binary-stream)) The value #<FLEXI-STREAMS::VECTOR-OUTPUT-STREAM {1E566F3}> is not of type #<STANDARD-CLASS FLEXI-STREAMS:FLEXI-OUTPUT-STREAM {7D84CE}>. [Condition of type SIMPLE-TYPE-ERROR] Backtrace: 0: (#<FUNCTION {1C9E6C0}> #<SIMPLE-TYPE-ERROR {FC82A6}> #<FUNCTION {1C9E6C0}>) 1: (APPLY #<FUNCTION {1C9E6C0}> (#<SIMPLE-TYPE-ERROR {FC82A6}> #<FUNCTION {1C9E6C0}>)) 2: (SYSTEM::RUN-HOOK SYSTEM::*INVOKE-DEBUGGER-HOOK* #<SIMPLE-TYPE-ERROR {FC82A6}> #<FUNCTION {1C9E6C0}>) 3: (INVOKE-DEBUGGER #<SIMPLE-TYPE-ERROR {FC82A6}>) 4: (GRAY-STREAMS:STREAM-FINISH-OUTPUT #<FLEXI-STREAMS::VECTOR-OUTPUT- STREAM {1E566F3}>) 5: (SYSTEM::%FINISH-OUTPUT #<FLEXI-STREAMS::VECTOR-OUTPUT-STREAM {1E566F3}>) 6: (FINISH-OUTPUT #<FLEXI-STREAMS::VECTOR-OUTPUT-STREAM {1E566F3}>) }}} This happens because there is no default method for stream-finish-output. According to the Gray proposal, default method should exist and do nothing. The fix: {{{ Index: src/org/armedbear/lisp/gray-streams.lisp =================================================================== --- src/org/armedbear/lisp/gray-streams.lisp (revision 14464) +++ src/org/armedbear/lisp/gray-streams.lisp (working copy) @@ -314,6 +314,10 @@ (declare (ignore stream)) nil) +(defmethod stream-finish-output (stream) + (declare (ignore stream)) + nil) + (defmethod stream-clear-output (stream) (declare (ignore stream)) nil) }}} Also, ABCL handles the absence of default method not very correctly. It should signal "no applicable method". What happens here is that flexi- streams overrides stream-finish-output for one of its classes - FLEXI-STREAMS:FLEXI-OUTPUT- STREAM. So, I think ABCL sees that there is only one variant of method, and tries to apply this method, despite we pass object of another class. And here typecast happen. -- Ticket URL: <http://abcl.org/trac/ticket/342> armedbear <http://abcl.org> armedbear
#342: missing default method for gray-streams:stream-finish-output -------------------------+-------------------------------- Reporter: avodonosov | Owner: Type: defect | Status: new Priority: major | Milestone: 1.3.0 Component: streams | Version: 1.3.0-dev Resolution: | Keywords: has-patch has-test -------------------------+-------------------------------- Changes (by mevenson): * keywords: => has-patch has-test * milestone: => 1.3.0 -- Ticket URL: <http://abcl.org/trac/ticket/342#comment:1> armedbear <http://abcl.org> armedbear
#342: missing default method for gray-streams:stream-finish-output -------------------------+-------------------------------- Reporter: avodonosov | Owner: Type: defect | Status: new Priority: major | Milestone: 1.3.0 Component: streams | Version: 1.3.0-dev Resolution: | Keywords: has-patch has-test -------------------------+-------------------------------- Comment (by mevenson): With patch the ansi-compiled tests fail: {{{ The value &REST is not of type FIXNUM. [Condition of type TYPE-ERROR] Backtrace: 0: (#<FUNCTION {2CBEE72C}> #<TYPE-ERROR {5A80EE6E}> #<FUNCTION {2CBEE72C}>) 1: (APPLY #<FUNCTION {2CBEE72C}> (#<TYPE-ERROR {5A80EE6E}> #<FUNCTION {2CBEE72C}>)) 2: (SYSTEM::RUN-HOOK SYSTEM::*INVOKE-DEBUGGER-HOOK* #<TYPE-ERROR {5A80EE6E}> #<FUNCTION {2CBEE72C}>) 3: (INVOKE-DEBUGGER #<TYPE-ERROR {5A80EE6E}>) 4: org.armedbear.lisp.Lisp.error(Lisp.java:382) 5: org.armedbear.lisp.Lisp.type_error(Lisp.java:435) 6: org.armedbear.lisp.Fixnum.getValue(Fixnum.java:293) 7: org.armedbear.lisp.LispCharacter$6.execute(LispCharacter.java:350) 8: org.arme }}} -- Ticket URL: <http://abcl.org/trac/ticket/342#comment:2> armedbear <http://abcl.org> armedbear
#342: missing default method for gray-streams:stream-finish-output -------------------------+-------------------------------- Reporter: avodonosov | Owner: Type: defect | Status: new Priority: major | Milestone: 1.3.0 Component: streams | Version: 1.3.0-dev Resolution: | Keywords: has-patch has-test -------------------------+-------------------------------- Comment (by avodonosov): That's very strange. How to can I run this test? -- Ticket URL: <http://abcl.org/trac/ticket/342#comment:3> armedbear <http://abcl.org> armedbear
#342: missing default method for gray-streams:stream-finish-output -------------------------+-------------------------------- Reporter: avodonosov | Owner: Type: defect | Status: new Priority: major | Milestone: 1.3.0 Component: streams | Version: 1.3.0-dev Resolution: | Keywords: has-patch has-test -------------------------+-------------------------------- Comment (by avodonosov): Ok, I found how to run the tests: {{{ ant -Dabcl.build.incremental=true test.ansi.compiled }}} -- Ticket URL: <http://abcl.org/trac/ticket/342#comment:4> armedbear <http://abcl.org> armedbear
#342: missing default method for gray-streams:stream-finish-output -------------------------+-------------------------------- Reporter: avodonosov | Owner: Type: defect | Status: new Priority: major | Milestone: 1.3.0 Component: streams | Version: 1.3.0-dev Resolution: | Keywords: has-patch has-test -------------------------+-------------------------------- Comment (by avodonosov): For me, with or without the patch, ant test.ansi.compiled gives the same result: 12 out of 21707 total tests failed: (CALL-NEXT-METHOD.ERROR.1 CALL-NEXT-METHOD.ERROR.2 MAKE-CONDITION.3 MAKE-CONDITION.4 SXHASH.8 MAP.48 TYPE-OF.1 TYPE-OF.4 MAKE-CONCATENATED-STREAM.30 PRINT.RANDOM-STATE.1 PPRINT-LOGICAL-BLOCK.17 TRACE.8) Tested on SVN revision 14464 -- Ticket URL: <http://abcl.org/trac/ticket/342#comment:5> armedbear <http://abcl.org> armedbear
#342: missing default method for gray-streams:stream-finish-output -------------------------+-------------------------------- Reporter: avodonosov | Owner: Type: defect | Status: new Priority: major | Milestone: 1.3.0 Component: streams | Version: 1.3.0-dev Resolution: | Keywords: has-patch has-test -------------------------+-------------------------------- Comment (by mevenson): After redoing my compilation/test environment from scratch, my error has disappeared. Committed as part of r14605 -- Ticket URL: <http://abcl.org/trac/ticket/342#comment:6> armedbear <http://abcl.org> armedbear
participants (1)
-
armedbear