We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 450

Summary: Key input goes wild under some conditions
Product: SDL Reporter: Alissa_Sabre
Component: eventsAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: matsuu
Version: HG 1.2   
Hardware: x86   
OS: Linux   
Bug Depends on: 429    
Bug Blocks:    
Attachments: The patch against SVN #3136 of SDL-1.2 branch

Description Alissa_Sabre 2007-07-04 06:51:09 UTC
On SDL 1.2 (SVN #3114 or later, i.e., after the version that merged my patch to bug #429), when the following conditions are met, the key input goes wild.  It sometimes crashes the application with segmentation fault.  It is caused by a bug introduced by my patch (sorry!).

CONDITIONS:

SCIM (one of major input method subsystem) is installed and properly configured, but SCIM process is not started.  A user set XMODIFIERS environment variable as "@im=SCIM".

OBSERVED BEHAVIOUR:

Depending on the application, one or more of the following behaviours may occure:

- the application receives random keysym when a user presses a key.
- the application keeps receiving auto-repeated KeyDown events even after a user released the key.
- the application crashes by segmentation fault.

CAUSE:

My patch for the bug #429 contains a code that passes uninitialized SDL keysym (allocated on  stack frame) when the above condition is met.  (This bug may be triggered by other conditions.)  Proper initialization of the variable solve the issue.
Comment 1 Alissa_Sabre 2007-07-04 06:54:21 UTC
Created attachment 218 [details]
The patch against SVN #3136 of SDL-1.2 branch 

This patch fixes the issue.  It is against the latest (as of July 4 13:50 GMT) SVN source file on SDL-1.2 branch.
Comment 2 Sam Lantinga 2007-07-04 08:23:40 UTC
This patch has been checked into subversion.  Thanks!