Exception while running verification

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Exception while running verification

Post by Chaky »

OXp Verification breaks with this log:
***** Exception while running verification stage "Checking shipdata.plist": <NSException 0x1fd9798> NAME:NSInvalidArgumentException REASON:Tried to add nil value for key 'YES' to dictionary INFO:{ai_type = nullAI.plist; forward_weapon_type = WEAPON_PULSE_LASER; laser_color = orangeColor; model = dorsal_wing.dat; name = Wing; roles = bandersnatch_wing; smooth = YES; thrust = 5; weapon_energy = 5; weapon_position_forward = "0.0 31.74 -1.7"; }
when parsing this file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>tail_end_charlie</key>
	<dict>
		<key>ai_type</key>
		<string>nullAI.plist</string>
		<key>model</key>
		<string>tail_end_charlie.dat</string>
		<key>name</key>
		<string>Tail End Charlie</string>
		<key>roles</key>
		<string>tail_end_charlie</string>
    	<key>weapon_energy</key>
		<real>15</real>
		<key>laser_color</key>
		<string>orangeColor</string>
		<key>setup_actions</key>
		<array>
			<string>initialiseTurret</string>
		</array>
        <key>thrust</key>
        <real>1</real>
    </dict>
	<key>wing</key>
	<dict>
		<key>ai_type</key>
		<string>nullAI.plist</string>
		<key>model</key>
		<string>dorsal_wing.dat</string>
		<key>smooth</key>
		<true/>
		<key>name</key>
		<string>Wing</string>
		<key>forward_weapon_type</key>
		<string>WEAPON_PULSE_LASER</string>
        <key>laser_color</key>
        <string>orangeColor</string>
        <key>roles</key>
        <string>bandersnatch_wing</string>
        <key>thrust</key>
        <real>5</real>
        <key>weapon_energy</key>
        <real>5</real>
		<key>weapon_position_forward</key>
		<string>0.0 31.74 -1.7</string>
		<true/>
	</dict>
	<key>bandersnatch</key>
	<dict>
		<key>ai_type</key>
		<string>pirateAI.plist</string>
		<key>bounty</key>
		<integer>40</integer>
		<key>cargo_type</key>
		<string>CARGO_NOT_CARGO</string>
        <key>cargo_carried</key>
        <string>gold</string>
		<key>likely_cargo</key>
		<integer>25</integer>
		<key>max_cargo</key>
		<integer>40</integer>
		<key>energy_recharge_rate</key>
		<real>4</real>
        <key>frangible</key>
        <false/>
		<key>exhaust</key>
		<array>
			<string>0 84.23 -209.06 8 8 80</string>
			<string>-86.89 -45.35 -209.06 8 8 80</string>
			<string>86.89 -45.35 -209.06 8 8 80</string>
		</array>
		<key>forward_weapon_type</key>
		<string>WEAPON_MILITARY_LASER</string>
		<key>weapon_energy</key>
		<real>7</real>
        <key>laser_color</key>
        <string>orangeColor</string>
		<key>has_ecm</key>
		<true/>
		<key>has_shield_enhancer</key>
		<real>0.9</real> 
		<key>max_energy</key>
		<real>1050</real>
		<key>max_flight_pitch</key>
		<real>0.2</real>
		<key>max_flight_roll</key>
		<real>0.35</real>
		<key>max_flight_speed</key>
		<real>320</real>
		<key>missiles</key>
		<integer>0</integer>
		<key>model</key>
		<string>bandersnatch_hull.dat</string>
		<key>smooth</key>
		<true/>
		<key>name</key>
		<string>Bandersnatch</string>
		<key>roles</key>
		<string>bandersnatch pirate(0.05)</string>
		<key>subentities</key>
		<array>
			<string>wing    0 0 0   1 0 0 0</string>
			<string>wing    -9.660173 0 0   0.5 0 0 -0.8660254</string>
			<string>wing    9.660173 0 0   0.5 0 0 0.8660254</string>
			<string>tail_end_charlie    0 -1.9 -183.8   0 1 0 0</string>
		</array>
		<key>thrust</key>
		<real>14.2</real>
		<key>weapon_position_forward</key>
		<string>0.0 -5.84 179.5</string>
	</dict>
</dict>
</plist>
That started to happen when I added missing "<true/>" to "<key>smooth</key>"

Same happens with 1.73.4 and 1.74.0.2731 (XP, 32 bit)
Last edited by Chaky on Wed Nov 11, 2009 11:00 pm, edited 1 time in total.
Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky »

Nevermind.

Found out that there was one "<true/>" too many.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Stray <true/> here:

<key>weapon_position_forward</key>
<string>0.0 31.74 -1.7</string>
<true/>
</dict>
<key>bandersnatch</key>

Edit: Too slow.
Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky »

Heh.. me first, me first.

Anyway, stray "true" broke the verification.. IMO that shouldn't happen.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Err, in what way did it break the verification?

That stray 'true' was in the wrong place and the verifier flagged it up...

Wait, I possibly see what you mean: in objective-c YES & true are the same thing, and it's a bit confusing seeing YES instead of true. Hmmm, while I can't think of a quick or easy way to get the verifier to distinguish between the two, maybe someone else can!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky »

Well, I have one possible approach.
First, check the whole file as a string and verify its structure using various rules.

That's what I did with my tool. It checks if there are strings, inegers and such where they should be. (I might finish it soon.. just need some coffee)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Chaky wrote:
Nevermind.

Found out that there was one "<true/>" too many.
Not to many "<true/>", as it belonged to the missing one with: "smooth". It was just misplaced. I assume because something was pasted in between.

For your info: I just updated the bandersnatch this week. I corrected this bug and also renamed some files as the key "wing" is likely to conflict with any other oxp that uses that same key name.

ps. when quoting code you better use "code" "/code" for enclosing. That way quoted code is often better readable.
Last edited by Eric Walch on Wed Nov 11, 2009 10:51 pm, edited 1 time in total.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Looking forward to seeing that sintax checking utility! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

The root problem here is that Oolite 1.73 and earlier (back to about 1.62) accept malformed XML property lists.

If you look a bit further up in the log, you should see a message about the file being syntactically invalid and the “homebrew plist parser” being used. This won’t happen in trunk, since the homebrew parser has been removed.
Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky »

Eric Walch wrote:
Chaky wrote:
Nevermind.

Found out that there was one "<true/>" too many.
Not to many "<true/>", as it belonged to the missing one with: "smooth". It was just misplaced. I assume because something was pasted in between.
Actually, I moved the "smooth" beneath the "model", (after I added "true"). My mistake was adding one too many "true". (one was missing.. not two)
Eric Walch wrote:
For your info: I just updated the bandersnatch this week. I corrected this bug and also renamed some files as the key "wing" is likely to conflict with any other oxp that uses that same key name..
I've already downloaded it. It was a while since I last updated my installed OXPs, but that is not the issue here.

I was testing my tool that batch-verifies the oxps, and I came across missing "true" that made verifier hmm "confused". Afterwards I added 2 "true"s and this happened.
Eric Walch wrote:
ps. when quoting code you better use "code" "/code" for enclosing. That way quoted code is often better readable.
Done!
Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky »

Seems like verifier disregards "like_ship" keys and reports errors where there are none. (e.g. "Required keys (model, roles) missing from dictionary")
Also, says that "is_template" is an unknown key.

Correction:

Both 1.73.4 and trunk report "is_template" as unknown, while only trunk ignores "like_ship" keys.
Last edited by Chaky on Thu Nov 12, 2009 12:09 am, edited 1 time in total.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Kaks wrote:
Looking forward to seeing that sintax checking utility! :)
Sintax?! A Freudian slip?
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Oops :oops:

And I mean it! Them condom prices are way too high! :D
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply