minxomat

Crash on ridiculous array sizes?

24 posts in this topic

AutoIt usually catches array sizes that make no sense:

ConsoleWrite("> " & @AutoItVersion & @LF)
Dim $_[9e9]
(2) : ==> Variable subscript badly formatted.:
Dim $_[9e9]
Dim $_[^ ERROR
->12:23:54 AutoIt3.exe ended.rc:1
+>12:23:54 AutoIt3Wrapper Finished.

But, 

ConsoleWrite("> " & @AutoItVersion & @LF)
Dim $_[1e9]
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
> 3.3.14.2
!>12:25:16 AutoIt3.exe ended.rc:-1073741819
+>12:25:16 AutoIt3Wrapper Finished.
>Exit code: 3221225477    Time: 7.2

 

Only occurs in 3.3.14.2 for me.


I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites



minxomat,

With v3.3.14.2 I get an error flagged both with and without Au3Check:

ConsoleWrite("> " & @AutoItVersion & @LF)
Dim $_[9e9]
>Running:(3.3.14.2):M:\Program\AutoIt3\autoit3.exe "M:\Program\Au3 Scripts\fred4.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
> 3.3.14.2
"M:\Program\Au3 Scripts\fred4.au3" (3) : ==> Variable subscript badly formatted.:
Dim $_[9e9]
Dim $_[^ ERROR
->11:33:05 AutoIt3.exe ended.rc:1
+>11:33:05 AutoIt3Wrapper Finished.
#AutoIt3Wrapper_Run_AU3Check=n
ConsoleWrite("> " & @AutoItVersion & @LF)
Dim $_[9e9]
>Running:(3.3.14.2):M:\Program\AutoIt3\autoit3.exe "M:\Program\Au3 Scripts\fred4.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
> 3.3.14.2
"M:\Program\Au3 Scripts\fred4.au3" (4) : ==> Variable subscript badly formatted.:
Dim $_[9e9]
Dim $_[^ ERROR
->11:31:43 AutoIt3.exe ended.rc:1
+>11:31:43 AutoIt3Wrapper Finished.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Yes, same for me, because you tried the working snippet twice, now try the other.


I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

minxomat,

I see it now - sorry about that.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

I see it now

Does it crash for you?


I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

minxomat,

Yes, I get the same result as you - using [9e9] errors, using [1e9] crashes - but I have no idea why as I would have expected both to result in errors. You say it only happens in 3.3.14.2, have you checked in 3.3.14.0/1?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

have you checked in 3.3.14.0/1?

No. 

I know that it is impossible to check array bounds at runtime if they depend on other lines of code (Halting Problem), but I think this constant expression should produce an error in any case where it evaluates to >16777216. Or is this intended behavior?


I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

Is 1e9 something like 1*10^9?


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Is 1e9 something like 1*10^9?

Yes, scientific notation for programming languages.


I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

I think it is a problem with AutoIt not interpreting 1e9 as a number.
When I try the following code with 3.3.15.0 I get "Map" as the variable type.

ConsoleWrite("> " & @AutoItVersion & @LF)
Dim $_[9e9]
ConsoleWrite(VarGetType($_) & @CRLF)

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Your example could be simplified to

Global $a[1000000000]

which crashes also.


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

I think it is a problem with AutoIt not interpreting 1e9 as a number.
When I try the following code with 3.3.15.0 I get "Map" as the variable type.

ConsoleWrite("> " & @AutoItVersion & @LF)
Dim $_[9e9]
ConsoleWrite(VarGetType($_) & @CRLF)

 

It runs? I guess(!) this is because it is out of any array bounds valid for AutoIt. Maybe Maps can have more elements.


I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

Your example could be simplified to

Global $a[1000000000]

which crashes also.

This is exactly the same. You could also write 10000000*10, it'll be the same number - that's not the problem. 


I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

From here:

VAR_SUBSCRIPT_ELEMENTS = 16,777,216 (This is the limit of elements in an Array)

9e9 (9000000000) is wayyyyy more than 16,777,216 :P

1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

@TheDcoder Did you even read my posts?

I know that it is impossible to check array bounds at runtime if they depend on other lines of code (Halting Problem), but I think this constant expression should produce an error in any case where it evaluates to >16777216. Or is this intended behavior?

Edited by minxomat

I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

From here:

9e9 (9000000000) is wayyyyy more than 16,777,216 :P

But you should then get error message "Array maximum size exceeded." and not "Variable subscript badly formatted."


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

"Array maximum size exceeded."

I'm not able to produce this error. Can you post an example?

---

Meanwhile other test cases:

ConsoleWrite("> " & @AutoItVersion & @LF)

Global Const $iArrayMax = 16777216
Global Const $iOverflow = 16777777

Local  $1[$iOverflow] ; crash
Global $1[$iOverflow] ; crash
Dim    $1[$iOverflow] ; crash

Local $2[$iArrayMax]
ReDim $2[$iArrayMax + 1] ; crash

Local $3[3.141] ; works fine
ConsoleWrite("!> Bound: " & UBound($3) & @LF)

 

Edited by minxomat

I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

@minxomat Oh, sorry, miss it :P...

@water :huh: Strange it, it crashes for me when it exceeds 16,777,216 (No errors, nothing, just crash message)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

Sure. I get "Array maximum size exceeded." with AutoIt 3.3.12.0

ConsoleWrite("> " & @AutoItVersion & @LF)
Global $iElements = 9000000000
Global $aArray[$iElements]

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Strange it, it crashes for me when it exceeds 16,777,216 (No errors, nothing, just crash message)

Congratulations, you found out what this thread is about!

2 people like this

I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now