Page 1 of 2

Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 15 Feb 2018, 14:50
by robodesign
Hello!

AHK_H always crashes when I want to use ahkThread.

Main AHK file:

Code: Select all

 #Persistent
 testThread := ahkThread(" #Include test.ahk")
 SoundBeep
Return
The secondary thread: test.ahk file

Code: Select all

#Persistent
#NoTrayIcon
SoundBeep
Return
I do not know if others reported it, but this worked until AHK_H 1.1.27.06. But, with the latest version, it crashes instantenously [v1.1.28].

Expected behaviour: two consecutive beeps and both AHK_H scripts should remain persistent [not exit]. What happens: it crashes, no error messages and no beeps.

I hope this will be fixed. Thank you.

Best regards, Marius.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 17 Feb 2018, 08:55
by HotKeyIt
Works fine for me, make sure you have no ahkThread.ahk file in your lib folders!

Code: Select all

 #Persistent
 testThread := ahkThread("#Persistent`n#NoTrayIcon`nSoundBeep`nReturn")
 SoundBeep
Return

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 18 Feb 2018, 07:58
by robodesign
I don't have any. Please test it more, on different systems.

Or have me run a debug version to send you reports.

It's frustrating.....

Please note, you did not use include.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 18 Feb 2018, 08:39
by HotKeyIt
I tried #include as well, does the above without #include not fail for you?

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 18 Feb 2018, 09:41
by robodesign
It crashes all the same. I just tested it.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 18 Feb 2018, 10:19
by HotKeyIt
Can you try downloading the latest AHK_H, extract to a folder and create AutoHotkey.ahk in Win32w folder with the content above, then double click AutoHotkey.exe in the same folder.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 18 Feb 2018, 10:43
by robodesign
Yes, sure!

1. I downloaded the ZIP and unpacked it.
2. I created the file: AutoHotkey.ahk ... in x32w.
The content is:

Code: Select all

 #Persistent
 testThread := ahkThread("#Persistent`n#NoTrayIcon`nSoundBeep`nReturn")
 SoundBeep
Return
3. Executed the file with AutoHotkey.exe from x32w.
4. Result: it crashed all the same. Instantly. No beeps.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 18 Feb 2018, 10:50
by guest3456
robodesign wrote:Yes, sure!

1. I downloaded the ZIP and unpacked it.
2. I created the file: AutoHotkey.ahk ... in x32w.
The content is:

Code: Select all

 #Persistent
 testThread := ahkThread("#Persistent`n#NoTrayIcon`nSoundBeep`nReturn")
 SoundBeep
Return
3. Executed the file with AutoHotkey.exe from x32w.
4. Result: it crashed all the same. Instantly. No beeps.
i just tested this, and it worked fine for me. i got two soundbeeps. no errors. Win10 x64

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 18 Feb 2018, 11:22
by robodesign
Ugh... here it crashes, with any script that uses ahkThread... and AHK_H v1.1.27.06 does not crash.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 18 Feb 2018, 11:44
by guest3456
do you get any error messages or any other clues about the crash? how do you know it crashes? does it just silently exit as if the script was empty?

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 18 Feb 2018, 11:49
by robodesign
With complex scripts, I get the common Windows 10 error message.

Autohotkey_H Unicode 64-bit a cesse de fonctionner. Un problème a fait que le programme a cesse de fonctionner correctement.

[I have Windows en français :-) ].

With this simple script, it silently exits and I get no message and no beeps.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 22 Feb 2018, 09:41
by robodesign
Any updates on this issue?

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 22 Feb 2018, 17:14
by HotKeyIt
Since it can't be reproduced here, I would need to take a look on it on your machine using teamviewer or similar.
Let me know if that would be possible and we can schedule a session.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 22 Feb 2018, 17:32
by robodesign
Yes, we can do that. Please let me know how to get in contact and establish the details. I am available on WhatsApp. Messenger or irc.

Should I drop you a private message with my contact details?

Thank you very much.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 23 Feb 2018, 02:36
by HotKeyIt
Yes please.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 02 Mar 2018, 12:39
by robodesign
HotKeyIt wrote:Yes please.
In the latest build, more precisely... v1.1.28.H003... the threads issue is fixed, partially.

The same script given as example in the initial post works now, but on Reload [from the standard tray menu], it crashes. The same applies with all other scripts I tested and use ahkThread.

I suppose the same fix must be applied to the reload routine[?].

Thank you!

Best regards, Marius.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 02 Mar 2018, 18:04
by HotKeyIt
I don't think any of the changes were relevant to this, can't imagine it would fix something and I still can't reproduce.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 04 Mar 2018, 11:52
by Drugwash
Incidentally I've stumbled into a comment in the source file AhkThread.ahk, stating "; keep dll loadded even if returned object is freed".
I'm wondering whether the dll remains in memory even after last object/thread was deleted/closed and this could somehow clash with creating a new thread upon main script's restart, maybe if the dll is slow to unload or is hung?

Actually I just posted a question regarding the two thread-closing functions ahkThread_Free() and ahkTerminate[] since their usage is confusing.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 04 Mar 2018, 17:41
by HotKeyIt
That should be no problem, when program exits the threads are terminated and memory is freed automatically.

Re: Crash with ahkThread on Win10 x64 - v1.1.28

Posted: 07 Mar 2018, 15:31
by robodesign
@hotkeyit: I was able to reproduce the issue on Win 7 x64 as well, on my old PC. On reload, with just one ahkThread, it crashed.