Modify

Opened 16 years ago

Closed 16 years ago

#591 closed Bug (No Bug)

_GUICtrlListBox_AddString goes loopy when passing array instead of string

Reported by: Annonymous Owned by:
Milestone: Component: AutoIt
Version: 3.2.12.0 Severity: None
Keywords: list box debugger crash Cc:

Description

First of all, I know you aren't suppose to pass an array to the $sText parameter of _GUICtrlListBox_AddString(). It was a typo that led me to discover this, and if I remember correctly, Valik once said that Autoit shouldn't hard crash under any circumstance.

When passing an array (In this case from StringSplit) to _GUICtrlListBox_AddString(), it both makes Autoit Hard-crash as well as the Dr. Watson Post-mortem debugger. This is the shortest code I can reproduce this with:

#Include <GUIListBox.au3>
$hForm = GUICreate("Test", 410, 492, 193, 125)
$hList = GUICtrlCreateList("", 16, 16, 377, 383)
$azTemp = StringSplit("Test\Hello", "\")
_GUICtrlListBox_AddString($hList, $azTemp)
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case -3
			Exit

	EndSwitch
WEnd

This first creates the infamous "Such-and-such has encountered a problem and needs to close" dialog. Next, after a few seconds, the same dialog appears for the Dr. Watson Post-mortem debugger (drwtsn32.exe). The Autoit script does not close, nor does it respond to an "End Process" from the Task Manager.

The only way to kill the script is to kill drwtsn32.exe. SciTE then reports the exit code to be :

!>19:42:54 AutoIT3.exe ended.rc:-1073740972

Operating System: Windows XP (English) SP2.

Attachments (0)

Change History (1)

comment:1 in reply to: ↑ description Changed 16 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

Replying to Annonymous:

Valik once said that Autoit shouldn't hard crash under any circumstance.

Indeed. In this case, though, it's technically not AutoIt's crash. The array is converted to a number and passed to SendMessage(). The message that's being used expects a string, so when it encounters a number it tries to do stuff and crashes. There isn't anything we can do about this. In certain cases (Using DllCall(), sending messages) it's up to the caller (you) to make sure you don't pass invalid data.

No bug.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.