From: SourceForge.net <no...@so...> - 2003-11-08 21:24:33
|
Bugs item #833627, was opened at 2003-10-31 13:43 Message generated for change (Comment added) made by patthoyts You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=833627&group_id=12997 Category: 18. [text] Group: 8.5a0 Status: Closed Resolution: Fixed Priority: 9 Submitted By: Pat Thoyts (patthoyts) Assigned to: Vince Darley (vincentdarley) Summary: TIP 155 text widget crashes and panics. Initial Comment: I ran the new TIP 155 text widget with tkchat and it raised a Tk panic with the message "LayoutDLine couldn't place any characters on a line" This is due to the presence of elided text in the widget. I am hiding the entry messages and if I have these to be shown then it doesn't panic. While trying to produce a minimal example I get a crash from the following tcl code. (This is Win2k Tcl and Tk HEAD). pack [text .t] .t insert 0.0 HELLO .t tag configure HIDE -elide 1 .t tag add HIDE 0.0 end ---------------------------------------------------------------------- >Comment By: Pat Thoyts (patthoyts) Date: 2003-11-08 21:24 Message: Logged In: YES user_id=202636 tkchat seems to be happy with this now. Congratulations! ---------------------------------------------------------------------- Comment By: Vince Darley (vincentdarley) Date: 2003-11-08 17:22 Message: Logged In: YES user_id=32170 Ok, try once more. I finally think I have this correct. It was much more complex than I imagined! ---------------------------------------------------------------------- Comment By: Pat Thoyts (patthoyts) Date: 2003-11-08 01:05 Message: Logged In: YES user_id=202636 The last fix seemed to work, but it eventually happened again. This time it reduces to: package require Tk pack [text .txt] .txt tag configure WELCOME -elide 1 .txt tag configure SYSTEM -elide 0 .txt tag configure TRAFFIC -elide 1 .txt insert end "\n" {SYSTEM TRAFFIC} .txt insert end "\n" WELCOME If the SYSTEM tag is defined after the TRAFFIC tag then the panic doesn't occur. Also it seems all three tags are required and both of the insert commands. ---------------------------------------------------------------------- Comment By: Vince Darley (vincentdarley) Date: 2003-11-07 12:08 Message: Logged In: YES user_id=32170 Ok, applied one more fix, solving the latest neat example! This fix seems to address a more general issue than the previous fixes, so could perhaps solve all the tkchat problems. ---------------------------------------------------------------------- Comment By: Pat Thoyts (patthoyts) Date: 2003-11-05 22:59 Message: Logged In: YES user_id=202636 As of tkTextDisp.c rev. 1.22 the problems below are ok, but the following code will produce the panic. package require Tk pack [text .txt] .txt tag configure SYSTEM -elide 0 .txt tag configure TRAFFIC -elide 1 .txt insert end "\n" {SYSTEM TRAFFIC} I noticed that the order of the two tags is important. It works fine if the second tag is -elide 0. ---------------------------------------------------------------------- Comment By: Pat Thoyts (patthoyts) Date: 2003-11-05 15:01 Message: Logged In: YES user_id=202636 It looks like we require two elided tags to make this fail and the newlines. (very slightly simpler): package require Tk pack [text .txt] .txt tag config WELCOME -elide 1 .txt tag config HELP -elide 1 .txt insert end "test\n" WELCOME .txt insert end "test\n" HELP ---------------------------------------------------------------------- Comment By: Pat Thoyts (patthoyts) Date: 2003-11-05 14:55 Message: Logged In: YES user_id=202636 That was a great suggestion. I have trimmed down the log results and the final failing set of commands is: package require Tk pack [text .txt] .txt tag config WELCOME -elide 1 .txt tag config HELP -elide 1 .txt insert end "\n" {WELCOME NICK} .txt insert end "\n" {HELP NICK} ---------------------------------------------------------------------- Comment By: Vince Darley (vincentdarley) Date: 2003-11-05 08:50 Message: Logged In: YES user_id=32170 Can you try to use: set logfile [open textlog w] trace add execution .textwidget after log proc log {args} { puts $::logfile $args } or something like that to trace the set of tkchat text widget actions to produce at least an example that doesn't require a whole application? ---------------------------------------------------------------------- Comment By: Pat Thoyts (patthoyts) Date: 2003-11-04 23:30 Message: Logged In: YES user_id=202636 Sorry. Re-opened because the fault is still present. I have been unable to produce a minimal demonstration, but it's easy enough to produce with tkchat. You need to have tkchat configured with the various system messages hidden (esp. the Welcome messages). Then when you connect and it fetches the messages file (not the history, just the current active chat) then it panics when it comes across a message to be hidden. You will need a chat login to do this, although the chat data can be obtained from http://mini.net/tchat/messages and this could be piped into the tkchat app -- however, it is probably simpler just to use it as-is. ---------------------------------------------------------------------- Comment By: Vince Darley (vincentdarley) Date: 2003-11-03 16:14 Message: Logged In: YES user_id=32170 Ok, fixed the panic too. ---------------------------------------------------------------------- Comment By: Vince Darley (vincentdarley) Date: 2003-11-03 10:27 Message: Logged In: YES user_id=32170 I tried to source tkchat into wish and didn't get a crash. Note, however, that I've never used tkchat, have no 'id/password' or anything. If you can post exact instructions for how to reproduce from that situation, I can try to debug... ---------------------------------------------------------------------- Comment By: Vince Darley (vincentdarley) Date: 2003-11-02 22:13 Message: Logged In: YES user_id=32170 I've checked this patch in, then, but can you provide a test case for the 'panic', please? ---------------------------------------------------------------------- Comment By: Pat Thoyts (patthoyts) Date: 2003-10-31 22:24 Message: Logged In: YES user_id=202636 Your patch here fixes the crash for this code sample but I still get a panic when starting tkchat in LayoutDLine. ---------------------------------------------------------------------- Comment By: Vince Darley (vincentdarley) Date: 2003-10-31 14:06 Message: Logged In: YES user_id=32170 I see a crash with this example (thanks for such a quick example!), but it's different to what you get (no panic, just a segfault). I can fix this by changing the first few lines of DlineIndexOfX (in tkTextDisp.c) to: TextDInfo *dInfoPtr = textPtr->dInfoPtr; register TkTextDispChunk *chunkPtr; /* * Scan through the line's chunks to find the one that contains * the desired x-coordinate. Before doing this, translate the * x-coordinate from the coordinate system of the window to the * coordinate system of the line (to take account of x-scrolling). */ *indexPtr = dlPtr->index; x = x - dInfoPtr->x + dInfoPtr->curXPixelOffset; chunkPtr = dlPtr->chunkPtr; if (chunkPtr == NULL) { /* * This may occur if everything is elided */ return; } for (; x >= (chunkPtr->x + chunkPtr->width); Can you test this please? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=833627&group_id=12997 |