Hello
I develop a small widget with AHK. It's an OSD for a brand of pro audio hardware. The OSD uses open sound control and has user assigned hotkeys for various functions. It's simple but it's complex too.
I have one user that gets a full machine lockup sometimes, requiring a hard power off. Nasty! I'm freaking out that it will be more than this one user and someone will kill their SSD hard powering off.
One time, this user got the "71 hotkeys have been received in the last .. " dialogue box as the machine became unresponsive. In all the thousands of times I've run the app, I've never seen this issue.
I'm not sure how to proceed to find the root cause. The nature of it and recovery means collecting helpful debug information from the user has got low probability of success. Even logging every function with a timestamp to a text file might change the execution enough that it masks the root cause.
Also, I would of thought any AHK lockup should still not prevent Ctrl-Alt-Del from getting into the task manager. BTW, the mouse and keyboard hooks are installed in the script.
Does anyone have any amazing ideas on strategy for me?
Cheers
Finding a really nasty bug
-
- Posts: 36
- Joined: 09 Sep 2017, 01:51
- Location: Aotearoa
- Contact:
Re: Finding a really nasty bug
Check your CPU usage. If it’s pegged, it can cause things to grind to a halt.
-
- Posts: 36
- Joined: 09 Sep 2017, 01:51
- Location: Aotearoa
- Contact:
Re: Finding a really nasty bug
Have the user that encounters the crash monitor his CPU usage.
-
- Posts: 36
- Joined: 09 Sep 2017, 01:51
- Location: Aotearoa
- Contact:
Re: Finding a really nasty bug
I will see if he can. Thanks.
Re: Finding a really nasty bug
what is a "full machine lockup" (as if im supposed to take this as existing established terminology at face value)? does he get "full machine lockups" when not running ur script? do u even know what ure u trying to troubleshoot? a garbage pc or ur script?
this P needs to be quoted. otherwise, its not doing what u think its doing
ok. this may or may not be indicative of a problem. if ur keyboard has too fast an auto-repeat(some mechanical macro keyboards do), u may exceed the default "70 keys in the last 2000ms" threshold if u hold down a key thats bound to some hotkey. this isnt necessarily an error. A_HotkeyInterval and A_MaxHotkeysPerInterval are sorta safeguards against a::Send a-type noob code that is oblivious to the impending recursion. though, i could imagine how if the system is laggy and the guy is holding down ur hotkeys, they may be buffered and then processed all at once whenever the system unlags itself, prompting the warning. or maybe ur script is stuck in a blocking call to something(eg WinHttpRequest with poor connectivity; some OnMessage handler; some OSC2AHK internals) and the guy is holding down hotkeys, whenever the script regains control, all buffered input will again be processed at the same time, prompting the warning.One time, this user got the "71 hotkeys have been received in the last .. " dialogue box as the machine became unresponsive.
it doesnt. what gave u that idea?I would of thought any AHK lockup should still not prevent Ctrl-Alt-Del from getting into the task manager.
Code: Select all
if !GetKeyState("LButton", P)
-
- Posts: 36
- Joined: 09 Sep 2017, 01:51
- Location: Aotearoa
- Contact:
Re: Finding a really nasty bug
Hi swagfag
Thanks for your response, and the schooling. I dug for more information over several emails. But finally I struck a good seam of information, and I already had growing suspicions as my app doesn't actually do any Sending, though it does have a bunch of hotkeys. It turns out my user has two keyboards connected, one of which is a bit experimental, with an Arduino controller, and occasionally "unstable" firmware. My user managed to trigger this "full machine lock-up" without my app running, though assigning a hotkey in the app seemed to have some relation to prior iterations of the issue. Anyway, I'm pretty satisfied now that something on his system like this keyboard is the source of the problem. So from me to the AHK community, a mea culpa for a false alarm. I think I had been staring at too much code for too long....
As an aside, I've used ChatGPT a couple of times in the last few days to help me understand a few of the more obscure facilities in AHK. Strange times....
Thanks again
Thanks for your response, and the schooling. I dug for more information over several emails. But finally I struck a good seam of information, and I already had growing suspicions as my app doesn't actually do any Sending, though it does have a bunch of hotkeys. It turns out my user has two keyboards connected, one of which is a bit experimental, with an Arduino controller, and occasionally "unstable" firmware. My user managed to trigger this "full machine lock-up" without my app running, though assigning a hotkey in the app seemed to have some relation to prior iterations of the issue. Anyway, I'm pretty satisfied now that something on his system like this keyboard is the source of the problem. So from me to the AHK community, a mea culpa for a false alarm. I think I had been staring at too much code for too long....
As an aside, I've used ChatGPT a couple of times in the last few days to help me understand a few of the more obscure facilities in AHK. Strange times....
Thanks again