For Programmers: Free Programming Magazines  


Home > Archive > Tcl > November 2006 > tcl core bug? (was: tcllib smtp problem: read from server timed out)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author tcl core bug? (was: tcllib smtp problem: read from server timed out)
Jean-Luc Fontaine

2006-11-23, 7:04 pm

(initial problem:
http://groups.google.com/group/comp...b701337ace68fd8)

Using strace on my 64 bit Fedora Core 6 box, I noticed that there was a
timed-out select() call after the smtp::sendmessage invocation but that that
select() call was on descriptor 20 rather than the 52 corresponding to the
smtp::sendmessage socket.

I suspect a rather big problem in TclUnixWaitForFile() from tclUnixChan.c:

....
int index, bit, numFound, result = 0;
....
memset((void *) readyMasks, 0, 3*MASK_SIZE*sizeof(fd_mask));
index = fd/(NBBY*sizeof(fd_mask));
bit = 1 << (fd%(NBBY*sizeof(fd_mask)));
....

I don't see how the code above can handle descriptors above 31, bit being a 32
bit integer. I actually got bit=2**20 with fd=52... unfortunately I ran out of
time before I could find the exact problem (had to go to the dentist..., I'll be
able to continue next w).
Anyway, wouldn't it be better to use the FD_SET macro instead?

Your thoughts are highly welcomed!

Jean-Luc
Earl Greida

2006-11-24, 4:02 am


"Jean-Luc Fontaine" <jfontain@free.fr> wrote in message
news:MUn9h.209$i84.268@nntpserver.swip.net...
> (initial problem:
>

http://groups.google.com/group/comp...b701337ace68fd8)
>
> Using strace on my 64 bit Fedora Core 6 box, I noticed that there
> was a timed-out select() call after the smtp::sendmessage invocation
> but that that select() call was on descriptor 20 rather than the 52
> corresponding to the smtp::sendmessage socket.
>


Is this a core bug or Tcllib bug?


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com