Tech Insider					     Technology and Trends


			      USENET Archives

From: Jim Barton <j...@network-age.com>
Subject: BUG in Tcl 8.0b1 fileevent handling
Date: 1997/06/09
Message-ID: <339C51E4.6FF1@network-age.com>#1/1
X-Deja-AN: 247300833
Organization: Network Age Software, Inc.
Newsgroups: comp.lang.tcl


The specific example:

	create a server on a socket
	connect to it from another process
	create a read fileevent handler in the server for the socket
	create a write filevent handler in the server for the socket
	cancel the write filevent handler for the socket
	close the socket in the server
	server enters an infinite loop!

What happened? When the writable event handler is deleted,
the select bit in the writable mask kept in the notifier
structure is never cleared. However, the file descriptor is
closed. Like a good OS call, select notes that the descriptor
matching the select bit is not open, and returns EBADF. TCL,
however, basically ignores the error return from select, and tries
again, and again, and again ...

-- jmb

From: Jim Barton <j...@network-age.com>
Subject: Problem with fcopy?
Date: 1997/06/11
Message-ID: <339F0B26.7FA2@network-age.com>#1/1
X-Deja-AN: 247726867
Organization: Network Age Software, Inc.
Newsgroups: comp.lang.tcl


I'm running Tcl8.0b1 under IRIX, but I assume this is true for
most UNIX-family operating systems.

In certain circumstances, fcopy drops the last four bytes
of the input file. I haven't been fully able to ascertain
why, or what the condition is, but it can be faithfully
reproduced with the right file of sufficient size.

I have an fcopy-like command (it does some other things I
need) that has the same problem. Thinking it was my bug,
I spent many hours honing the code. But the fact is, my
home-brew fcopy and TCL's fcopy both fail the same way
on the same file, so it is likely the bug is underneath
somewhere.

Tracing what happens, it is apparent that the TCL file
mechanism has decided to return 0 bytes with Tcl_Eof returning
true, even though those last four bytes haven't been presented
to the caller. Reading again still returns 0 bytes.

Anybody seen anything like this?

-- jmb

			        About USENET

USENET (Users’ Network) was a bulletin board shared among many computer
systems around the world. USENET was a logical network, sitting on top
of several physical networks, among them UUCP, BLICN, BERKNET, X.25, and
the ARPANET. Sites on USENET included many universities, private companies
and research organizations. See USENET Archives.

		       SCO Files Lawsuit Against IBM

March 7, 2003 - The SCO Group filed legal action against IBM in the State 
Court of Utah for trade secrets misappropriation, tortious interference, 
unfair competition and breach of contract. The complaint alleges that IBM 
made concentrated efforts to improperly destroy the economic value of 
UNIX, particularly UNIX on Intel, to benefit IBM's Linux services 
business. See SCO v IBM.

The materials and information included in this website may only be used
for purposes such as criticism, review, private study, scholarship, or
research.

Electronic mail:			       WorldWideWeb:
   tech-insider@outlook.com			  http://tech-insider.org/