Pierre R. Mai writes:
>
> Am Donnerstag, 20.03.03 um 21:49 Uhr schrieb <[EMAIL PROTECTED]>:
>
> >
> > Rarely, we've seen this type error in DO-OUTPUT-LATER:
> >
> > Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER:
> > NIL is not of type (MOD 536870911)
>
> Do you operate your fd-streams with the descriptors set to non-blocking
> mode?
No. At least we don't explicitly set them to non-blocking.
> > It's referring to the type INDEX:
> >
> > (defun do-output-later (stream)
> > (let* ((stuff (pop (fd-stream-output-later stream)))
> > (base (car stuff))
> > (start (cadr stuff))
> > (end (caddr stuff))
> > (reuse-sap (cadddr stuff))
> > (length (- end start)))
> > (declare (type index start end length))
> > ...
> >
> > so one of START, END, OR LENGTH must be null when DO-OUTPUT-LATER is
> > called. Unfortunately, I only have the error message and a
> > backtrace[1] to work with.
> >
> > We're using "release x86-linux 3.0.8 18c+ 31 December 2001 build 3030",
> > but DO-OUTPUT-LATER has been modified. It comes from the IMHO
> > package[2]. I've included the full source below[3].
>
> Why does the IMHO package modify do-output-later?
Only to add diagnostics. I see now that I neglected to attach the
source in my earlier message. Here it is now:
------------------------ do-output-later ---------------------------------------
(defun do-output-later (stream)
(let* ((stuff (pop (fd-stream-output-later stream)))
(base (car stuff))
(start (cadr stuff))
(end (caddr stuff))
(reuse-sap (cadddr stuff))
(length (- end start)))
(declare (type index start end length))
(multiple-value-bind
(count errno)
(unix:unix-write (fd-stream-fd stream)
base
start
length)
(cond ((not count)
(case errno
((#.unix:ewouldblock
#.unix:eintr)
(format t "~&;; ***** Output lost: unblocked, but failed. Oh
well.~%"))
(#.unix:epipe (format t "~&;; ***** EPIPE: Output lost.~%"))
(#.unix:ebadf (format t "~&;; ***** EBADF: Output lost.~%"))
(#.unix:einval (format t "~&;; ***** EBADF: Output lost.~%"))
(#.unix:efault (format t "~&;; ***** EBADF: Output lost.~%"))
(#.unix:enospc (format t "~&;; ***** EBADF: Output lost.~%"))
(#.unix:eio (format t "~&;; ***** EBADF: Output lost.~%"))
(t (format t "~&;; ***** ERROR: Output lost: ~d (~a)~%"
errno (unix:get-unix-error-msg errno)))))
((eql count length) ; Hot damn, it workded.
(when reuse-sap
(push base *available-buffers*)))
((not (null count)) ; Sorta worked.
(push (list base
(the index (+ start count))
end)
(fd-stream-output-later stream))))))
(unless (fd-stream-output-later stream)
(system:remove-fd-handler (fd-stream-handler stream))
(setf (fd-stream-handler stream) nil)))
------------------------ do-output-later ---------------------------------------
I notice that we don't check for the case that STREAM is the same one
that FORMAT T would use. I don't know if that is a problem.
Regards,
Craig Ludington