View Issue Details

IDProjectCategoryView StatusLast Update
0003957Multi Theft Auto : San AndreasScriptingpublic2010-03-21 11:34
Reportererorr404 Assigned Tomabako  
Status resolvedResolutionfixed 
Target Version1.0.4Fixed in Version1.0.4 
Summary0003957: XML functions sometimes return bad root node

Willy and I have experienced a bug where the root node of an XML file returned by xmlLoadFile() is bogus, and we cannot use it to get any data from the XML file.

When we get the address of the node using tostring(rootNode) we get the value: FFFFFFFF.

The code is correct because the function returns a node rather than false. It works for a while and then messes up despite no changes being made to the file or the code.

This has happened to Willy in DP2 in a server-side script, and to me in the latest nightly build (12/28/08) in a client-side script, which indicates that this bug has exited for a long time and is both in the server and client.

I had the restart the client to get rid of the problem (restarting the resource or reconnecting wouldn't fix it).

Steps To Reproduce

I reproduced this bug by repeatedly accessing the file using xmlLoadFile(). After a number of accesses, it wouldn't get a attributes from the subnodes, and on all subsequent attempts it wouldn't access any subnodes.

I didn't unload the XML file before loading it again.

Then I tried unloading it after every use, and I can no longer reproduce the the bug.. so it might be related to loading a file multiple times without ever unloading it.

TagsNo tags attached.



2009-02-01 18:53

reporter   ~~0008322

This bug is still alive and well. I tried in r272 with and without the resource parameter and it didn't work.


2009-02-02 11:11

administrator   ~~0008324

Yes, this is when you load a file more than once. I've always noticed it.


2009-02-02 19:06

reporter   ~~0008326

It wasn't for me... it was the first time the file was loaded.


2009-06-24 19:13

administrator   ~~0009716

Still there?


2009-06-24 19:36

administrator   ~~0009718

The problem occurs when more than 100000 nodes are allocated - It runs out of ID's.


2009-12-23 14:33

administrator   ~~0010908

Last edited: 2009-12-23 14:34

Maximum number of XML elements is indeed set on 100000.


#define MAX_XML 100000

We could increase this number and/or provide a check if this number is exceeded.


2010-03-15 14:12

updater   ~~0011160

Last edited: 2010-03-15 22:03


2010-03-21 11:34

administrator   ~~0011213

Fixed in:

Issue History

Date Modified Username Field Change