[SOLVED] WebApp.Ahk crash on key spam

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Stavencross
Posts: 90
Joined: 24 May 2016, 16:42

[SOLVED] WebApp.Ahk crash on key spam

18 May 2018, 11:11

I'm using Joedf's webApp.ahk library to run an HTML GUI for my AHK app.
When trying to type into a HTML textbox/text area, if there are to many keys typed to quickly, autohotkey will experience a fatal error, it will almost completely freeze the entire system.

Code: Select all

Faulting application name: Eclipse.exe, version: 1.0.0.25, time stamp: 0x5a509bb7
Faulting module name: MSHTML.dll, version: 11.0.16299.371, time stamp: 0x55561f7e
Exception code: 0xc0000602
Fault offset: 0x000000000055c329
Faulting process id: 0x6eac
Faulting application start time: 0x01d3eebf5a7c1580
Faulting application path: C:\Users\chris.miller1\Box Sync\Eclipse - personal\vdrive\web\Eclipse.exe
Faulting module path: C:\WINDOWS\SYSTEM32\MSHTML.dll
Report Id: c3bd0b49-5020-4c25-9099-64785e97130a
Faulting package full name: 
Faulting package-relative application ID: 
I had mentioned this previously in joe's thread but at the time I thought it had to do with accelerator keys, based on this function causing the error:

Code: Select all

gui_KeyDown(wParam, lParam, nMsg, hWnd) {
	
	if (Chr(wParam) ~= "[A-Z]" || wParam = 0x74) ; Disable Ctrl+O/L/F/N and F5.
		return
	wb := getDOM()
	pipa := ComObjQuery(wb, "{00000117-0000-0000-C000-000000000046}")
	VarSetCapacity(kMsg, 48), NumPut(A_GuiY, NumPut(A_GuiX
	, NumPut(A_EventInfo, NumPut(lParam, NumPut(wParam
	, NumPut(nMsg, NumPut(hWnd, kMsg)))), "uint"), "int"), "int")
	Loop 2
		r := DllCall(NumGet(NumGet(1*pipa)+5*A_PtrSize), "ptr", pipa, "ptr", &kMsg)
	; Loop to work around an odd tabbing issue (it's as if there
	; is a non-existent element at the end of the tab order).
	until wParam != 9 || wb.Document.activeElement != ""
	ObjRelease(pipa)
	if r = 0 ; S_OK: the message was translated to an accelerator.
		return 0
}
but I tried removing this function and I still get this crash!

It also seems to have to do with how fast your computer is. When I spam type keys on my keyboard on my i7, I can type hundreds of keys and then it will finally crash, however, many of my users are on an i3/i5 and they experience this crash pretty quickly.

I've got two screen capture videos of the issue in action
https://drive.google.com/open?id=1f-MGc ... yc-VOwtfpH
https://drive.google.com/open?id=1xicg_ ... R94BnLDAg0
Last edited by Stavencross on 20 May 2018, 08:07, edited 1 time in total.
Stavencross
Posts: 90
Joined: 24 May 2016, 16:42

Re: WebApp.Ahk crash on key spam

18 May 2018, 11:21

I tried to add a text-area to the AHK installer that I remember webapp.ahk was based on, I am still able to reproduce the error there =/.
Stavencross
Posts: 90
Joined: 24 May 2016, 16:42

Re: WebApp.Ahk crash on key spam

20 May 2018, 08:04

Although I was unable to fix this, I migrated to using geekdudes Chrome.ahk to run my webapp, and the issue isn't present.
Stavencross
Posts: 90
Joined: 24 May 2016, 16:42

Re: [SOLVED] WebApp.Ahk crash on key spam

22 Jan 2019, 10:47

I finally solved this issue (2 yrs later)

There is a function SetWBClientSite()
at the end, I had to comment the if() block out. It looks like it was maybe sending out to many DLL calls due to the spam?

I modified the func to this:
SetWBClientSite()
{
interfaces := {
(Join,
IOleClientSite: [0,3,1,0,1,0]
IServiceProvider: [3]
IInternetSecurityManager: [1,1,3,4,8,7,3,3]
)}
unkQI := RegisterCallback("WBClientSite_QI", "Fast")
unkAddRef := RegisterCallback("WBClientSite_AddRef", "Fast")
unkRelease := RegisterCallback("WBClientSite_Release", "Fast")
WBClientSite := {_buffers: bufs := {}}, bufn := 0,
for name, prms in interfaces
{
bufn += 1
bufs.SetCapacity(bufn, (4 + prms.MaxIndex()) * A_PtrSize)
buf := bufs.GetAddress(bufn)
NumPut(unkQI, buf + 1*A_PtrSize)
NumPut(unkAddRef, buf + 2*A_PtrSize)
NumPut(unkRelease, buf + 3*A_PtrSize)
for i, prmc in prms
NumPut(RegisterCallback("WBClientSite_" name, "Fast", prmc+1, i), buf + (3+i)*A_PtrSize)
NumPut(buf + A_PtrSize, buf + 0)
WBClientSite[name] := buf
}
wb := getDOM()
/*
if pOleObject := ComObjQuery(wb, "{00000112-0000-0000-C000-000000000046}")
{ ; IOleObject::SetClientSite
DllCall(NumGet(NumGet(pOleObject+0)+3*A_PtrSize), "int"
, pOleObject, "int", WBClientSite.IOleClientSite, "int")
ObjRelease(pOleObject)
}
*/

}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: -Elaphe-, downstairs, Google [Bot], sebalotek and 197 guests