Fixed - Crash in AHK 32bit

Report problems with documented functionality
TAC109
Posts: 1118
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Fixed - Crash in AHK 32bit

31 Aug 2014, 18:42

This code crashes AHK 32bit. (Haven't tested on others.)

Code: Select all

Gui, Add, Edit, y+10 W710  vExResult ReadOnly
Gui Show
params:={}, params[1]:="-"
GuiControl,, ExResult, % Abs(Params*)
MsgBox Worked
ExitApp
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
lexikos
Posts: 9621
Joined: 30 Sep 2013, 04:07
Contact:

Re: Crash in AHK 32bit

31 Aug 2014, 19:07

Interesting. Does it crash if you pass valid parameters?
TAC109
Posts: 1118
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Crash in AHK 32bit

31 Aug 2014, 19:24

No. I encountered this crash in Pulover's Dynamic Function Tester. The screen attempts to refresh as you type in data. Attempts to type in negative numbers to the abs function crash if the hyphen is entered first.

Edit: This is with 'evaluate parameters as expressions' unchecked.

A circumvention is to replace line 4 with

z:=abs(params*)
GuiControl,, ExResult, % z

However, the original code should work.
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
lexikos
Posts: 9621
Joined: 30 Sep 2013, 04:07
Contact:

Re: Crash in AHK 32bit

31 Aug 2014, 20:25

Says who? "-" is not a number. The documentation does not say what happens when you pass invalid parameters.

One would generally not expect it to crash, but it shouldn't "work" either.
TAC109
Posts: 1118
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Crash in AHK 32bit

31 Aug 2014, 21:31

By 'work' I mean 'not crash'. In the circumvention 'z' evaluates to an empty string, as expected.
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
lexikos
Posts: 9621
Joined: 30 Sep 2013, 04:07
Contact:

Re: Crash in AHK 32bit

01 Sep 2014, 00:41

I think you missed my point, but I was wrong anyway.
Note: Math functions generally return a blank value (empty string) if any of the incoming parameters are non-numeric.
lexikos
Posts: 9621
Joined: 30 Sep 2013, 04:07
Contact:

Re: Crash in AHK 32bit

01 Sep 2014, 04:23

Your workaround may also fail. The crash occurs as a result of overwriting a pointer in an internal data structure with an indeterminate value. If that value happens to be something safe (by coincidence), there's no crash. Otherwise, it could crash the program or cause heap corruption, leading to other hard-to-trace problems. Your best bet is to avoid calling Abs with an invalid parameter.

In any case, it will be fixed in the next release.
TAC109
Posts: 1118
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Crash in AHK 32bit

01 Sep 2014, 17:09

lexikos wrote:In any case, it will be fixed in the next release.
Thanks
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
lexikos
Posts: 9621
Joined: 30 Sep 2013, 04:07
Contact:

Re: Fixed - Crash in AHK 32bit

10 Sep 2014, 03:59

Fixed in v1.1.16.01.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 12 guests