Tk Source Code

View Ticket
Login
Ticket UUID: 1938774
Title: disable send -> X error on exit
Type: Bug Version: obsolete: 8.5.2
Submitter: dgp Created on: 2008-04-09 16:15:22
Subsystem: 67. Unix Window Operations Assigned To: jenglish
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2018-02-10 17:34:11
Resolution: Fixed Closed By: fvogel
    Closed on: 2018-02-10 17:34:11
Description:
dgpHas something changed from Tk 8.4 -> Tk 8.5 when the [send] command is deleted?
dgpI have a "big wish" program.
dgpWhen I build it with Tcl/Tk 8.4.18, I can [rename send {}], and things work fine
dgpWhen I build with core-8-5-branch, and enter [rename send {}; exit] at the interactive prompt, I get an X error....

dgp$ ./omfsh
X Error of failed request:  RenderBadPicture (invalid Picture parameter)
  Major opcode of failed request:  155 (RENDER)
  Minor opcode of failed request:  7 (RenderFreePicture)
  Picture id in failed request: 0x260003f
  Serial number of failed request:  1525
  Current serial number in output stream:  1582
dgplook familiar to any Tk experts?
User Comments: fvogel added on 2018-02-10 17:34:11:

Merged to core-8-6-branch and trunk.

See duplicate ticket [1821174fff].


jenglish added on 2008-04-11 22:34:46:
Logged In: YES 
user_id=68433
Originator: NO

Duplicate of #1821174.

Cause of the problem: Tk's teardown sequence sets tsdPtr->displayList to NULL before calling TkpCloseDisplay on each member of the list, so if any X errors occur during the final XSync(), ErrorProc is not able to dispatch them to the correct TkErrorHandler.

The RenderBadPicture error is raised in response to XftDrawDestroy() when the Drawable associated with the XftDraw has been destroyed before the XftDraw itself is.  This call (in FinishedWithFont, in tkUnixRFont.c) is bracketed by Tk_CreateErrorHandler / Tk_DeleteErrorHandler, so would not be a fatal error, except for the problem above.

Removing the [send] command causes (among other things) an XSync() to occur; this normally occurs at a point in Tk's teardown sequence where it happens to mask the above two problems.  If the application removes [send] itself earlier, this doesn't happen, and the problem manifests.

kennykb added on 2008-04-11 07:54:30:
Logged In: YES 
user_id=99768
Originator: NO

While I committed the change that makes --enable-xft the default, that was on the basis of (a) it's now nearly-universal in Linux distros, and (b) Tk looks like hell without it. Beyond those two factoids, I'm extremely ignorant of what goes on inside. (If it were the *non*-Xft build failing, I'd feel more competent to have a look.)

Referring to someone who might have a clue how to approach debugging this.

dgp added on 2008-04-11 01:29:04:
Logged In: YES 
user_id=80530
Originator: YES


Ok, now I think 1712081 has nothing to
do with it, so withdraw that claim first.

The trouble first arises with
Kevin Kenny's 2006-11-27 commit to
unix/configure(.in).

All that change really does, though, is
to change from a --disable-xft default
build to a --enable-xft default build
in my current test environment.

Sure enough if I force a --disable-xft
build of Tk 8.5-HEAD, and use that, the
problem goes away.

dgp added on 2008-04-10 03:58:38:
Logged In: YES 
user_id=80530
Originator: YES


Haven't fully tracked it down yet, but
the saga of 1712081 is involved somehow.

dgp added on 2008-04-10 02:48:28:
Logged In: YES 
user_id=80530
Originator: YES


This appears to be the same issue:

http://objectmix.com/tcl/250971-bug-8-5b1.html