Tk Source Code

View Ticket
Login
Ticket UUID: 2992129
Title: crash when using Pinyin or Japanese (Hiragana) IME input
Type: Bug Version: obsolete: 8.5.8
Submitter: tsingkong Created on: 2010-04-26 01:23:03
Subsystem: 68. Win Window Operations Assigned To: dkf
Priority: 8 Severity:
Status: Closed Last Modified: 2010-05-21 05:55:03
Resolution: Fixed Closed By: dkf
    Closed on: 2010-05-20 22:55:03
Description:
8.5.8/8.5.8.1 does crash when using Pinyin or Japanese (Hiragana) IME input, which 8.4.19 does function correctly.
OS:WinXP pro with sp3
windows report:
AppName: wish85.exe AppVer: 8.5.2.8 ModName: ntdll.dll
ModVer: 5.1.2600.5755 Offset: 0000120e
User Comments: dkf added on 2010-05-21 05:55:03:

allow_comments - 1

Just needed to have the XEvent structure memset to 0 before use. The OSX code already gets it right; it was already zeroing out XEvents that produce keys.

Fixed in HEAD and 8.5 branch.

hobbs added on 2010-04-27 06:56:14:
I believe that you need to examine how tkWinKey.c:TkpGetString was already using a similar trick (with send_event == -2) to store the translated char.  However, I'm concerned that this overloading simply isn't safe as currently written.  Is there no way to have a Key(Press|Release) event that doesn't go through TkpGetString?  On Unix, this would possibly cause a crash as well, as the extended values are not used anywhere.  In addition, OS X doesn't seem to have any checks for this.

I think this patch needs to be reconsidered and better factored for cross-platform safety.

hobbs added on 2010-04-27 06:47:14:
This apparently was introduced 2010-01-01 by DKF in introducing the TkKeyEvent.  This is never initialized on Windows, thus the tkEvent.c:CleanUpTkEvent check for NULL will randomly fire and free unallocated memory.