Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » rev630 - failing on WinXP using MonoDevelop
rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 08:53 Go to next message
FurFuznel is currently offline FurFuznel

 
Lt. Junior Grade
Stars! Nova developer
Stars! Nova developer

Messages: 437
Registered: November 2002
Location: New Brunswick, Canada
Good day to all of you!

Testing Revision 630 on my Windows XP machine, compiled with MonoDevelop 2.6 Beta 3 with Mono+Gtk# 2.10.1, and using a new folder for game files, the game displays an error when I double click on a race in the Console to try to bring up the Client window (see the attached error message). Nova is successfully trapping this error, but I cannot get any further into the game play with any of the three races in the game. I am able to exit properly from the Console, then the New Game Window, and the launcher.

Shadallark



Shadallark <==> FurFuznel
Mental anguish is for those who choose to think - FurFuznel
running Mac OS X 10.6.7

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 11:22 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
Really usefully the code just swallows the actuall exception Sad

catch
{
    Report.Error("NovaConsole.cs : PlayerList_DoubleClick() - Failed to launch GUI.");
}


So you'll need to find this in NovaConsole.cs (line 652) - then catch and report the real exception.

hate to say it but we should probably shove log4net in the code to log stuff like this

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 11:25 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
It may well be some thing I've used for the new cargo meter that just won't work in Mono.... (which would blow)

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 12:45 Go to previous messageGo to next message
evild00d is currently offline evild00d

 
Crewman 2nd Class
Stars! Nova developer
Stars! Nova developer

Messages: 14
Registered: July 2009
Location: Norway
Musmuris wrote on Fri, 24 June 2011 17:22

hate to say it but we should probably shove log4net in the code to log stuff like this


In general I would recommend that we just remove these kinds of general try-catchers entirely. A catch should make an effort to deal with the exception, not just report it and continue on its merry way while the application state is potentially corrupted. We might as well let the application crash if something unexpected goes wrong, and let the built-in .NET unhandled exception handler report the error for us.

http://msdn.microsoft.com/en-us/library/0yd65esw.aspx

Although the catch clause can be used without arguments to catch any type of exception, this usage is not recommended. In general, you should only catch those exceptions that you know how to recover from. Therefore, you should always specify an object argument derived from System.Exception.


Put plainly: Don't catch if you can't recover.

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 13:12 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
evild00d wrote on Fri, 24 June 2011 12:45

Musmuris wrote on Fri, 24 June 2011 17:22

hate to say it but we should probably shove log4net in the code to log stuff like this


In general I would recommend that we just remove these kinds of general try-catchers entirely. A catch should make an effort to deal with the exception, not just report it and continue on its merry way while the application state is potentially corrupted. We might as well let the application crash if something unexpected goes wrong, and let the built-in .NET unhandled exception handler report the error for us.



You should never have an empty catch like that unless you want to ignore it.

However I'd rather catch and put a nicer error up and log the full exception. If the standard .NET one comes up then there's no way to get the stack trace for reporting. If we have a log file, or at lest a dialog showing the error, then we can get those reports posted. Even better if you can get some automated error reporting that sends any unhandled exceptions to a given email address.

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 14:04 Go to previous messageGo to next message
FurFuznel is currently offline FurFuznel

 
Lt. Junior Grade
Stars! Nova developer
Stars! Nova developer

Messages: 437
Registered: November 2002
Location: New Brunswick, Canada
Okay, I have done some stepping through the program to see where the failure is actually happening.

It appears to be happening in CommandArguments.cs at line 225 - 228 when we attempt to Add an item to the commandLine list. By mousing over "List" in line 225 I get a popup telling me:
global::System.Collections.Generic.List Unknown member: List
and mousing over "Add" in line 228 I get a popup telling me:
commandLine.Add Unknown member: Add

When I try to Step Into line 228 I get the error message shown in the attached image: rev630_ComandArguments.cs_error.png . Looking at the data in the Debugger there are valid arguments in the argumentList:
{-r Humanoid}
{-t 2101}
{-i C:\store\downloads\testing\20110624f\Humanoid.intel}

Are we not using Lists in other locations? Why is this the first one that Mono is having difficulties with?

Shadallark



Shadallark <==> FurFuznel
Mental anguish is for those who choose to think - FurFuznel
running Mac OS X 10.6.7

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 15:28 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
This is either the CargoMeter or my batch of variable changes. I'll see if I can track it down.

Anyway guys, the 630 revision is from the branch I created, which is bound to be broken quite regularly as it is a very system wide WIP. You should stick to the trunk for working on your own modifications unless you are working on the same thing as I am. I'll merge the trunk into the branch regularly to keep up to date with your changes and fix any inconsistencies as they appear, as per SVN best practices.

On the subject of exceptions, what I've done on this cases when I encounter a crash with no info, is append the exception message to the report, like:
catch(Exception ex)
{
    Report.Fatal("Failed to launch GUI. Details:" + Enviroment.Newline + ex.ToString()
}


Something that would be very useful is to modify the Report class, so that when running the Debug assembly it prints the exception message, but when running the Release assembly it outputs it to a crash.txt file so that users can submit them to us without seeing an ugly ass message on screen.

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 15:37 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
Nope, it's the CargoMeter... or rather the removal of the .resx files. I didn't catch it before because the branch was based on r624.

Adding the exception message with the --debug command gives this:

http://starsautohost.org/sahforum/index.php?t=getfile&id=3029

Mono's debugger is very wacky, sometimes crashes on the weirdest places unrelated to the actual error. Anyway this probably happens on the trunk too.

EDIT: For better clarity, this is the offending code on PlanetDetail.Designer.cs:
this.meterCargo.CargoLevels = ((Nova.Common.Cargo)(resources.GetObject("meterCargo.Ca rgoLevels")));

A temporary fix is to comment all
resources.GetObject()
lines from both PlanetDetail.designer.cs and FleetDetail.designer.cs

Seems to work just fine without them too.


  • Attachment: crash1.png
    (Size: 56.79KB, Downloaded 288 times)


[Updated on: Fri, 24 June 2011 15:54]

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 15:57 Go to previous messageGo to next message
evild00d is currently offline evild00d

 
Crewman 2nd Class
Stars! Nova developer
Stars! Nova developer

Messages: 14
Registered: July 2009
Location: Norway
Musmuris wrote on Fri, 24 June 2011 19:12

You should never have an empty catch like that unless you want to ignore it.

However I'd rather catch and put a nicer error up and log the full exception. If the standard .NET one comes up then there's no way to get the stack trace for reporting. If we have a log file, or at lest a dialog showing the error, then we can get those reports posted. Even better if you can get some automated error reporting that sends any unhandled exceptions to a given email address.



Yes, we need a way to collect error reports. For general reporting purposes I think adding a handler to the unhandled exception event (AppDomain.UnhandledException and friends), instead of various catch blocks, might be good.

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 16:05 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
Fixed it... It happened on mine as well after I deleted those resx files. bloody runtime errors that should be compile time ones. I was trying a quick fix to get Aeglos going.

Aeglos - rev 630 was still the latest rev regardless of branch. Rev numbers are repository wide. So as long as you get trunk then 629 and 630 would be the same under that folder.

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 16:15 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
Musmuris wrote on Fri, 24 June 2011 16:05


Aeglos - rev 630 was still the latest rev regardless of branch. Rev numbers are repository wide. So as long as you get trunk then 629 and 630 would be the same under that folder.


Wow, I never knew... that seems rather odd and counter intuitive. I stand corrected.

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Fri, 24 June 2011 19:07 Go to previous messageGo to next message
FurFuznel is currently offline FurFuznel

 
Lt. Junior Grade
Stars! Nova developer
Stars! Nova developer

Messages: 437
Registered: November 2002
Location: New Brunswick, Canada
Two comments here:

1) Testing again at revision 632 shows that the problem has gone away and the game is once again usable on Windows XP when compiled under MonoDevelop 2.6 beta 3

2) Although it is true that the whole system is said to be at revision 630, if a branch was started using revision 624 and was updated at revision 629, the branch is at revision 629 and the system is at revision 630. That said, when I update using SVN I update the trunk, branches, and tags. Therefore, even if I was reporting a problem about a branch I would say at revision 630 because that is the revision that SVN shows the whole system as being at currently (well, no longer currently as we are already up to 632 now Wink )

Thanks for fixing the problem everyone.

Shadallark



Shadallark <==> FurFuznel
Mental anguish is for those who choose to think - FurFuznel
running Mac OS X 10.6.7

Report message to a moderator

Re: rev630 - failing on WinXP using MonoDevelop Sat, 25 June 2011 06:53 Go to previous message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
I just have trunk and when I update just that it still said "Update complete at Revision 630" - SVN is like that.

P.S. Glad it's working again!


[Updated on: Sat, 25 June 2011 06:53]

Report message to a moderator

Previous Topic: Completing the Forum Move
Next Topic: ClientState and .intel files
Goto Forum:
  


Current Time: Thu Mar 28 06:58:01 EDT 2024