tulskiy / jkeymaster

A library for registering global hotkeys in java with JNA. The goal is to support X11-based platforms, Windows and MacOSX
GNU Lesser General Public License v3.0
234 stars 45 forks source link

A bug for run in MacOSX 10.5.8 #2

Closed duomeng1314 closed 13 years ago

duomeng1314 commented 13 years ago

Hello:

    I'm sorry to tell you, it seems that I found a bug when jKeymaster run in real macbook. So now ,I will list this bug.

    first, i open this project in eclipse, run the AWTTest.java. and then Grab the "Ctrl Alt D"
    some tips:
            2011-8-21 17:01:35 com.tulskiy.keymaster.osx.CarbonProvider$1 run
            信息: Starting OSX global hotkey provider
            2011-8-21 17:01:39 com.tulskiy.keymaster.osx.CarbonProvider resetAll
            信息: Resetting hotkeys
            2011-8-21 17:01:39 com.tulskiy.keymaster.osx.CarbonProvider register
            信息: Registered hotkey: ctrl alt pressed D
    when press down "Ctrl Alt D", have a error:
           2011-8-21 17:45:47 com.tulskiy.keymaster.osx.CarbonProvider$EventHandler callback
           信息: Received event id: 1
           Invalid memory access of location 0x7fff5f3f58d0 rip=0x7fff80bb2d07
    second:
    set a breakpoint on :   
           carbonProvider.java   
           185:    private class EventHandler implements Carbon.EventHandlerProcPtr {
           ……
           196:     return 0   
    Single-step debugging: and some Thread information as follows:
           CarbonProvider$EventHandler.callback(Pointer, Pointer, Pointer) 行: 196
           NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) 行: 不可用 [本机方法]
           NativeMethodAccessorImpl.invoke(Object, Object[]) 行: 39
           DelegatingMethodAccessorImpl.invoke(Object, Object[]) 行: 25
           Method.invoke(Object, Object...) 行: 597
           CallbackReference$DefaultCallbackProxy.invokeCallback(Object[]) 行: 394
           CallbackReference$DefaultCallbackProxy.callback(Object[]) 行: 424
    when the Thread go to
           CallbackReference$DefaultCallbackProxy.invokeCallback(Object[]) 行: 394
           CallbackReference$DefaultCallbackProxy.callback(Object[]) 行: 424
    then: when pass the                 CallbackReference$DefaultCallbackProxy.callback(Object[]) 行: 424
          the Thread go in the AWTAutoShutdown.notifyToolkitThreadFree() 行: 130 [没有局部变量可用]
    and Then will be error:       Invalid access of stack red zone 0x7fff5f400a40 rip=0x7fff80bb2d07

At the end : I will be continue debug it ; I hope you can give some solutions . Thank you very much!

tulskiy commented 13 years ago

Hello,

Can you reproduce the problem outside of eclipse, i.e. when you build the project from maven and run from command line?

duomeng1314 commented 13 years ago

Hello,

I test the project use maven, there are similar problems. test as follow:

fjhdemacbook:JKey root# java -jar jkeymaster-1.0-SNAPSHOT.jar Aug 22, 2011 10:27:14 PM com.tulskiy.keymaster.osx.CarbonProvider$1 run INFO: Installing Event Handler Aug 22, 2011 10:27:25 PM com.tulskiy.keymaster.osx.CarbonProvider resetAll INFO: Resetting hotkeys Aug 22, 2011 10:27:25 PM com.tulskiy.keymaster.osx.CarbonProvider register INFO: Registered hotkey: ctrl alt pressed D Aug 22, 2011 10:27:35 PM com.tulskiy.keymaster.osx.CarbonProvider$EventHandler callback INFO: Received event id: 1 Invalid access of stack red zone 0xbf800ff0 eip=0x9598f205 Segmentation fault

The other buttons is same

fjhdemacbook:JKey root# java -jar jkeymaster-1.0-SNAPSHOT.jar Aug 22, 2011 10:30:14 PM com.tulskiy.keymaster.osx.CarbonProvider$1 run INFO: Installing Event Handler Aug 22, 2011 10:30:21 PM com.tulskiy.keymaster.osx.CarbonProvider resetAll INFO: Resetting hotkeys Aug 22, 2011 10:30:21 PM com.tulskiy.keymaster.osx.CarbonProvider register INFO: Registered hotkey: pressed G Aug 22, 2011 10:30:24 PM com.tulskiy.keymaster.osx.CarbonProvider$EventHandler callback INFO: Received event id: 1 Invalid access of stack red zone 0xbf800ff0 eip=0x9598f205 Segmentation fault fjhdemacbook:JKey root#

the test jar file is download from https://github.com/tulskiy/jkeymaster

tulskiy commented 13 years ago

Are you on a 64-bit system? Try the latest build from here: https://github.com/tulskiy/jkeymaster/blob/gh-pages/maven/com/tulskiy/jkeymaster/1.0/jkeymaster-1.0.jar

duomeng1314 commented 13 years ago

No, the system is 32-bit! the latest build version have the same problem. The detail information about my macbook: Darwin fjhdemacbook.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

tulskiy commented 13 years ago

Seems like it's a problem with osx java. Are you running an intel-based mac or powerpc? Also, please post your java version.

duomeng1314 commented 13 years ago

It's an intel-based mac,the java version is 1.5.0_30. My macbook model is A1181.

duomeng1314 commented 13 years ago

Yes, you are right! I‘m try it with java 1.6.0_25 on macosx10.6.8 and running normal. Thanks for your help!(^o^)/~ Best wishes for you!

tulskiy commented 13 years ago

So it must be the problem with java 1.5. Try increasing stack size with -Xss1m