You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve been leveraging Koffi to create bindings for the AutoIt Windows automation library. I’ve been able to make great progress so far though there are lots of random crashes as I call the functions where the Node process just halts with no output and exists with code 0.
The majority of the crashes I’ve observed seem to be related to passing buffers to the underlying DLL. Passing a 1024 byte buffer is generally stable and I don’t often have issues with that but it still crashes from time to time. Passing a buffer larger than 1024 bytes (I usually use 2048 or 4096 bytes) seems to exacerbate the issue for a time and then it’ll start working fine, only for it to start crashing again.
Are there any debug flags I can enable in Koffi so that I can provide more details for this issue?
If you would like to reproduce the issue yourself, you can check out my project here and modify one of the more basic methods like WinGetText to pass a buffer of >1024 bytes.
WinGetText(szTitle: TLPCWSTR,szText: TLPCWSTR=''): string {constoutputBuffer=Buffer.alloc(1024);// Change this to 2048 or greaterthis.invoke('AU3_WinGetText',DataType.Void,[DataType.String16,DataType.String16,LPWSTR,DataType.Int32],[szTitle,szText,outputBuffer,outputBuffer.length],);returnoutputBuffer.toString('utf16le');}
Then you can use this basic script to attempt to trigger the crash:
constwindowTitle='This PC';// Change this to whatever Windows Explorer opens to by default for youconstautoit=newAutoIt();autoit.load();autoit.Run('explorer.exe');autoit.WinWait(windowTitle);constwindowText=autoit.WinGetText(windowTitle,'');console.log(windowText);autoit.unload();
Any help is much appreciated and I’m happy to provide more details if needed!
The text was updated successfully, but these errors were encountered:
I’ve been leveraging Koffi to create bindings for the AutoIt Windows automation library. I’ve been able to make great progress so far though there are lots of random crashes as I call the functions where the Node process just halts with no output and exists with code 0.
The majority of the crashes I’ve observed seem to be related to passing buffers to the underlying DLL. Passing a 1024 byte buffer is generally stable and I don’t often have issues with that but it still crashes from time to time. Passing a buffer larger than 1024 bytes (I usually use 2048 or 4096 bytes) seems to exacerbate the issue for a time and then it’ll start working fine, only for it to start crashing again.
Are there any debug flags I can enable in Koffi so that I can provide more details for this issue?
If you would like to reproduce the issue yourself, you can check out my project here and modify one of the more basic methods like
WinGetText
to pass a buffer of >1024 bytes.Then you can use this basic script to attempt to trigger the crash:
Any help is much appreciated and I’m happy to provide more details if needed!
The text was updated successfully, but these errors were encountered: