Board index FlightGear Development Canvas

Mapstructure request for help - nasal error

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Mapstructure request for help - nasal error

Postby legoboyvdlp » Sat Jun 08, 2019 5:47 pm

Hi,

Josh has reported this multiple times to the mailing list, nobody seems to know what is going on.

I'm going to post the contents of the various emails.

Hi guys,
I found a problem that I've seen off and on for a while.

Nasal runtime error: flightplan.insertWaypoints expects vector as first arg
at C:/FlightGear 2018.3.2/data/Nasal/route_manager.nas, line 40
Nasal runtime error: function/method call on uncallable object
at C:/FlightGear 2018.3.2/data/Nasal/canvas/MapStructure.nas, line 38
called from: C:/FlightGear 2018.3.2/data/Nasal/canvas/MapStructure.nas, line 440
called from: C:/FlightGear 2018.3.2/data/Nasal/canvas/MapStructure.nas, line 884
called from: C:/FlightGear 2018.3.2/data/Nasal/canvas/MapStructure.nas, line 1077
called from: C:/FlightGear 2018.3.2/data/Nasal/canvas/MapStructure.nas, line 1104
called from: C:/FlightGear 2018.3.2/data/Nasal/geo.nas, line 386
called from: C:/FlightGear 2018.3.2/data/Nasal/canvas/MapStructure.nas, line 1051
called from: C:/FlightGear 2018.3.2/data/Nasal/canvas/MapStructure.nas, line 1059
called from: C:/FlightGear 2018.3.2/data/Nasal/canvas/api.nas, line 598
called from: C:/FlightGear 2018.3.2/data/Nasal/canvas/map/navdisplay.mfd, line 568
called from: C:/FlightGear 2018.3.2/data/Nasal/canvas/map/navdisplay.mfd, line 252

This happens if you have a runway selected, have a SID in (even if its just DEFAULT), and then change the runway. This causes both the Default Boeing/Airbus Nav Displays (IDG-MD-11X, 777) and the Custom Nav Displays (IDG-A3XX) to stop updating the route itself, but they still move, and all functions still work.



Hi guys

My original error is happening to people left and right.

I FOUND PATTERN:
It can be produced most easily with changing the RW after a STAR and APPROACH are selected in route manager.

This error is destroying several aircraft Nav Display, 777, My Airbus and MD-11, all become difficult because this code broken.

I’m going to D/L a 2019 RC and try it, but I’d appreciate to know if anyone else can find this nasal exact error.



I took a quick look at the first issue.

Nasal runtime error: flightplan.insertWaypoints expects vector as first arg
at C:/FlightGear 2018.3.2/data/Nasal/route_manager.nas, line 40

Appears a scalar value is being passed when a Vector is expected.

for example, it is expecting something like this:

var route = []
append(route, sid.route(me.flightplan.departure_runway))

me.flightplan.insertWaypoints(route, 1);

if sid.route() is expected to return a Vector, then perhaps a nil check is missing.


Dear James which aircraft are you using for test, I will get you exact steps Kind Regards Josh

The 737-800, because it’s what I know best. But happy to try something else.

However, I do suspect it depends on the airport selected - for example at EBBR the Navigraph procedures have different runway names to the ones in our apt.dat. This causes the STAR code to fail to build a route correctly, and hence return an empty set of waypoints, which causes the errors you mentioned.

I’m still confirming this, but I suspect the fix will be to handle these cases more gracefully 0 for examnple if a STAR is selected but we can’t find the transition to a runway, just insert a VECTORS element.

Kind regards,
James


Dear James,

I am really loosing myself in frustration over this. I cannot reproduce it! It only happens when I’m not trying to produce it. It never really happens when on ground.



Please try the following

Have a STAR set, and runway

Be on the star, heading to a waypoint on the star that is not the first.

Try to change the runway select immediately (preferably at a place where the star set is not used

See if the error occurs


Regardless, this is a serious problem that must be fixed.


The failing code block is this:
with error: function/method call on uncallable object

var try_aux_method = func(obj, method_name) {
var name = "<test%"~id(caller(0)[0])~">";
call(compile("obj."~method_name~"()", name), nil, var err=[]); # try...
#debug.dump(err);
if (size(err)) # ... and either leave caght or rethrow
if (err[1] != name)
die(err[0]);
}

called as such:
try_aux_method(me.model, "del");


That would make sense. Deletion has to occur when they are changed.



I am still working on getting a reliable reproduce. *I suggest using the 777 to test, as it uses a bone-generic Canvas Display without any changes*



Would anyone who is knowledgable about what changed MapStructure/Route Manager wise between 2018.2 and 2018.3 chime in? Something happened that broke it, as the error never occurred before 2018.3


1. Load FlightGear, create a route with a SID.
For instance, I chose LFLL - LIRA, selected a LIRA approach, and loaded the DEFAULT SID for 36L
2. Activate the route manager, select first waypoint
I do not know if activating the manager or selecting the first waypoint is needed but I typically do that anyway.
3. Change the runway
I selected 18R - the DEFAULT waypoints disappeared, and I got the error


var makedie = func(prefix) func(msg) globals.die(prefix~" "~msg);
called from
var __die = makedie("MapStructure");
called from die(err[0]);

So, die() is working perfectly and generating an error message as its supposed to.
On line 1105:

__die("model not found")

So - if the first error is not an error at all, then the second error means the try_aux_method is failing because of a function / method call on an uncallable object.

And the question remains as to why it can't find the model at all in the first place?



Can anyone see the problem?







To be very clear,


This issue is breaking every Mapstructure-using aircraft since 2018.3 - it is extremely serious!

Once IDG removes MapStructure to build our own navigation display without MapStructure as we have planned to do, this issue will no longer affect IDG aircraft.
Last edited by legoboyvdlp on Sat Jun 08, 2019 5:54 pm, edited 2 times in total.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Mapstructure request for help - nasal error

Postby Octal450 » Sat Jun 08, 2019 5:50 pm

I might add that this issue came with 2018.3... I don't know if it came with .2 or .1, but it started happening then. So what changed?

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Mapstructure request for help - nasal error

Postby legoboyvdlp » Sat Jun 08, 2019 6:01 pm

Some more background - a similar error was occuring back in 2015:
viewtopic.php?f=25&t=25331

And there are various other errors:

Code: Select all
1313.86 [ALRT]:nasal Nasal runtime error: vector index -1 out of bounds (size: 0)
1313.86 [ALRT]:nasal at C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/map/WPT.lcontroller, line 62
 1313.86 [ALRT]:nasal called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/map/WPT.lcontroller, line 86
1313.86 [ALRT]:nasal called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/MapStructure.nas, line 1088
1313.86 [ALRT]:nasal called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/geo.nas, line 384
1313.86 [ALRT]:nasal called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/MapStructure.nas, line 1051
1313.86 [ALRT]:nasal called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/MapStructure.nas, line 1059
1313.86 [ALRT]:nasal called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/map/WPT.lcontroller, line 26
1313.86 [ALRT]:nasal called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/globals.nas, line 119


that also seems to occur somewhat randomly.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Mapstructure request for help - nasal error

Postby wkitty42 » Sun Jun 09, 2019 12:20 am

Octal450 wrote in Sat Jun 08, 2019 5:50 pm:I might add that this issue came with 2018.3... I don't know if it came with .2 or .1, but it started happening then. So what changed?

the only thing i can suggest here is to check the changelogs and/or the commits in the repo and see if something can be found... it is possible that it is from some sort of memory corruption but that's an extreme WAG...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Mapstructure request for help - nasal error

Postby Octal450 » Sun Jun 09, 2019 8:58 pm

I would... if I had the knowledge. Unfortunately Core Devel is quite a bit out of my expertise at this moment. If I had the time to learn, I would. Hence why we've asked for someone who knows it better to check it out.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Mapstructure request for help - nasal error

Postby legoboyvdlp » Tue Jun 11, 2019 12:06 am

Which it seems like nobody will...
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Mapstructure request for help - nasal error

Postby Octal450 » Tue Jun 11, 2019 1:22 am

Apparently. Which is why I will just build my own f---ing NDs under my own framework... This thing is useless!!!

Kind Regards,
Josh
Last edited by Octal450 on Sun Jun 16, 2019 7:32 am, edited 2 times in total.
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Mapstructure request for help - nasal error

Postby legoboyvdlp » Tue Jun 11, 2019 9:08 am

No, it's just typical...

I ask for help to make a radio (some documentation on how a specific feature works), it gets ignored and then there are complaints because I don't do it the "right" way! I send information about a serious bug that causes a out of memory crash, why it happens, and a merge request that fixes it and nothing ever happens... the release is months past when it's due and Stuart's post yesterday doesn't appear to have been noticed...

I don't know why I expected this post would be any different...
Last edited by legoboyvdlp on Tue Jun 11, 2019 3:43 pm, edited 2 times in total.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Mapstructure request for help - nasal error

Postby legoboyvdlp » Tue Jun 11, 2019 2:49 pm

Ok - it cannot (edit - can ) be reproduced with the 737-800 or 747-400, yet.

I do get this a fair bit when deleting waypoints. I believe it may be related?

Code: Select all
 Nasal runtime error: vector index -1 out of bounds (size: 0)
  902.59 [ALRT]:nasal        at C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/map/WPT.lcontroller, line 62
  902.59 [ALRT]:nasal        called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/map/WPT.lcontroller, line 86
  902.59 [ALRT]:nasal        called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/MapStructure.nas, line 1092
  902.59 [ALRT]:nasal        called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/geo.nas, line 384
  902.59 [ALRT]:nasal        called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/MapStructure.nas, line 1055
  902.59 [ALRT]:nasal        called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/MapStructure.nas, line 1063
  902.59 [ALRT]:nasal        called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/canvas/map/WPT.lcontroller, line 26
  902.59 [ALRT]:nasal        called from: C:/Users/redpa/Documents/Programs/FlightGear 2018.3.0/data/Nasal/globals.nas, line 119




Ok - I think this may be another manifestation of the same error, because it is breaking the 777's waypoints: for instance:
Image

However in this case the pink line stays correct.

I have got the nasal error on all three Boeing aircraft I tested. But only on the 777 (seemingly) the waypoints broke.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Mapstructure request for help - nasal error

Postby wkitty42 » Tue Jun 11, 2019 7:40 pm

FWIW: it is possible that the folks that need to see this and fix it are either
1) not seeing the posts on the mailing list for some reason (might depend on how they are reading the list)
2) are busy elsewhere in RL, or maybe
3) deep into what they are working on in FG, can't get to it at the moment, and may have their repo modified to an extent that they cannot easily find and fix the problem much less get a patch generated and pushed without including some of their WIP code stuffs...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Mapstructure request for help - nasal error

Postby legoboyvdlp » Tue Jun 11, 2019 10:33 pm

You are right, and I apologize for the tone of my earlier post.

However I will admit it is frustrating when this issue was first reported in April and nothing has happened yet.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Mapstructure request for help - nasal error

Postby legoboyvdlp » Tue Jun 11, 2019 11:35 pm

Right - possible steps to reproduce, worked twice so far.

Load the 777 at Belfast runway 35. Flightplan EGAA - DEFAULT - IOM - WOD - STAR - EDDF 25L

I remove the IOM and WOD waypoints and then change the runway to 25 and change the SID to 25-DEFAULT. The result is the pink line being right but waypoints wrong as above.


Anyone manage to reproduce it? If not keep changing the runway / SIDS / adding / removing waypoints, you'll get it eventually :P
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Mapstructure request for help - nasal error

Postby Isaak » Wed Jun 12, 2019 7:11 am

i see the same here, so you 're at least not alone. I even get the error on long flights even if I don't modify the route. Also, sometimes (I can't point my finger on it), the waypoints on the SID/STAR/APP are not shown on the ND. If I remove duplicate waypoints (e.g. IAF being inserted by both the STAR and the APP) before activating, most of the time this doesn't occur, but even then sometimes it does. I use Navigraph data and most of the time load my routes with a .gpx file from skyvector.
Want to support medical research with your pc? Start Folding at Home and join team FlightGear!
Isaak
 
Posts: 768
Joined: Sat Jun 04, 2011 3:52 pm
Location: Hamme, Belgium
Pronouns: he, him
Callsign: OO-ISA
Version: next
OS: Windows 10

Re: Mapstructure request for help - nasal error

Postby Octal450 » Wed Jun 12, 2019 7:37 am

legoboyvdlp wrote in Tue Jun 11, 2019 10:33 pm:You are right, and I apologize for the tone of my earlier post.

I don't. Not when nobody involved will even admit that there might be a problem. I don't ask others to fix bugs or severe problems in my software, at the very most I explain why there is a delay. I don't believe it is my place - as someone who has 0 experience/work with mapstructure - to correct it. Hence why I am frustrated nobody involved has stepped forward (even those who frequently promote it, you know who you are)

So yes, I am a bit ticked off considering the amount of effort I put forward in support users of my software when they have issues.

So yes, this is one of the MANY reasons why I am dumping mapstructure forever in my upcoming custom MCDU and ND simulation.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Mapstructure request for help - nasal error

Postby wkitty42 » Thu Jun 13, 2019 2:13 am

i don't even know who wrote this map structure thing so i can't tell if i've seen them around anywhere since it was written and introduced :(
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Next

Return to Canvas

Who is online

Users browsing this forum: No registered users and 5 guests