Tk Library Source Code

View Ticket
Login
Ticket UUID: 815405
Title: pop3::top Hangs under wish/tkcon
Type: Bug Version: None
Submitter: royterry Created on: 2003-09-30 20:20:44
Subsystem: pop3 Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2013-07-04 17:25:37
Resolution: Not Applicable Here Closed By:
    Closed on:
Description:
I have a script that runs fine under tclsh84.
When run by wish it hangs and then begins to
take 100% of cpu. May work with 1 or 2 messages but 
hangs consistently with more.

I haved tried supplying a bgerror handler and supplying  
a do-nothing log::log proc. Still hangs when

Script attached

INPUT: (add to top of script)
mailserver
login
pass


Windows 2000
Tcl/Tk 8.4.2
User Comments: royterry added on 2003-11-01 01:29:15:

File Added - 66063: roytest2.output.txt

royterry added on 2003-11-01 01:28:01:

File Added - 66062: roytest2.tcl

royterry added on 2003-11-01 01:28:00:
Logged In: YES 
user_id=146884

I tried this again with logging as requested by Andreas. The 
observed behavior was different this time but still always a 
failure. My stop-gap fix continues to work without any known 
errors. 
The failure is an unknown (no error string) error out of 
pop3::send, which is reported by pop3::top. This results in 
only the first message top being retrieved by the code.

In roytest2.tcl see line 586 for the call to top. Again this all 
works fine (and I use it continously) for days and weeks on 
end with the patched version.  Seems pretty clear that fiile 
events are being mismanaged somehow in the standard code 
such that running in Windows Tk fails.
Please see attached log/console: roytest2.output.txt
and roytest2.tcl

PS: Regarding log enable/enable I have learned through 
painful experience to be suspicious of performing "console" 
(and sometimes even file output) during tk event processing.  
In the past this has lead to some lockups and crashes. That 
is why I disabled logging. Unfortunately logging in this case 
really doesn't seem to reveal much but here you have it 
anyway in the .txt file.

Thanks,
Roy Terry

- more -

I tried "standard" versions of pop3.tcl 
< # RCS: @(#) $Id: pop3.tcl,v 1.25 2003/04/11 20:07:24 
andreas_kupries Exp $
---
> # RCS: @(#) $Id: pop3.tcl,v 1.21 2002/10/14 19:17:23 
andreas_kupries Exp $
and they failed identically. 
The saved output from tkcon is attached. and I 've added a 
note at the bottom of it.  I've also attached the program files 
I used to execute the test with my personal server 
information deleted.

andreas_kupries added on 2003-10-22 04:44:41:
Logged In: YES 
user_id=75003

log::log is usually inactive, i.e. not producing output. Setting 
it a null proc will accomplish nothing with respect to output. 
It may make the code a bit faster as there won't be any 
checks for possible logging anymore.

Please remove your null log::log and then activate logging 
(Via [log::lvSupressLE critical 0]). That way we can see what 
is going inside the library and on the wire to the pop server.

royterry added on 2003-10-03 01:17:24:
Logged In: YES 
user_id=146884

I found a "fix" of sorts. Not a real fix because
I'm not prepared to explain how/why it works.

The change is to switch the channel to -buffering line
and to change -translation {binary crlf} to -translation binary


Based on
# RCS: @(#) $Id: pop3.tcl,v 1.25 2003/04/11 20:07:24 
andreas_kupries Exp $

Here is the diff
-------------------------------------------------

738 C:/p/t/spam> diff pop3-works-under-windows2000-tk.tcl 
pop3.tcl
274c274
<     fconfigure $chan -buffering line  -translation binary
---
>     fconfigure $chan -buffering none
282c282
<       # fconfigure $chan -translation {binary crlf}
---
>       fconfigure $chan -translation {binary crlf}

Makes my issue go away at least for now.

royterry added on 2003-10-01 03:20:44:

File Added - 63031: pop3hangstk.tcl

Attachments: