Jose Almeida

SMP still crashes with metar parsing

16 posts in this topic

Mine just crashed a few minutes ago - X-Plane 10, SMP 4.0.1, RWC 1.1, X-Plane built-in weather. I wasn't looking in the sim, but when I was few minutes back everything was OK.

Peter

 

Log.txt

METAR.rwx

0

Share this post


Link to post
Share on other sites

It seems there was one hour of METAR data from NOAA that contained some sort of invalid data. It seems to have cleared up on its own, so if you fly again things should be OK now.

I'm looking into why that hour's data caused a crash.

 

0

Share this post


Link to post
Share on other sites

To follow up, the culprit was whoever's reporting the weather at MMMT (in Veracruz, Mexico):

MMMT 011510Z 00000KT 5SM VCFG FEW020 22/19 A2986 RMK 8/100 FG LYR SFC

The code we use from NOAA to parse METAR data can't handle the case of SFC being the last thing in the METAR report. It doesn't make sense; SFC should be followed by VIS and a visibility distance (SFC VIS indicates surface visibility)

I've coded up a fix so RWC will just ignore this case instead of crashing for our next release, in case it happens again.

 

0

Share this post


Link to post
Share on other sites

Confirmed! Its working again now. Before it crashed (XP10), when I arrived around 6NM at VHHH.

 

0

Share this post


Link to post
Share on other sites

Frank,

Instead of coding for every possible metar inconsistency couldn't just code something like "I can't figure this out, let's ignore these guys" :rolleyes:

0

Share this post


Link to post
Share on other sites

Thank you Frank for quickly looking into it. I was enjoying my first flight with new version (SMP V4) and someone in Mexico has forced me to enjoy it again :-).

1

Share this post


Link to post
Share on other sites
2 hours ago, Jose Almeida said:

Frank,

Instead of coding for every possible metar inconsistency couldn't just code something like "I can't figure this out, let's ignore these guys" :rolleyes:

Afraid it doesn't work that way! Fundamentally they are bugs in NOAA's METAR parsing library that I'm fixing.

0

Share this post


Link to post
Share on other sites

I understand that, Frank, but anything is better than a crash; wouldn't it be possible to have a global "On Error DO" that somehow avoided the crash, even if it meant switching to default clouds?

Edited by Jose Almeida
0

Share this post


Link to post
Share on other sites
I understand that, Frank, but anything is better than a crash; wouldn't it be possible to have a global "On Error DO" that somehow avoided the crash, even if it meant switching to default clouds?

No. Frank was quite clear as to why but I think your limited knowledge of programming is not allowing you to understand why his explanation actually makes sense as to why your request cannot be done.

0

Share this post


Link to post
Share on other sites

Some languages do have the concept of exceptions that the application can "catch," but this METAR code is written in C where that's not an option.

 

0

Share this post


Link to post
Share on other sites

...and we're inside X-Plane sharing what little options there are with everything else.

0

Share this post


Link to post
Share on other sites
1 hour ago, sundog said:

Some languages do have the concept of exceptions that the application can "catch," but this METAR code is written in C where that's not an option.

 

In my mother tongue there's a saying that can be losely translated by "Trying to teach Our Father to the priest"; I guess that's what I was trying to do. I've done a little programming, never in C and mostly in interpreted languages.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.