Issue 112925 - Under load, characters are displayed in a different order from typed
Summary: Under load, characters are displayed in a different order from typed
Status: CONFIRMED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOo 3.2.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-05 11:27 UTC by petia
Modified: 2013-01-29 21:50 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description petia 2010-07-05 11:27:30 UTC
When under high CPU load, OpenOffice apparently has some issue with the event
queue: keystrokes are not displayed in the order typed (so words are completely
mangled).

An easy way to reproduce this is to start a new document with command-N and
begin typing immediately. This gives for example:

Ona llitSther test

for "Still another test".
Note that the keystroke order is reversed for the initial 9 characters. In more
complex load cases, such as when background processes suddenly and
intermittently take up CPU, more "creative" character queue botches can be
evidenced. 

(FYI my machine has a dual-core CPU).
Comment 1 eric.savary 2010-07-29 14:00:14 UTC
Cannot reproduce.

@PL: can you please investigate this a little? Thanx!
Comment 2 yajva 2010-08-10 13:58:51 UTC
Hi
The problem can be reproduced in 2 ways.
Method 1.
 Here's a simple macro to illustrate the behaviour. It creates a key handler and 
waits for 10 secs to exit
The keyhandler idles counting for 99999 counts before returning hence not 
allowing OO to handle key immediately (simulating load).

Open a writer doc, run the macro and type 'abcdef' immediately . You will see 
that after a while the text output will be 'fedcba'.


===============================================================================
sub	keyreverse
oKeyHandler = 
CreateUnoListener("KeyReverseHandler_","com.sun.star.awt.XKeyHandler")
ThisComponent.GetCurrentController.addKeyHandler(oKeyHandler)
wait 10000
msgbox "done"
end sub


Function KeyReverseHandler_keyPressed(oKeyEvent as new 
com.sun.star.awt.KeyEvent) as boolean
		for i = 1 to 99999
		KeyHandler_keyPressed = False
		next i
End Function


Function KeyReverseHandler_keyReleased(oKeyEvent as new 
com.sun.star.awt.KeyEvent) As Boolean

	KeyHandler_keyReleased = False
End Function


Sub KeyReverseHandler_disposing
End Sub

==============================================================



Method 2. Install 'ShortKeys Lite' (a shortcut handling software) and create a 
shortcut for '-' on the num pad and assign to 'abcdef'. Open a writer doc and 
press '-' on the numpad. The output will be 'fedcba'.

Regards
yajva
Comment 3 philipp.lohmann 2010-11-10 16:39:43 UTC
confirmed (using the macro)
Comment 4 philipp.lohmann 2010-11-10 16:40:31 UTC
taking
Comment 5 philipp.lohmann 2010-11-10 17:05:43 UTC
however this is not mac specific at all, happens the same on other platforms
(tested Linux), also not limited to writer, happens the same e.g. in calc.

@cd: ThisComponent.GetCurrentController is probably more your area of expertise ?