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.

Re: Mapstructure request for help - nasal error

Postby legoboyvdlp » Tue Jun 23, 2020 5:25 pm

@Hooray - primarily aimed at you, but if anyone else wants to chip in:


The errors identified above, to do with discontinuities, vectors, etc I believe are all fixed. This issue is still recurring -- I finally got some proper debug info, from a user who can reliably reproduce this issue (which I am as yet unable to do).

Code: Select all
 1289.56 [INFO]:nasal     C:/Users/Stefan/Documents/doc/FlightGear/Aircraft/A320-family/Models/Instruments/ND/canvas/map/RTE.lcontroller:51: Running query: RTE
 1289.56 [INFO]:nasal     C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas:1103: Deleting symbol of type RTE
 1289.56 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1313: Nasal runtime error: MapStructure model not found
 1289.56 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1331:   at C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas, line 27
 1289.56 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1336:   called from: C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas, line 1104
 1289.56 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1336:   called from: C:/Program Files/FlightGear 2020.1.2/data/Nasal/geo.nas, line 448
 1289.56 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1336:   called from: C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas, line 1051


This is the symbol that's failing -- so I hope this makes it clearer what's going on.


So - the geo.PositionedSearch callback is calling onRemoved -- and at times either delSym fails to find the model.

Other times, you might get this:

Code: Select all
Deleting symbol of type RTE
 1289.01 [INFO]:nasal     C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas:882: LineSymbol.del()
 1289.06 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1313: Nasal runtime error: function/method call on uncallable object
 1289.06 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1331:   at C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas, line 38
 1289.06 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1336:   called from: C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas, line 440
 1289.06 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1336:   called from: C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas, line 884
 1289.06 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1336:   called from: C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas, line 1077
 1289.06 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1336:   called from: C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas, line 1104
 1289.06 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1336:   called from: C:/Program Files/FlightGear 2020.1.2/data/Nasal/geo.nas, line 448
 1289.06 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1336:   called from: C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas, line 1051
 1289.06 [ALRT]:nasal     C:\Jenkins\workspace\Windows-release\flightgear\src\Scripting\NasalSys.cxx:1336:   called from: C:/Program Files/FlightGear 2020.1.2/data/Nasal/canvas/MapStructure.nas, line 1059



Hope this maybe helps make it clearer what's going on -- at least its known what symbol / symbols are failing now.
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 Hooray » Thu Jul 02, 2020 3:49 pm

that would suggest that it's trying to delete invalid objects, which can be easily worked around by adding an isNil() check first - but I wonder why this is happening at all, either it's a route manager issue, a GC issue or something else.


To be clear about it, the issue is unlikely to be due to MapStructure itself, it's more likely that it's referring to previously removed symbols for some reason currently eluding me ...

I guess, I'd suggest to troubleshoot this by using Nasal's id() API and call that for each ghost that's added/removed - you can also use the id as a key for a hash lookup to see if anything gets deleted repeatedly. For instance, something like this is possible if the route manager/Nasal bindings are using the wrong type of smart pointer.

Again, best to use id() to see if any ghosts are disappearing unexpectedly.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Previous

Return to Canvas

Who is online

Users browsing this forum: No registered users and 6 guests