From: <no...@so...> - 2002-09-26 10:35:22
|
Bugs item #614650, was opened at 2002-09-25 22:34 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=614650&group_id=12997 Category: 53. [selection] Group: 8.4.0 Status: Open Resolution: None Priority: 9 Submitted By: Reinhard Max (rmax) Assigned to: Jeffrey Hobbs (hobbs) Summary: Tk crashes when pasting large selections Initial Comment: When a selection of more than 3999 bytes gets pasted from a Tk text widget into e.g. vi running inside xterm, wish crashes with a segfault. This can be reproduced by the following script: pack [text .t] -expand yes -fill both .t insert end [string repeat a 4000] Select the whole content of the text widget by double-click and try to paste it elsewhere. I observed this crash on SuSE Linux 8.0, and 8.1 under fvwm2 and windowmaker. The following little patch fixes the segfault, but pasting selections > 3999 bytes still doesn't work after applying it. --- tkUnixSelect.c 2002/09/25 21:03:59 1.1 +++ tkUnixSelect.c 2002/09/25 21:25:58 @@ -469,7 +469,7 @@ eventPtr->xproperty.window, eventPtr->xproperty.atom, formatType, 8, PropModeReplace, - (unsigned char *) Tcl_DStringValue(&ds), numItems); + propPtr, numItems); Tk_DeleteErrorHandler(errorHandler); ckfree(propPtr); ---------------------------------------------------------------------- >Comment By: Donal K. Fellows (dkf) Date: 2002-09-26 11:35 Message: Logged In: YES user_id=79902 Wow! That code was really very wrong indeed; dit it *ever* work?! Here's a patch that not only fixes the problem but also makes more variables local to the block in which they are used so the scopes and lifetimes are better identified. We could do with a test though (note that you must make sure that the transfer does not take place by XA_STRING because that uses a different mechanism.) ---------------------------------------------------------------------- Comment By: Reinhard Max (rmax) Date: 2002-09-25 22:38 Message: Logged In: YES user_id=124643 This doesn't occur with 8.3.4, and 8.0.5, but I haven't yet checked the 8.4 alpha and beta versions. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=614650&group_id=12997 |