Crash… crash… crash…

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Crash… crash… crash…

22 Jan 2018, 20:04

Is the 1.1.27 line cursed or something…? Too many bugfixes.
1.1.27.07 is crashing a script on restart. 1.1.27.06 doesn't.
I've established the crash is due to new threads creation in the beginning of the script.

Threads are started through global var := ahkThread(" #Include *i <path-to-AHK-script> ").
Threads are terminated through var.Terminate[] before the Reload command.
I've also tried with ahkThread_Free(var), var := "" as per documentation, to no avail (Why is it online only? I want offline documentation, my connection is metered and shitty).

Is there anything more/different to do in the script to avoid the crash or is it an AHK_H bug?

Fogot to say: happening in XP-SP3 Pro x86, obviously 32bit AHK_H 1.1.27.07 (Unicode).
HotKeyIt
Posts: 1607
Joined: 29 Sep 2013, 18:35
Contact:

Re: Crash… crash… crash…

25 Jan 2018, 00:59

Can't reproduce that on Win 10, can you give me an example script.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: Crash… crash… crash…

25 Jan 2018, 04:39

A download link was already mentioned in the first post. It's KeypressOSD.
Direct download link: here
GitHub repository: here

It may not crash on Win10 but it does on XP, as mentioned. Since 1.1.27.06 and earlier don't crash the same script, it's obvious one of the latest changes triggers it. Unfortunately Dr.Watson doesn't catch it. All I can show is this:
AHKH112707crash.png
AHKH112707crash.png (60.57 KiB) Viewed 150 times

If I disable creation of one thread in the beginning of the script it will crash when trying to create the next, and so on (I put OutputDebug checkpoints before and after each thread creation).
If I completely disable creation of threads in the beginning of the script it will not crash anymore on restart.
Disabling the OnMessage() calls has no effect, it still crashes.
HotKeyIt
Posts: 1607
Joined: 29 Sep 2013, 18:35
Contact:

Re: Crash… crash… crash…

26 Jan 2018, 07:18

Unfortunately I can't test on XP for the moment, I could build you a debug version and you could try to debug using windbg or similar.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: Crash… crash… crash…

26 Jan 2018, 07:31

Minutes ago I remembered Dependency Walker, compiled the latest version of the script and ran a profiler. To my surprise, the compiled exe simply exited due to some errors. Here is the DW log of the failed launch:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Errors were:

Code: [Select all] [Download] GeSHi © Codebox Plus

GetProcAddress(0x7E410000 [USER32.DLL], "RemoveClipboardFormatListener") called from "KEYPRESS-OSD-AHKH 4.13.0.2.EXE" at address 0x004AB537 and returned NULL by thread 1. Error: The specified procedure could not be found (127).
GetProcAddress(0x7E410000 [USER32.DLL], "AddClipboardFormatListener") called from "KEYPRESS-OSD-AHKH 4.13.0.2.EXE" at address 0x004AB557 and returned NULL by thread 1. Error: The specified procedure could not be found (127).

There were other errors earlier:

Code: [Select all] [Download] GeSHi © Codebox Plus

GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MSVCR100.DLL" at address 0x78ABBA3B and returned NULL by thread 1. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "MSVCR100.DLL" at address 0x78ABBA48 and returned NULL by thread 1. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "MSVCR100.DLL" at address 0x78ABBA55 and returned NULL by thread 1. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "MSVCR100.DLL" at address 0x78ABBA62 and returned NULL by thread 1. Error: The specified procedure could not be found (127).

This means the .bin is even worse than the main exe, which still allows the script to run uncompiled (but crashes on restart).

I have DbgView, hopefully it's good enough for debugging. Maybe DW could provide debug info too, never checked.
It'd be great if you could build that debug version (both exe and bin, to check both uncompiled and compiled). Thank you.

[EDIT]
Not even 1.1.27.06 will launch the compiled script, so the problem(s) in the bin may be much earlier than that. Oldest version I have is 1.1.25.02 and that one fails to launch the compiled script too. :(

EDIT2
Additionally, the compression options in Ahk2Exe seem to have little to no effect; there are both UPX and MPRESS in the Compiler folder, I also copied MPRESS to the main AHK folder and the Win32w folder, but the resulting exe is still 2MB (with a tiny difference of ~84kB less) and the FIleInfo plug-in in Total Commander shows no sign of compression. Encryption is disabled (don't need it). Have I gone mad…?

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 1 guest