1

Our Tcl-based web application (OpenACS, NaviServer) provides the functionality for uploading and extracting ZIP Archives. After upgrading to the latest version of Tcl (8.5.18), the server now crashes when processing the contents of the extracted archive and spits out this error.

nsd: /usr/local/src/tcl/tcl8.5.18/unix/../generic/tclIO.c:5395: DoReadChars: Assertion `!((statePtr)->flags & ((1<<9))) || ((statePtr)->flags & ((1<<10))) || Tcl_InputBuffered((Tcl_Channel)chanPtr) == 0' failed.

This assertion has been introduced between Tcl 8.5.17 and 8.5.18. Is the assertion wrong or too rigorous, or does this hint at some form of error at the application level?

Mischa
  • 623
  • 5
  • 17
  • 1
    It indicates _some_ kind of bug. Don't know that part of the code well enough to say more though. You need to contact the maintainer of the IO layer, Don Porter. – Donal Fellows Jul 17 '15 at 03:39
  • Thank you for your response. I managed to reproduce the problem with a reasonably small snippet of code (independent of NaviServer and OpenACS) and sent that to Don Porter. He was quickly able to detect, that this is a known issue - see the answer to the question. – Mischa Jul 22 '15 at 07:43

1 Answers1

1

It turns out that I was running into a known bug that was fixed in April 2015 (http://core.tcl.tk/tcl/info/879a0747bee593e2). When Tcl 8.5.19 is released, using that will make my troubles go away. Before that, one can work from Tcl development sources, or try the patch in isolation (http://core.tcl.tk/tcl/info/4b964e7afb811898).

Mischa
  • 623
  • 5
  • 17