Jump to content
minxomat

Crash on ridiculous array sizes?

Recommended Posts

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


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

minxomat,

I see it now - sorry about that.

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

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


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

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 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

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

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


A cross-platform implementation of the AutoIt language

My contributions to the AutoIt Community ##AutoIt at freenode, real-time chat

3fHNZJ.gif

Spoiler

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) intend to do that to anybody.

Share this post


Link to post
Share on other sites

@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 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

"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)


A cross-platform implementation of the AutoIt language

My contributions to the AutoIt Community ##AutoIt at freenode, real-time chat

3fHNZJ.gif

Spoiler

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) intend to do that to anybody.

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 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

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

×
×
  • Create New...