[Openmcl-devel] ccl crashes if you write from several threads to a closed stream. (Unhandled exception 11)

Gary Byers gb at clozure.com
Wed Jun 25 13:30:23 UTC 2008



On Wed, 25 Jun 2008, R.Stoye wrote:

> Clozure Common Lisp Version 1.2-r9739MS-RC1 crashes if you write from
> several threads to a closed stream.

I won't ask what the non-stupid version of the code looks like ...

This seems to be fixable; let me look at a few more things and
I'll try to check the fix in tonight or tomorrow.

(Closing a shared stream while threads are doing I/O on it is
a little odd, but should lead to a bunch of threads whining
about the stream being closed, not a segfault.)

>
> eg.:
>
> (defun make-some-writes (stream n id)
>   (dotimes (k n)
>     (format stream "~%A printed line ~a (~a)" id k)))
>
> ;; yeah this *is* stupid code
> (defun just-show-it-crashes (np nw)
>   (with-open-file (out "/tmp/some-writes.txt"
> 		       :if-does-not-exist :create :if-exists :supersede
> 		       :direction :output :sharing :lock)
>     (dotimes (k np)
>       (process-run-function "make-some-writes process" #'make-some-
> writes out nw k))))
>
> ;; (just-show-it-crashes 30 20000)
>
> ;; results in:
>
> ? (just-show-it-crashes 30 20000)
> NIL
> ? Unhandled exception 11 at 0x30004029c361, context->regs at #xb26a4890
> ? for help
> [82348] OpenMCL kernel debugger: BT
> current thread: tcr = 0x10a060, native thread ID = 0x17603, interrupts
> enabled
>
>
> (#x0000000004E0B830) #x00003000404443CC : #<Function WRITE-STRING
> #x0000300040443F2F> + 1181
> (#x0000000004E0B8E8) #x0000300040070264 : #<Function %PR-INTEGER
> #x000030004006FE9F> + 965
> (#x0000000004E0B988) #x0000300040461AA4 : #<Function WRITE-AN-INTEGER
> #x000030004046199F> + 261
> (#x0000000004E0B9D8) #x000030004016176C : #<Function %CALL-NEXT-METHOD
> #x000030004016136F> + 1021
> (#x0000000004E0BA58) #x0000300040163C54 : #<Function %%STANDARD-
> COMBINED-METHOD-DCODE #x000030004016396F> + 741
> (#x0000000004E0BAD0) #x000030004043F0AC : #<Function WRITE-A-FROB
> #x000030004043EFFF> + 173
> (#x0000000004E0BB50) #x00003000404405FC : #<Function WRITE-INTERNAL
> #x00003000404402AF> + 845
> (#x0000000004E0BBB0) #x0000300040450A54 : #<Function WRITE-1
> #x000030004045085F> + 501
> (#x0000000004E0BBD8) #x000030004044DDCC : #<Function PRINC
> #x000030004044DD1F> + 173
> (#x0000000004E0BC40) #x00003000409161E4 : #<Anonymous Function
> #x000030004091611F> + 197
> (#x0000000004E0BC88) #x0000300040506844 : #<Function SUB-FORMAT
> #x0000300040505E9F> + 2469
> (#x0000000004E0BD40) #x0000300040925FBC : #<Function DO-SUB-FORMAT
> #x0000300040925F1F> + 157
> (#x0000000004E0BD60) #x0000300040926C0C : #<Function FORMAT
> #x000030004092654F> + 1725
> (#x0000000004E0BE80) #x0000300040CBFF94 : #<Function MAKE-SOME-WRITES
> #x0000300040CBFF1F> + 117
> (#x0000000004E0BEB8) #x000030004042FE2C : #<Function RUN-PROCESS-
> INITIAL-FORM #x000030004042FB5F> + 717
> (#x0000000004E0BF48) #x000030004043080C : #<Function (:INTERNAL
> %PROCESS-PRESET-INTERNAL) #x000030004043067F> + 397
> (#x0000000004E0BF98) #x00003000404017C4 : #<Function (:INTERNAL THREAD-
> MAKE-STARTUP-FUNCTION) #x000030004040169F> + 293
> [82348] OpenMCL kernel debugger: Current Thread Context Record (tcr) =
> 0x10a060
> Control (C) stack area:  low = 0xb2441000, high = 0xb26a5000
> Value (lisp) stack area: low = 0x4bfb000, high = 0x4e0c000
> Exception stack pointer = 0x4e0b798
> [82348] OpenMCL kernel debugger:
> |#
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list