Jump to content

Crash on ridiculous array sizes?


minxomat
 Share

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.

Link to comment
Share on other sites

  • Moderators

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

 

Link to comment
Share on other sites

  • Moderators

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

 

Link to comment
Share on other sites

  • Moderators

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

 

Link to comment
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.

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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.

Link to comment
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

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
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.

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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.

Link to comment
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)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...