LeVanPhuUIT / jnativehook

Automatically exported from code.google.com/p/jnativehook
0 stars 0 forks source link

Errors/Crash on OS X on key events #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Sometimes, when using JNativeHook for keyboard input on OS X, after a while of 
normal operation, it starts giving errors and finally crashes the application. 
Unfortunately this is not easily reproducible, sometimes it happens, sometimes 
not.

However, when it does happen, it starts by giving errors and also stopping 
other UIs from receiving keyboard input (e.g. Swing), even though they use 
their own input mechanism (i.e. not JNativeHook). Whenever a key is pressed, 
the following error messages are produced:

...
2012-09-23 19:49:22.412 java[9501:903] Exception detected while handling key 
input.
2012-09-23 19:49:22.414 java[9501:903] TSMProcessRawKeyCode failed (-192)
2012-09-23 19:49:22.459 java[9501:903] TSMProcessRawKeyCode failed (-192)
2012-09-23 19:49:22.475 java[9501:903] TSMProcessRawKeyCode failed (-192)
2012-09-23 19:49:22.499 java[9501:903] Exception detected while handling key 
input.
2012-09-23 19:49:22.499 java[9501:903] TSMProcessRawKeyCode failed (-192)
2012-09-23 19:49:22.555 java[9501:903] TSMProcessRawKeyCode failed (-192)
2012-09-23 19:49:22.619 java[9501:903] Exception detected while handling key 
input.
2012-09-23 19:49:22.619 java[9501:903] TSMProcessRawKeyCode failed (-192)
2012-09-23 19:49:22.683 java[9501:903] TSMProcessRawKeyCode failed (-192)
...

After some time or when trying to close the program or do something else, it 
crashes with the following message:

Invalid memory access of location 0x0 rip=0x7fff8a360820

The Mac OS X crash report contains the following (the full crash report is 
attached):

Process:         java [9501]
Path:            /usr/bin/java
Identifier:      com.apple.javajdk16.cmd
Version:         1.0 (1.0)
Code Type:       X86-64 (Native)
Parent Process:  eclipse [8467]

Date/Time:       2012-09-23 19:49:43.978 +0200
OS Version:      Mac OS X 10.6.8 (10K549)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Application Specific Information:

Java information:
 Exception type: Bus Error (0xa) at pc=7fff8a360820

 Java VM: Java HotSpot(TM) 64-Bit Server VM (20.10-b01-428 mixed mode macosx-amd64)

Current thread (101ebd800):  JavaThread "AWT-AppKit" daemon [_thread_in_native, 
id=1897741504, stack(7fff5f400000,7fff5fc00000)]
Stack: [7fff5f400000,7fff5fc00000]

Java Threads: ( => current thread )
  101b90000 JavaThread "pool-1-thread-1" [_thread_blocked, id=529076224, stack(11f791000,11f891000)]
  10242f000 JavaThread "TimerQueue" daemon [_thread_blocked, id=528015360, stack(11f68e000,11f78e000)]
  101940000 JavaThread "Thread-6" [_thread_in_native, id=526954496, stack(11f58b000,11f68b000)]
  101b8f800 JavaThread "Thread-5" [_thread_in_native, id=525893632, stack(11f508000,11f588000)]
  101aa6000 JavaThread "Thread-4" [_thread_in_native, id=525357056, stack(11f405000,11f505000)]
  10260d000 JavaThread "Thread-3" [_thread_blocked, id=524296192, stack(11f302000,11f402000)]
  101aa5000 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=515964928, stack(11eb10000,11ec10000)]
  101a55000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=514904064, stack(11ea0d000,11eb0d000)]
  101ebe000 JavaThread "AWT-Shutdown" [_thread_blocked, id=466092032, stack(11bb80000,11bc80000)]
=>101ebd800 JavaThread "AWT-AppKit" daemon [_thread_in_native, id=1897741504, 
stack(7fff5f400000,7fff5fc00000)]
  1025d4800 JavaThread "RMI TCP Accept-1099" daemon [_thread_in_native, id=178782208, stack(10a980000,10aa80000)]
  1021ba800 JavaThread "GC Daemon" daemon [_thread_blocked, id=176484352, stack(10a74f000,10a84f000)]
  102203800 JavaThread "RMI Reaper" [_thread_blocked, id=175423488, stack(10a64c000,10a74c000)]
  102203000 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=174362624, stack(10a549000,10a649000)]
  1018dd000 JavaThread "Poller SunPKCS11-Darwin" daemon [_thread_blocked, id=173228032, stack(10a434000,10a534000)]
  10180e800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=167849984, stack(109f13000,10a013000)]
  10180e000 JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=166789120, stack(109e10000,109f10000)]
  10180d000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=165728256, stack(109d0d000,109e0d000)]
  10180c800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=164667392, stack(109c0a000,109d0a000)]
  1020a8000 JavaThread "Surrogate Locker Thread (Concurrent GC)" daemon [_thread_blocked, id=163606528, stack(109b07000,109c07000)]
  102099000 JavaThread "Finalizer" daemon [_thread_blocked, id=160342016, stack(1097ea000,1098ea000)]
  101802800 JavaThread "Reference Handler" daemon [_thread_blocked, id=159281152, stack(1096e7000,1097e7000)]
  102001000 JavaThread "main" [_thread_in_native, id=5246976, stack(100401000,100501000)]
Other Threads:
  102096800 VMThread [stack: 1095e4000,1096e4000] [id=158220288]
  101818000 WatcherThread [stack: 10a016000,10a116000] [id=168910848]

VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None

Heap
 par new generation   total 19136K, used 7353K [7f3000000, 7f44c0000, 7f44c0000)
  eden space 17024K,  34% used [7f3000000, 7f35a8a18, 7f40a0000)
  from space 2112K,  73% used [7f42b0000, 7f4435ba0, 7f44c0000)
  to   space 2112K,   0% used [7f40a0000, 7f40a0000, 7f42b0000)
 concurrent mark-sweep generation total 63872K, used 3288K [7f44c0000, 7f8320000, 7fae00000)
 concurrent-mark-sweep perm gen total 31808K, used 31741K [7fae00000, 7fcd10000, 800000000)

Code Cache  [103801000, 103a72000, 106801000)
 total_blobs=924 nmethods=375 adapters=511 free_code_cache=48956928 largest_free_block=6912

Virtual Machine Arguments:
JVM Args: -Djava.rmi.server.logCalls=false -Dsun.rmi.client.logCalls=false 
-Dfile.encoding=UTF-8 
Java Command: <REMOVED>
Launcher Type: SUN_STANDARD
Physical Memory: Page Size = 4k, Total = 3840M, Free = 936M

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   com.apple.CoreFoundation        0x00007fff8a360820 CFBooleanGetValue + 80
1   com.apple.HIToolbox             0x00007fff81c53883 
_CreateKeyboardInputSourcesArray_Mutable + 495
2   com.apple.HIToolbox             0x00007fff81c571f0 
_CreateKeyboardInputSourcesArray + 26
3   com.apple.HIToolbox             0x00007fff81c5702f 
SectSelectableInputSourcesArrayFromCurrentState + 75
4   com.apple.HIToolbox             0x00007fff81c4f701 MyActivateTSMDocument + 
587
5   com.apple.HIToolbox             0x00007fff81c4f4b3 ActivateTSMDocument + 9
6   com.apple.AppKit                0x00007fff82379ab7 -[NSTextInputContext 
activate] + 191
7   com.apple.AppKit                0x00007fff82353758 +[NSTextInputContext 
currentInputContext] + 284
8   libawt.jnilib                   0x000000010b82f145 -[NSViewAWT mouseDown:] + 
68
9   com.apple.AppKit                0x00007fff8244b3a7 -[NSWindow sendEvent:] + 
5409
10  libawt.jnilib                   0x000000010b8273d0 -[CocoaAppWindow 
sendEvent:] + 185
11  com.apple.AppKit                0x00007fff82380afa -[NSApplication 
sendEvent:] + 4719
12  com.apple.AppKit                0x00007fff823176de -[NSApplication run] + 474
13  libawt.jnilib                   0x000000010b802158 +[AWTStarter startAWT:] + 
1495
14  libawt.jnilib                   0x000000010b801ad2 -[CPerformer perform] + 93
15  com.apple.Foundation            0x00007fff8710c45f __NSThreadPerformPerform 
+ 219
16  com.apple.CoreFoundation        0x00007fff8a3693d1 __CFRunLoopDoSources0 + 
1361
17  com.apple.CoreFoundation        0x00007fff8a3675c9 __CFRunLoopRun + 873
18  com.apple.CoreFoundation        0x00007fff8a366d8f CFRunLoopRunSpecific + 575
19  java                            0x000000010000483f 0x100000000 + 18495
20  java                            0x0000000100004296 0x100000000 + 17046
21  java                            0x0000000100001a94 0x100000000 + 6804

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000400  rbx: 0x0000000000000000  rcx: 0x00007fff712393c8  rdx: 0x0000000000000015
  rdi: 0x0000000000000000  rsi: 0x00000000ffffffff  rbp: 0x00007fff5fbfd1c0  rsp: 0x00007fff5fbfd1b0
   r8: 0x00000001001fc0a0   r9: 0x00000001001fc0a4  r10: 0x0000000000000021  r11: 0x00000001001edff8
  r12: 0x0000000000000000  r13: 0x00000001001f18c0  r14: 0x0000000000000001  r15: 0x0000000000000000
  rip: 0x00007fff8a360820  rfl: 0x0000000000010283  cr2: 0x0000000000000000

Original issue reported on code.google.com by simon....@gmail.com on 23 Sep 2012 at 7:00

Attachments:

GoogleCodeExporter commented 8 years ago
Are you comping your self or using the binary provided?

Original comment by a...@1stleg.com on 23 Sep 2012 at 9:05

GoogleCodeExporter commented 8 years ago
Sorry, I forgot to mention that: I am using the binary, version 1.1.0

Original comment by simon....@gmail.com on 24 Sep 2012 at 12:14

GoogleCodeExporter commented 8 years ago
And if it helps, I have used 1.0.2288 before that and it worked pretty well (no 
errors or crashes).

Original comment by simon....@gmail.com on 24 Sep 2012 at 12:15

GoogleCodeExporter commented 8 years ago
I took a look though the code and found a few problems, but I doubt that any of 
them caused this problem.  

I have attached jar with debugging enabled.  It should output a lot of 
information to the console and support gdb.  If you can please run the jar from 
the terminal and keep track of the output by keeping an eye on it or by 
redirecting stderr to a file (Ex java -jar JNativeHook.jar 2>./error.log)

If you have gdb installed it would really help to monitor the jni process id.  
You can accomplish that by running the following commands in a terminal

ps aux | grep java
gdb -p <PID>

Where <PID> is the first number from the left, right after your account name. 
Wait for a while.  Type continue at the (gdb) prompt.  After it crashes type 
backtrace to get some useful information.

Original comment by a...@1stleg.com on 28 Sep 2012 at 3:58

Attachments:

GoogleCodeExporter commented 8 years ago
Have you been able to reproduce the problem?  I have run a battery of tests for 
the past 3 days without any stability issues.

Original comment by a...@1stleg.com on 4 Oct 2012 at 3:38

GoogleCodeExporter commented 8 years ago
Sorry, I haven't been able to test the debugging jar yet. I am kind of busy 
with other stuff at the moment, so it might take a few more days until I can 
give it a try. I will post a comment when I tested it.

Original comment by simon....@gmail.com on 4 Oct 2012 at 12:43

GoogleCodeExporter commented 8 years ago
No problem, take your time.  I just cant seem to produce any instability on my 
test systems which leads me to believe the problem maybe caused by the 
interaction with something on your system.  Let me know when you have a chance 
to test.  Thanks again.

Original comment by a...@1stleg.com on 6 Oct 2012 at 6:13

GoogleCodeExporter commented 8 years ago
I have this issue too now

Original comment by silverar...@kingsleys.org on 26 Oct 2012 at 12:56

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I really need a fix by tomorrow, cus i need to finish this for a deadline, my 
log is attached, plz reply soon.

Original comment by silverar...@kingsleys.org on 26 Oct 2012 at 2:01

Attachments:

GoogleCodeExporter commented 8 years ago
I have been unable to duplicate this problem after extensive testing.  What 
versions have you tried?  Is this occurring with 1.1.1?

Do you have steps to consistently produce the crash?  

Can you provide more detailed crash information?  

What happens before and after "IsNativeThreadRunning(): Failed to acquire 
control mutex lock!"? 

Does it crash the JVM?  If so, did you find a crash report?

Can you attach gdb to the process for additional information? 

Original comment by a...@1stleg.com on 26 Oct 2012 at 4:36

GoogleCodeExporter commented 8 years ago
I will be on google talk at my email address and #JNativeHook@chat.freenode.net 
all day.  It will probably be faster to discuss the problem live.

Original comment by a...@1stleg.com on 26 Oct 2012 at 4:54

GoogleCodeExporter commented 8 years ago
Ok, I finally got to test with the debugging jar and also with the latest 
release (1.1.1). I could reproduce the issue with both versions. I have 
attached a gdb backtrace as well as the debugging output of the provided jar 
(it has about 3000 messages, however, most of it is just me pressing keys and 
moving the mouse until the problem occurs; I have not removed anything, so this 
is all I got). There are a few things I have noticed:

 - As soon as the "Exception detected while handling key input." and "TSMProcessRawKeyCode failed (-192)" messages start to occur, no keyboard input is possible in my application anymore, even though I am not using JNativeHook for that, just plain Swing components. Strangely, the backspace key still works!

 - The crash (due to a null pointer) only happens when I finally try to close my swing application. The program/JVM does not crash on its own (at least I did not see this during my tests).

 - The backtrace is pretty much the same I get from the Mac OS X crash report (see the crashed thread's stacktrace in my original report).

I am currently using version 1.0.2288 as a fallback and it works perfectly 
without any issues (so, silverarrow2301, you might use this version instead; 
the API has changed slightly, but really simple to replace).

Original comment by simon....@gmail.com on 26 Oct 2012 at 7:27

Attachments:

GoogleCodeExporter commented 8 years ago
Does this error occur if eclipse is not running?  Based what you have provided 
it looks like something outside of JNativeHook is crashing.  It maybe caused by 
JNativeHook but the crash occurs elsewhere.

Original comment by a...@1stleg.com on 26 Oct 2012 at 7:47

GoogleCodeExporter commented 8 years ago
I have done extensive testing with eclipse and other applications and I still 
cannot trigger this error.  I am fairly confident that this error is not 
occurring in JNativeHook, and if the library is even involved, it is causing 
another application to crash (JVM?).  The only good news in this whole thing is 
that IF the library is involved I believe it has something to do with the key 
typed events.  I have attached a build with extensive output around the key 
type native code so I can try and get a better idea of where and possibly why 
the code is causing a crash.  I did plug a small memory leak but I doubt it 
would cause the error you are seeing.  I am not sure what else to do as the 
stack trace and error logs are not really giving me much to go on.

The only thing reason I can think of as to why I cant reproduce this error is a 
setting or something corrupt in /Library/Caches or ~/Library.  Some people 
reported /Library/Caches/com.apple.IntlData* being corrupt as the cause of this 
type of error.  If you have some extra type take a look for 
/Library/Caches/com.apple.IntlData*.  If you don't have anything suspicious in 
/Library/Caches try creating a new user account and testing with that user.  
That should give you a fresh ~/Library location.  If you cannot duplicate the 
error with the new user start copying over the folder from your original user 
to the ~/Library location until the crash occurs.  I am guessing its probably 
something with the preferences keyboard layout or input methods, so start there.

Original comment by a...@1stleg.com on 26 Oct 2012 at 10:51

Attachments:

GoogleCodeExporter commented 8 years ago
Sorry to cause you so much trouble, but the problem still occurs, no matter if 
I start my application

 - from within Eclipse
 - from the command line
 - from the command line using a fresh user account

I created a new user account as you suggested and the only thing I did was 
copying my java application to its home directory, so I could do some testing 
there. I checked the /Library/Caches as well as ~/Library for the mentioned 
com.apple.IntlData*, but there is no file of that pattern.

Using the latest debug jar, I could reproduce the error using the new user 
account and got this for every key I pressed when it still worked fine:

LowLevelProc(): Calling KeyCodeToString(38, 0x0)
KeyCodeToString(): Calling TISCopyCurrentKeyboardLayoutInputSource()
KeyCodeToString(): Return TISCopyCurrentKeyboardLayoutInputSource()
KeyCodeToString(): TISCopyCurrentKeyboardLayoutInputSource() is OK!
KeyCodeToString(): Calling TISGetInputSourceProperty(...)
KeyCodeToString(): Return TISGetInputSourceProperty(...)
KeyCodeToString(): TISGetInputSourceProperty(...) is OK!
KeyCodeToString(): Calling UCKeyTranslate(...)
KeyCodeToString(): Return UCKeyTranslate(...)
KeyCodeToString(): UCKeyTranslate(...) is OK!
KeyCodeToString(): Calling CFStringCreateWithCharacters(...)
KeyCodeToString(): Return CFStringCreateWithCharacters(...)
KeyCodeToString(): Calling CFRelease(keyboard_ref)
KeyCodeToString(): Return CFRelease(keyboard_ref)
LowLevelProc(): Return KeyCodeToString()
LowLevelProc(): Calling CFStringGetLength(...)
LowLevelProc(): Return CFStringGetLength(...)
LowLevelProc(): Calling CFRelease(keytxt)
LowLevelProc(): Return CFRelease(keytxt)
LowLevelProc(): 

When it started to fail, it produces the following messages for every key 
pressed:

LowLevelProc(): Calling KeyCodeToString(38, 0x0)
KeyCodeToString(): Calling TISCopyCurrentKeyboardLayoutInputSource()
KeyCodeToString(): Return TISCopyCurrentKeyboardLayoutInputSource()
KeyCodeToString(): TISCopyCurrentKeyboardLayoutInputSource() is OK!
KeyCodeToString(): Calling TISGetInputSourceProperty(...)
KeyCodeToString(): Return TISGetInputSourceProperty(...)
KeyCodeToString(): Calling CFRelease(keyboard_ref)
KeyCodeToString(): Return CFRelease(keyboard_ref)
LowLevelProc(): Return KeyCodeToString()
LowLevelProc(): Calling CFStringGetLength(...)
LowLevelProc(): 
2012-10-27 13:59:32.513 java[12199:1707] Exception detected while handling key 
input.
2012-10-27 13:59:32.514 java[12199:1707] TSMProcessRawKeyCode failed (-192)
2012-10-27 13:59:32.553 java[12199:1707] TSMProcessRawKeyCode failed (-192)

So, it seems to have something to do with CFStringGetLength or maybe 
KeyCodeToString? It might also explain why any non-visible key (backspace, 
arrow keys) still work.

Again, it does not crash the application/JVM immediately, only when I try to 
close it by clicking the red button on my app's window. I also had one test 
run, where it did not crash at all after key input stopped working, but I could 
not reproduce it. So I think the crash is not the main issue here, as it only 
occurs when Swing or the native toolkit behind it tries to free its resources 
(I guess).

Also, note that when the errors start, JNativeHook still delivers key events 
just fine, only Swing does not get any input. Other applications also still get 
key input and JNativeHook processes those inputs fine. Seems to be something in 
combination with Swing/AWT.

Original comment by simon....@gmail.com on 27 Oct 2012 at 12:34

GoogleCodeExporter commented 8 years ago
Oh, and to make sure its nothing to do with my application or some other jars 
used by it, I also could reproduce the issue with just starting the 
JNativeHookDemo from the jar itself (java -jar JNativeHook.jar).

Original comment by simon....@gmail.com on 27 Oct 2012 at 12:36

GoogleCodeExporter commented 8 years ago
Thanks Simon!  That output was really helpful.  I am going to dig though it 
today probably have a fix by this afternoon.

Original comment by a...@1stleg.com on 27 Oct 2012 at 3:37

GoogleCodeExporter commented 8 years ago
So I have gone thought the code in question and in theory the problem you are 
having shouldn't be possible.  Its almost like the pointer to the string 
returned by KeyCodeToString() is getting eaten somewhere along the way.  I have 
fix the default value returned by the function and added some paranoid checking 
as a stop gap for now.  This should prevent crashes, however you will stop 
receiving key typed events for an unknown length of time.  More on that in a 
minute.

Please test the attached jar and see if it continues to crash.  The jar will 
print 3 to 4 lines per key press.  If you see a line that reads 
"LowLevelProc(): keytxt is NULL,  THIS SHOULD NOT BE POSSIBLE!" please let me 
know.

For some reason, your system stops being able to acquire the input source 
property for the unicode key layout.  Ex: 
TISGetInputSourceProperty(TISCopyCurrentKeyboardLayoutInputSource(), 
kTISPropertyUnicodeKeyLayoutData) == NULL;  I don't know why this would happen, 
nor do I know how TISGetInputSourceProperty is implemented.  The developer 
documentation allude to the idea that I can retain the value returned by 
TISGetInputSourceProperty instead of looking it up each time but typical of 
Apples API docs, they make no reference as to how one should retain said 
reference.

Original comment by a...@1stleg.com on 27 Oct 2012 at 6:08

Attachments:

GoogleCodeExporter commented 8 years ago
It looks like the property kTISPropertyUnicodeKeyLayoutData only returns NULL 
if there is no layout data, or if the layout data is KCHR.  So either something 
is disabling your keyboard layout or you have a legacy layout that is getting 
set on the fly.

I will need to know if the latest jar stops the crash before I implement a more 
permanent workaround.

Thanks for all of your help with the problem.

Original comment by a...@1stleg.com on 28 Oct 2012 at 4:31

GoogleCodeExporter commented 8 years ago
I tested the latest jar and could reproduce the error, but did not get the 
"keytxt is NULL..." message! This is what I have got by pressing the 'A' key 
several times:

LowLevelProc(): Return CFStringGetLength(...) == 0x0x7fff7040b550
LowLevelProc(): Return CFStringGetLength(...) == 1
[... two such lines per key press ...]
LowLevelProc(): Return CFStringGetLength(...) == 0x0x7fff7040b550
LowLevelProc(): Return CFStringGetLength(...) == 1
LowLevelProc(): Return CFStringGetLength(...) == 0x0x11dbf8380
2012-10-28 20:14:38.054 java[13303:1707] TSMProcessRawKeyCode failed (-192)
LowLevelProc(): Return CFStringGetLength(...) == 0x0x11dbf8380
2012-10-28 20:14:38.157 java[13303:1707] Exception detected while handling key 
input.
2012-10-28 20:14:38.158 java[13303:1707] TSMProcessRawKeyCode failed (-192)
2012-10-28 20:14:38.229 java[13303:1707] TSMProcessRawKeyCode failed (-192)

I really don't know what is going on there. The address (e.g. 0x7fff7040b550) 
is unique for every distinct key, however, as soon as the error occurs, the 
same address is shown for every key. If it helps, I am using the German 
keyboard layout. I also tried switching to another layout (US), but that does 
not seem to make a difference.

Original comment by simon....@gmail.com on 28 Oct 2012 at 7:27

GoogleCodeExporter commented 8 years ago
I also tested it on a different Mac (MacBook Pro 13", mid 2010; mine is a 
MacBook Pro 15", mid 2009) and got the same errors. However, both are running 
Mac OS X 10.6.8, so it only means that it does not has anything to do with my 
particular hardware or software configuration. Maybe Apple changed or fixed 
something in later OS releases.

Original comment by simon....@gmail.com on 28 Oct 2012 at 7:45

GoogleCodeExporter commented 8 years ago
Ok, I was finally able to reproduce a similar problem and I believe I know what 
is causing the problem.  The related documentation isn't particularly good so 
I'm not sure how long it will take.

Original comment by a...@1stleg.com on 29 Oct 2012 at 8:00

GoogleCodeExporter commented 8 years ago

Original comment by a...@1stleg.com on 29 Oct 2012 at 9:33

GoogleCodeExporter commented 8 years ago
I believe I have a workaround for this problem committed at revision 647.  
Although the root cause of this error remains a mystery, I believe I have a 
workaround to prevent the problem from occurring.  I will attach a new jar 
shortly.  Please test and let me know so I can tag 1.1.2 and close the bug.

For anyone curious about this bug; best I can tell calling 
TISGetInputSourceProperty(currentKeyboardLayout, 
kTISPropertyUnicodeKeyLayoutData) repeatedly in short succession is causing a 
null pointer exception somewhere in the JVM.  There is no logical reason that 
this would occur, yet the problem persists immediately after the 
TISGetInputSourceProperty function returns a NULL value.  It is possible that 
this problem maybe resolved in Java 1.7 as previous version are known to 
contain several bugs, however no testing was done to verify that assertion.  If 
anyone has any idea why this problem occurs or stumbles upon a definitive 
solution, please let me know.

Original comment by a...@1stleg.com on 30 Oct 2012 at 11:37

GoogleCodeExporter commented 8 years ago
Jar To Test, Thanks.

Original comment by a...@1stleg.com on 31 Oct 2012 at 12:25

Attachments:

GoogleCodeExporter commented 8 years ago
I did my best to reproduce the bug with the latest jar, but it seems you have 
done your job very well, as I could not get any error to occur.

Original comment by simon....@gmail.com on 1 Nov 2012 at 8:37

GoogleCodeExporter commented 8 years ago
It turns out that this was also partially caused by what I believe was a thread 
safety issue on platforms using POSIX threads, which current covers everything 
except windows.  The problems been resolved in the 1.1 branch and 1.1.2 should 
be ready tonight.  Thanks for all of the help testing.

Original comment by a...@1stleg.com on 5 Nov 2012 at 9:52

GoogleCodeExporter commented 8 years ago

Original comment by a...@1stleg.com on 5 Nov 2012 at 9:53