OriginalBugID: 637 Bug
Version: 8.1a2
SubmitDate: '1998-05-25'
LastModified: '1999-09-20'
Severity: MED
Status: Released
Submitter: hershey
ChangedBy: hobbs
OS: SunOS
OSVersion: 5.5.1
Machine: Other
FixedDate: '1999-09-20'
FixedInVersion: 8.2
ClosedDate: '2000-10-25'
Now *MY* problem. When one of my special procs creates an HTML page that
is "large", only
the beginning of the page gets to the browser; it then hangs. The size
seems to vary but
is around 30K. More than this and it hangs; less and all is well.
I've tried this with
Tcl 8.0, 8.0p2 and 8.1a2; with tclhttpd 2.1.0, 2.1.1 and 2.1.2. All
behave the same for
me. Browsers seem not to affect it; I've tried Netscape 3 and 4 on
Solaris, and Netscape
4 and IE 3 on NT. All the same.
But wait, there's more! I created a special version of this, with a
really stupid little
C program. Essentially it's just the one I showed as an example above.
I then put ifdefs
around the pthread stuff so that I could turn it off. If it's off, the
program acts as
a simple single threaded C program with an embedded Tcl interpreter.
That runs FINE!
Big files, huge files, entire Linux distributions, raw cdroms, it serves
it all up fine.
If I compile the same program
with pthreads, it fails as described above.
Interesting. Incidentally, at this point I gave the tclhttpd thread an
enormous stack; no change.
I looked at the packet exchanges with tcpdump. All looks normal except
after 30K data just stops
flowing. I went into the guts of Tcl and had it print out what it was
doing right where it writes
into the socket, in the bowels of the socket output method
(TcpOutputProc, I think is the C function,
in TclIO.c). Oddly, ALL THE DATA SEEM TO BE BEING WRITTEN TO THE
SOCKET!! The loop
to write this large chunk of data works fine on the user-space side of
the socket.
So my question is: does anyone have an idea why running the exact same
code works when it's
single threaded and doesn't when it's in a pthread? I'm not even trying
for concurrency
any more in my tests; I'll settle for just getting all the data to the
destination.
--berry
==
[email protected]
We need a test file to proceed with this bug. What OS is this occurring on? Any extensions? Which version of Tcl? 03/23/1999 17:52 - surles -
--
Proper thread-safety was added to 8.1, and threading was improved
in 8.2. Without a more specific example, we can only assume that
would fix it. It is possible that it is caused by stack overflow
in pthreads, or that it isn't hanging, but stopping in one of the
worst case regexp scenarios that take forever.
-- 09/20/1999 hobbs
|