wlbragg / Cargo-Towing-Addon

Allows for a quick and easy method (addon) to add cargo hauling and stacking capability to any FlightGear aircraft.
Other
2 stars 0 forks source link

Error message when select cargo in FlightGear Next #1

Closed HHS81 closed 4 years ago

HHS81 commented 4 years ago

I get following error message:

undefined symbol: place_model:
 at C:/Users/Heiko/FlightGear/Addons/Cargo-Towing-Addon/Models/treefarmcargoset/cargoset.nas, line 64

not possible to select any cargo tested with bo105

wlbragg commented 4 years ago

Hum, this makes no sense what so ever. For sure a nasal error of any kind breaks the rest of the addon functionality. But this error is next to impossible where it happened and here's why...

cargo1 = place_model("1",    0, "pine-tree",        model_path,  5,     0.0,     150, 2.08, 6.12, lat, lon, alt,    0, 0, 0, -1);
  cargo2 = place_model("2",    1, "pine-tree",        model_path,  5,     0.0,     150, 2.08, 6.12, lat, lon, alt,    0, 0, 0, -1);
  cargo3 = place_model("3",    2, "pine-tree",        model_path,  5,     0.0,     150, 2.08, 6.12, lat, lon, alt,    0, 0, 0, -1);
  cargo4 = place_model("4",    3, "pine-tree",        model_path,  5,     0.0,     150, 2.08, 6.12, lat, lon, alt,    0, 0, 0, -1);
  cargo5 = place_model("5",    4, "pine-tree",        model_path,  5,     0.0,     150, 2.08, 6.12, lat, lon, alt,    0, 0, 0, -1);
  cargo6 = place_model("6",    5, "dump-truck",       model_path,  0,      .5,   10000, 5.69,15.45, lat, lon, alt-90, 0, 0, 0, -1);

Line 64 is the third model being placed in the list, so the only way that breaks is if a line before it is corrupted, which it is not as far as I can tell. Also I can't reproduce with a current pull of the Addon using the bp105 in qt-launcher installed aircraft list. Can you verify in your cargoset.nas that line 64 is the third model being loaded? Depending on when and how you've been updating your addon, Id's suggest making sure your starting with a new addon installation and a clean aircraft-data cache. @StuartC is also not reporting this error using the current up to date addon?

HHS81 commented 4 years ago

Sorry, I made a clean fresh installation of the addon via git clone, cleaned aircraft-data-cache. I got this: 119.54 [ALRT]:nasal undefined symbol: place_model: at C:/Users/Heiko/FlightGear/Addons/Cargo-Towing-Addon/Models/basecargoset/cargoset.nas, line 73 119.56 [ALRT]:general Dialog __screen_display_1__ not defined 120.73 [ALRT]:nasal Nasal runtime error: bad/missing argument to split() 120.73 [ALRT]:nasal at , line 3

wlbragg commented 4 years ago

What system are you using, Linux, Windows, Mac? What version of FlightGear and SimGear? I understand what the undefined symbol : place_model refers to. The call in cargoset.nas is not seeing the function in cargoopporations.nas called place_model(). I'll have to take that up on the dev list as that appears to be a scope issue and is way beyond my knowledge base. It just shouldn't be happening. Unless maybe your on to old a FligthGear/Simgear version. The other _screen_display_1 not defined is an error that the GUI is generating that is also outside the scope of the entire addon function. That appears to be in the core rendering routines, Nothing I touch locally in the addon.

HHS81 commented 4 years ago

What system are you using, Linux, Windows, Mac? What version of FlightGear and SimGear?

Windows 10 FlightGear Nightly Builds from this week.

wlbragg commented 4 years ago

@HHS81 I missed this one 120.73 [ALRT]:nasal Nasal runtime error: bad/missing argument to split() 120.73 [ALRT]:nasal at , line 3 This is the nasal api (I believe) split function, I use it in the GUI to parse the strings I build coming from the model positioning data, the load point data and the model set data.

The spit function in this case works using a space for the delimiter to split the string on. Unfortunately the GUI is not the best at reporting where the error occurred in what nasal block, only the line number of that nasal block. With that said, if you are not building up the cargo model property tree then of course trying to split data that is not there will fail. So the GUI error is a result of the nasal function call error.

I need you to verify that line 73 in your version of Addon/Model/basecargoset/cargoset.nas is the line that starts with. cargo4 = place_model(... Also, in your log does it show any of the cargo loading? If so what is the last cargo number it loads? Actually I would like to see your entire log if possible. It should look like this...

Cargo Created:
cargo1
container-big
34.20069407303848/-119.2172410428283
Elev-ft:-999
Head:0
Stack:-1

   97.07 [ALRT]:nasal      
Cargo Created:
cargo2
container-big
34.20069407303848/-119.2172410428283
Elev-ft:-999
Head:0
Stack:-1

   97.07 [ALRT]:nasal      
Cargo Created:
cargo3
container-big
34.20069407303848/-119.2172410428283
Elev-ft:-999
Head:0
Stack:-1

   97.07 [ALRT]:nasal      
Cargo Created:
cargo4
ground-tank
34.20069407303848/-119.2172410428283
Elev-ft:-999
Head:0
Stack:-1

   97.07 [ALRT]:nasal      
Cargo Created:
cargo5
ground-tank-lg
34.20069407303848/-119.2172410428283
Elev-ft:-1089
Head:0
Stack:-1

   97.07 [ALRT]:nasal      
Cargo Created:
cargo6
ground-tank-tall
34.20069407303848/-119.2172410428283
Elev-ft:-1089
Head:0
Stack:-1

   97.07 [ALRT]:nasal      
Cargo Created:
cargo7
tank-stand
34.20069407303848/-119.2172410428283
Elev-ft:-1089
Head:0
Stack:-1

   97.07 [ALRT]:nasal      
Cargo Created:
cargo8
micro-relay
34.20069407303848/-119.2172410428283
Elev-ft:-1089
Head:0
Stack:-1

Why this is so unusual is if this is true then the code doesn't fail until it gets to the 4th cargo model and then suddenly it doesn't see the function it just used?

I'm posting a link to this on the developers mailing list right now as I have no answer or clue as to where to start looking.

HHS81 commented 4 years ago

Addon/Model/basecargoset/cargoset.nas or Addon/Models/basecargoset/cargoset.nas ? The last is the one I have here.

That how my cargoset.nas looks like: Cargoset nas

I don`t get your log, just the usual fgfs.log

wlbragg commented 4 years ago

@HHS81 OK, this makes things a little less confusing. Your failing on the first call to place a model. That is way better than after it worked once or twice. This means your probably catching another nasal error your not seeing or noticing before the place_model error. So here is what I need you to do. If you would please update your ADDON and then try again with two different helicopters and if it fails post whatever log you get. I made some changes that might be triggering some subtle errors with may be the cause of your error.

HHS81 commented 4 years ago

I could see an error message before anything else ist starting:

Nasal runtime error: object has no size() at C:/Users/Heiko/FlightGear/fgdata/Nasal/string.nas, line 70 called from: C:/Users/Heiko/FlightGear/fgdata/Nasal/modules/repair_config.nas, line 31 called from: C:/Users/Heiko/FlightGear/fgdata/Nasal/modules/repair_config.nas, line 76 Module.load() org.flightgear.addons.CGTOW CGTOW addon initialized from path C:/Users/Heiko/FlightGear/Addons/Cargo-Towing-Addon [OK] 'Cargo Towing' (V. 1.0.0) loaded.

then later followed by:

Nasal runtime error: non-scalar in string context at __dlg:rope-dialog, line 53 0 Transport 0 Transport undefined symbol: place_model: at C:/Users/Heiko/FlightGear/Addons/Cargo-Towing-Addon/Models/basecargoset/cargoset.nas, line 70 Dialog __screen_display_1__ not defined Dialog __screen_display_2__ not defined 0 Railroad 0 Railroad undefined symbol: place_model: at C:/Users/Heiko/FlightGear/Addons/Cargo-Towing-Addon/Models/basecargoset/cargoset.nas, line 70 undefined symbol: place_model: at C:/Users/Heiko/FlightGear/Addons/Cargo-Towing-Addon/Models/basecargoset/cargoset.nas, line 70 undefined symbol: place_model: at C:/Users/Heiko/FlightGear/Addons/Cargo-Towing-Addon/Models/basecargoset/cargoset.nas, line 70

The log: fgfs.log

HHS81 commented 4 years ago

@wlbragg
Update: the first error message comes from a entry I put into default.xml (clickable tower view). But it doesn`t solve the second error message - there are cargo in the list I can choose.

Btw. the UFO is working- I can select object in the list there, and place it.

wlbragg commented 4 years ago

But it doesn`t solve the second error message - there are cargo in the list I can choose.

I'm not sure I understand, even if you resolve the first error, you still get the second place_model error?

Btw. the UFO is working- I can select object in the list there, and place it.

So that leads me to believe a non-related nasal error is causing the place_model error in the addon. If not then the addon would fail with the ufo as well.

tested with bo105

Is that the default FGADDON aircraft or custom? If custom, where can I get it to test? The default bo105 from addon works on my system.

HHS81 commented 4 years ago

I'm not sure I understand, even if you resolve the first error, you still get the second place_model error?

Sorry, I meant: there are no cargo in the list I choose.

So that leads me to believe a non-related nasal error is causing the place_model error in the addon. If not then the addon would fail with the ufo as well.

I meant -the UFO has the same feature: a dropdown list of objects you can choose from. But your Addon isn`t working with UFO as well

Is that the default FGADDON aircraft or custom?

It is FGAddon- everything I test is FGAddon to make sure nothing else is causing the error.

wlbragg commented 4 years ago

Unless you get rid of the first error, "the first error message comes from a entry I put into default.xml (clickable tower view)" I don't think the addon error will go away. I can't determine any other reason for the addon error other than nasal execution is failing after the first error, or at the least it is causing a disruption some how.

Looking at the log you provided it appears maybe you were trying the Alouette-III? You also had a nasal error prior to the addon error

   83.67 [ALRT]:nasal     C:\Jenkins\workspace\Windows-nightly\flightgear\src\Scripting\NasalSys.cxx:1308: Nasal runtime error: object has no size()
   83.68 [ALRT]:nasal     C:\Jenkins\workspace\Windows-nightly\flightgear\src\Scripting\NasalSys.cxx:1320:   at C:/Users/Heiko/FlightGear/fgdata/Nasal/string.nas, line 70
   83.68 [ALRT]:nasal     C:\Jenkins\workspace\Windows-nightly\flightgear\src\Scripting\NasalSys.cxx:1324:   called from: C:/Users/Heiko/FlightGear/fgdata/Nasal/modules/repair_config.nas, line 31
   83.68 [ALRT]:nasal     C:\Jenkins\workspace\Windows-nightly\flightgear\src\Scripting\NasalSys.cxx:1324:   called from: C:/Users/Heiko/FlightGear/fgdata/Nasal/modules/repair_config.nas, line 76

I don't know what these errors are, all i know is the addon framework seems to be touchy to this kind of error prior to its own execution. Until any and all preceding errors are gone I can't verify that it is the addon that is the issue.

HHS81 commented 4 years ago

@wlbragg None of the helicopters is working. Only your AirCrane- but it doesn`t use the Addon.

Maybe it has something to do with the binaries of the jenkins builds?

wlbragg commented 4 years ago

Maybe it has something to do with the binaries of the jenkins builds?

I suppose it could be, but I still suspect the "unrelated" errors I keep seeing in every attempt you try. If you try an aircraft that is error free prior to the place_model error, then maybe? But until you have a try with an aircraft that shows no "unrelated" nasal errors I have to consider the first case nasal error causing issues with the addon. You follow what I am saying? So far every time I ask for the log there has always been some kind of nasal error, unrelated to the addon, before we see the addon error. If that is true then we still haven't gotten to a clean error free aircraft. Or I am not understanding what your reporting. Is the Jenkins build at fault for always creating a build with some kind of nasal error, I don't know?

You can try the aircrane that has no built in cargo hauling, either fgaddon or the compositor branch at the github repository. But at this point it more likely not the aircraft's at all nor the addon. You may be right about the jenkins build. That doesn't explain why the stand alone aircrane with built in cargo hauling works though.But nasal in the scope of an addon behaves differently than that in the scope of the aircraft.

HHS81 commented 4 years ago

@wlbragg The first error isn`t the cause - I could fixed it as a I said it here:

the first error message comes from a entry I put into default.xml (clickable tower view). But it doesn`t solve the second error message - there are cargo in the list I can choose.

When I delete my own personal change of the default.xml, the unrelated error dissapears. But not the one with your Addon. That´s why I`m thinking that there must be something wrong with the binaries. Maybe I should check the official release?

wlbragg commented 4 years ago

Ah, OK I didn't understand that you actually corrected the "prior" error. Yeah, something is not right. The place_model in cargoset.nas is called first by the main nasal config file addon-main.nas and places "default" cargo (hidden by default) or persistent cargo wherever it was positioned by the user. Then it is again called if the user opens the cargo menu and changes the cargo set to use. It might be helpful to know if it is the addon-main.nas function loading the cargoset.nas which calls the place_model function automatically or if it is not until you try to change cargo sets in the GUI that breaks.

Try loading FGFS and immediately check the log and see if the palce_model error exist. If not, then open the Cargo dialog and select a different cargo set and then check the log and see if that is when it failed.

HHS81 commented 4 years ago

@wlbragg I followed your advice: 1.) just loading fgfs = no error message

2.) Open Cargo Dialog, selected a cargo set: undefined symbol: place_model: at C:/Users/Heiko/FlightGear/Addons/Cargo-Towing-Addon/Models/militarycargoset/cargoset.nas, line 51 Dialog __screen_display_1__ not defined

I don`t think the log does show anything: fgfs.log

HHS81 commented 4 years ago

@wlbragg

Oh wait, the log does show something: C:\Jenkins\workspace\Windows-nightly\flightgear\src\Scripting\NasalSys.cxx:494: undefined symbol: place_model: at C:/Users/Heiko/FlightGear/Addons/Cargo-Towing-Addon/Models/militarycargoset/cargoset.nas, line 51

Edit: it is the same rror message as above. Will test the official relase 2018.3 of FlightGear

HHS81 commented 4 years ago

@wlbragg Surprise! Surprise!

It does work in FGFS 2018.3.5, but not in the newer 2019.X.X.

wlbragg commented 4 years ago

Interesting, I just tried it on 2019-2-0 and it doesn't work either. Now that I can reproduce it, I can dig in to it.

HHS81 commented 4 years ago

@wlbragg I was already starting to doubt myself 😄 Would be cool to have your addon!

Would be there any possbility that the heliocpter-itself-implemented-winch could be also used? Like I have on the EC/H135?

wlbragg commented 4 years ago

I was already starting to doubt myself

Nope, the part that was being difficult was that it broke between 2019.2.0 of a few weeks ago and now.

I have already narrowed down the first issue to a addon GUI but don't know the root cause yet.

Would be there any possbility that the heliocpter-itself-implemented-winch could be also used? Like I have on the EC/H135?

I'll take a look at it once I get this current issue resolved and another issue @StuartC and myself are both having.

wlbragg commented 4 years ago

Wow, the devs introduce a structural change in the way nasal scope is handled in the addon space. In the last few weeks they changed the addon nasal space to no longer recognize nasal added using the io.load_nasal from one io.load to the next, or I am not correctly calling for the nasal function across files. It's going to take some time and discussion to sort this out.

HHS81 commented 4 years ago

@wlbragg https://sourceforge.net/p/flightgear/fgaddon/4753/

https://sourceforge.net/p/flightgear/fgaddon/4754/

should give you an idea

wlbragg commented 4 years ago

Yeah, maybe. It's still going to take some unraveling as it appears to have broke more things than it fixed. At least initially.

Thanks

wlbragg commented 4 years ago

@HHS81 I am debugging the issue and discovered a couple major bugs in the rope-dialog.xml. There are few typos, I am surprised it ever worked. But there are still more undetermined bugs hanging things up.

wlbragg commented 4 years ago

@HHS81 it's working now from current next. Maybe you can verify that for me.

HHS81 commented 4 years ago

@wlbragg

@HHS81 it's working now from current next. Maybe you can verify that for me.

Success

HHS81 commented 4 years ago

I think I have to update the Bo105 really soon!