Finding a really nasty bug

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
potscrubber
Posts: 36
Joined: 09 Sep 2017, 01:51
Location: Aotearoa
Contact:

Finding a really nasty bug

10 Feb 2023, 02:57

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? :wtf: :D

Cheers
User avatar
boiler
Posts: 17279
Joined: 21 Dec 2014, 02:44

Re: Finding a really nasty bug

10 Feb 2023, 03:05

Check your CPU usage. If it’s pegged, it can cause things to grind to a halt.
potscrubber
Posts: 36
Joined: 09 Sep 2017, 01:51
Location: Aotearoa
Contact:

Re: Finding a really nasty bug

10 Feb 2023, 03:10

boiler wrote:
10 Feb 2023, 03:05
Check your CPU usage. If it’s pegged, it can cause things to grind to a halt.
Thanks. The CPU usage seems just fine, but I have never seen the bug happen, and the user claims they can't even Ctl-Alt-Del when it happens.
User avatar
boiler
Posts: 17279
Joined: 21 Dec 2014, 02:44

Re: Finding a really nasty bug

10 Feb 2023, 03:12

Have the user that encounters the crash monitor his CPU usage.
potscrubber
Posts: 36
Joined: 09 Sep 2017, 01:51
Location: Aotearoa
Contact:

Re: Finding a really nasty bug

10 Feb 2023, 04:37

I will see if he can. Thanks.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Finding a really nasty bug

11 Feb 2023, 21:10

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?
One time, this user got the "71 hotkeys have been received in the last .. " dialogue box as the machine became unresponsive.
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.
I would of thought any AHK lockup should still not prevent Ctrl-Alt-Del from getting into the task manager.
it doesnt. what gave u that idea?

Code: Select all

		if !GetKeyState("LButton", P)
this P needs to be quoted. otherwise, its not doing what u think its doing
potscrubber
Posts: 36
Joined: 09 Sep 2017, 01:51
Location: Aotearoa
Contact:

Re: Finding a really nasty bug

12 Feb 2023, 21:27

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

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: aseiot, Bing [Bot], Descolada, j4byers, ntepa and 129 guests