Greetings everyone,
Well here's a script that led to a weird compiled script crashing bug.
This extremely simple script runs flawlessly on my Win 7 x64 system with 1.1.16.05 ANSI installation. But if I compile it and run, it crashes.
Now the weirdest part, if I change just about anything in the script, ANYTHING, (like a section name or a command's old format), it compiles and runs ok.
Both ahk and exe zipped
I'm probably doing something stupid, I frequently do, but would like to know what exactly
Cheers
Hard to describe compiled script crash bug
Re: Hard to describe compiled script crash bug
It looks like your .exe is compressed. Using mpress? Mpress can sometimes produce .exe's that crash. Search the old forum for more information. I've switched back to using upx.exe for compression.
To do this, use this script as mpress.ahk and compile it, replacing mpress.exe in the AutoHotkey\compile folder. Download upx.exe and place in the same folder.(For faster compile, remove "--all-methods".)
To do this, use this script as mpress.ahk and compile it, replacing mpress.exe in the AutoHotkey\compile folder. Download upx.exe and place in the same folder.
Code: Select all
#NoEnv ; For performance & future compatibility
#Warn ; For catching common errors
; ================================ Program ===================================
file=%3%
Loop Read, % RegExReplace(file,"...$") "ahk"
if (SubStr(A_LoopReadLine,1,12)=";@NoCompress")
ExitApp
RunWait "%A_ScriptDir%\upx.exe" --best --all-methods "%3%"
; ============================== End of file =================================
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Hard to describe compiled script crash bug
I think TAC109 is spot on. I can reproduce the problem by compiling with v1.1.16.05 ANSI, but only if mpress is enabled. It occurs with mpress v2.19 and v2.18, but not v1.27. It does not occur with v1.1.16.04 ANSI, though there's no difference between the two versions that could explain it. A bug in the mpress (de)compression code is the most likely explanation for how the slightest irrelevant-seeming change affects the result.
Re: Hard to describe compiled script crash bug
Alright, that clarifies it. I don't use compiled scripts too frequently, but this is the first time I came across such a bizarre issue with it, so thought I'd report.
Switching to UPX seems to be a good idea.
Thanks TAC109 and lexikos!
Switching to UPX seems to be a good idea.
Thanks TAC109 and lexikos!
Who is online
Users browsing this forum: No registered users and 20 guests