Modify

Opened 16 years ago

Closed 16 years ago

#109 closed Bug (Works For Me)

_SQLite_GetTable - Memory error

Reported by: Beejai Owned by:
Milestone: Component: AutoIt
Version: 3.2.10.0 Severity:
Keywords: Cc:

Description

When I try to get a big 1d-Table with "_SQLite_GetTable", in 30% of the cases I get a Application error.

Event Type:	Error
Event Source:	Application Error
Event Category:	(100)
Event ID:	1000
Date:		08.02.2008
Time:		22:34:00
User:		N/A
Computer:	BRIAN
Description:
Faulting application KMRobot.xx-spion.exe, version 3.2.10.0, faulting module KMRobot.xx-spion.exe, version 3.2.10.0, fault address 0x00050e2a.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 41 70 70 6c 69 63 61 74   Applicat
0008: 69 6f 6e 20 46 61 69 6c   ion Fail
0010: 75 72 65 20 20 4b 4d 52   ure  KMR
0018: 6f 62 6f 74 2e 78 78 2d   obot.xx-
0020: 73 70 69 6f 6e 2e 65 78   spion.ex
0028: 65 20 33 2e 32 2e 31 30   e 3.2.10
0030: 2e 30 20 69 6e 20 4b 4d   .0 in KM
0038: 52 6f 62 6f 74 2e 78 78   Robot.xx
0040: 2d 73 70 69 6f 6e 2e 65   -spion.e
0048: 78 65 20 33 2e 32 2e 31   xe 3.2.1
0050: 30 2e 30 20 61 74 20 6f   0.0 at o
0058: 66 66 73 65 74 20 30 30   ffset 00
0060: 30 35 30 65 32 61         050e2a  

Here is the used code... nothing special:

	local $TmpUserList[1][$ITEMS_PER_USER] ; Temporäre neue Userlist
	local $names[1], $TmpNames[1], $tid    ; Array der UIDs, die schon angemailt wurden aus der Globalen DB
	local $iRows, $iColumns, $iRval        ; Hilfsvars. Anzahl der Zeilen und Spalten
	Local $UserListId, $userElemId         ; Userlist-Hilfsvariablen
	Local $sSQL, $iSQLState, $hQuery, $aRow[1], $dbHandle ; DB-Variablen
	Local $anzGeloescht=0                  ; Zähler für die anzahl der Dupes
	Local $TmpRes						   ; Temp Ergebniss von Fkts, das nicht weiter benötigt wird
	if UBound($UserList) = 1 Then Return 0
	_Update_Abgleichen_in_Gui("Lade DB..")
	$sSQL = "SELECT DISTINCT userlists.profileuURL FROM "&$PES_tablename& _
			" WHERE (userlists.gruppe="&_SQLite_Escape($PES_dbgruppe)& ") AND" & _
			" (userlists.status="&_SQLite_Escape($UserStatus)& ")" & _
	        " ORDER BY userlists.profileuURL;"
	_OpenDB($dbHandle, "read")
	$iRval = _SQLite_GetTable ( $dbHandle, $sSQL, $names, $iRows, $iColumns, 254 ) ; 1-d-Table einfacher zu durchsuchen
	_Update_Abgleichen_in_Gui("GetTable OK.")
	Sleep(600)

The error occours in developer mode as well as in compiled files. Same behavior in _SQLite_GetTable2d.
Resultrows ca. 35000. There is not a special limit to this. My DB grows. The Error occoured with 32000 results with the same frequency.
Probability for this error can be increased by doing the GetTable multiple times in one application run.
In general, the application works. When I build a workaround and get the table line by line, I have no errors. But that is dead slow.

--
Beejai

Attachments (0)

Change History (5)

comment:1 follow-up: Changed 16 years ago by Beejai <bjoern@…>

I narrowed in the scope of the error.
It seems to boil down to the "$iCharSize" in the definition.

_SQLite_GetTable ( $hDB, $sSQL, ByRef $aResult, ByRef $iRows, ByRef $iColumns [, $iCharSize = 64 ] )

When i leave that off, the function works fine.

$iRval = _SQLite_GetTable ( $dbHandle, $sSQL, $names, $iRows, $iColumns)

When I set it to a high value, say 1024, i can constantly reproduce this error with a list of about 1000 elements.

Hope that helps fixing this. Because I need it to be bigger than 64 chars.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 16 years ago by jpm

Replying to Beejai <bjoern@syltonline.de>:

I narrowed in the scope of the error.
It seems to boil down to the "$iCharSize" in the definition.

_SQLite_GetTable ( $hDB, $sSQL, ByRef $aResult, ByRef $iRows, ByRef $iColumns [, $iCharSize = 64 ] )

When i leave that off, the function works fine.

$iRval = _SQLite_GetTable ( $dbHandle, $sSQL, $names, $iRows, $iColumns)

When I set it to a high value, say 1024, i can constantly reproduce this error with a list of about 1000 elements.

Hope that helps fixing this. Because I need it to be bigger than 64 chars.

can have a complete script which create the db and try to retrive the data.
Thanks

comment:3 in reply to: ↑ 2 Changed 16 years ago by Beejai <bjoern@…>

Replying to jpm:

can have a complete script which create the db and try to retrive the data.
Thanks

Hi jpm. Sure, email me, and I'll send you the DB part of the code.

I went a little deeper in the problem and got more news.
First, the description of "_SQLite_GetTable" [..2d] is wrong.
The default for $iCharSize is not 64, but -1. Digging in the code, -1 leaves it to "_ _SQLite_szStringRead" to get the size of the string dynamically from den SQLite-DLL. So please update the Helpfile on this one.
Secondly, this means that I have no problem, because with the default, SQLite adjusts the stringlength per row to the nessesary value.

Finally, this means that you either remove the last parameter completely, because it is not verry useful any more. Or you fix the problem there. A remaining use for this parameter could be compatibility to older versions and the possibility to cut the stringlength if only the first few chars are interresting.

comment:4 Changed 16 years ago by Jpm

impossible to reproduce

comment:5 Changed 16 years ago by Jpm

  • Resolution set to Works For Me
  • Status changed from new to closed

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.