PDA

View Full Version : Appcrash on open character sheet



Lithl
June 10th, 2009, 01:58
While working on my ruleset, I changed the following charsheet xml from:

<genericcontrol name="wounds0group">
<anchored>
<to>healthframe</to>
<position>insidetopleft</position>
<offset>10,20</offset>
<size>
<width>143</width>
<height>50</height>
</size>
</anchored>
<frame>
<name>logogroup</name>
</frame>
</genericcontrol>

<windowlist name="wounds0list">
<anchored>
<to>wounds0group</to>
<position>insideright</position>
<offset>5,-10</offset>
<size>
<width>100</width>
</size>
</anchored>
<class>element_healthbox</class>
<datasource>.wounds0</datasource>
<allowcreate />
<allowdelete />
<columns>
<width>20</width>
<fillwidth />
</columns>
</windowlist>

to:

<!--genericcontrol name="wounds0group">
<anchored>
<to>healthframe</to>
<position>insidetopleft</position>
<offset>10,20</offset>
<size>
<width>143</width>
<height>50</height>
</size>
</anchored>
<frame>
<name>logogroup</name>
</frame>
</genericcontrol-->

<windowlist name="wounds0list">
<anchored>
<!--to>wounds0group</to-->
<to>healthframe</to>
<position>insideright</position>
<offset>5,-10</offset>
<size>
<width>100</width>
</size>
</anchored>
<class>element_healthbox</class>
<datasource>.wounds0</datasource>
<allowcreate />
<allowdelete />
<columns>
<width>20</width>
<fillwidth />
</columns>
</windowlist>

Afterward, trying to open the character sheet, the application crashed.

crash data:
Problem signature:
Problem Event Name: APPCRASH
Application Name: FantasyGrounds.exe
Application Version: 0.0.0.0
Application Timestamp: 495e1c0d
Fault Module Name: FantasyGrounds.exe
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 495e1c0d
Exception Code: c0000005
Exception Offset: 0016b324
OS Version: 6.0.6000.2.0.0.768.3
Locale ID: 1033
Additional Information 1: bbb7
Additional Information 2: 49490c39579db54c33012c2cf51ef625
Additional Information 3: 9182
Additional Information 4: d0f1a19694d9cd9a275c88c9881c9e2f

As I've got Visual Studio 2008, I also had the problem to debug. Of course, without the source, the debug may not be helpful, but I'll include it just in case:
Unhandled exception at 0x0056b324 in FantasyGrounds.exe: 0xC0000005: Access violation reading location 0x000005ab.

And the surrounding disassembly:

0056B317 int 3
0056B318 int 3
0056B319 int 3
0056B31A int 3
0056B31B int 3
0056B31C int 3
0056B31D int 3
0056B31E int 3
0056B31F int 3
0056B320 mov eax,dword ptr [esp+4]
0056B324 mov edx,dword ptr [eax+8]
0056B327 mov ecx,dword ptr [esp+8]
0056B32B cmp edx,dword ptr [ecx+8]
0056B32E je 0056B333
0056B330 xor eax,eax
0056B332 ret


Returning the xml to the original state fixed the crash.

Foen
June 10th, 2009, 06:19
Using xml comments can sometimes cause a crash (FG has its own xml parser, which is a bit different to MSXML) and so you might want to comment out the generic control by tweaking its name (from genericcontrol to generic-control):


<generic-control>
...
</generic-control>

That's the way the devs comment out code, and it works because FG ignores elements it doesn't recognise.

Foen

Lithl
June 11th, 2009, 00:35
Ew. If the XML parser can't correctly ignore comments, that should really be fixed.

Griogre
June 11th, 2009, 01:21
One thing to be aware of about FG. FG uses an XML structure to hold data, but that data structure does *not* conform to iso-8859-1 encoding or real tightly to XML though it does do so generally. It probably botches comments sometimes because FG thinks its an unmatched attribute, as Foen mentioned, so it basically discards everything after the comment because there is no close to the "comment" attribute.

You can generally use comments in library modules however, it seems to be the rulesets where you have the most problems.

Foen
June 11th, 2009, 05:32
I use simple comments all the time <!-- containing a few words --> but have found FG can be a bit sensitive to more complex ones. It was just a thought, for you to try to see if it fixed your problem.

Tenian
June 11th, 2009, 12:41
I think it's very important to have the space between the comment/end comment marker and the next word.

This seems to work:

<!-- lalalal --!>

This does not:

<!--lalalal--!>