Board index FlightGear Development Effects and shaders

Segfault when looking out left window to taxi and landing li  Topic is solved

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Segfault when looking out left window to taxi and landing li  

Postby wlbragg » Tue Aug 13, 2019 9:21 pm

Split off from the topic JSBSim Piper J-3 Cub.


I have an issue with both the nasal light manager that controls procedural spot lights and the effects framework built in ALS interior landing light system.

They both are throwing a segfault when I either change to the exterior view or change the interior view to look out the left window. The left side, or wing, just so happens to be where the landing and taxi light objects happen to be located. I don't think that has anything to do with it though as I completely removed all other object animation, selection and effects pertaining to the landing and taxi light objects. Besides that the procedural lights really don't have anything to do specifically with the "left" side or views in any manner that I am aware of.

Now to complicate this, the exterior procedural and procedural spot nav lights are working fine. They are managed partially with the nasal view manager as well. You can even have the landing and taxi lights on and look to the right nav light from the interior view and not cause the segfault.
I have isolated only using default ALS lights (ie: /sim/rendering/als-secondary-lights) or only ALS procedural spot lights and they both trigger the segfault when looking to the left or going to an exterior view. Yet the nav spot and procedural work fine.
So I don't think the relationship is ALS procedural to either object animations, selections, or other lighting effects.
I think this is something deeper.

Now to add to this. This all started awhile back after some core changes I never isolated. The c172p started developing a similarly caused segfault (don't recall the exact trigger) other than it was related to the ALS nasal light manager. It had to do with where the listeners were located in the code section. Thanks to Richard who figured out that it was related to the listener locations (I think that was the bottom line) it was fixed in the c172p.
Unless I missed something (very well could have) the J3/pa-18 code is mostly the same as the c172p.
My code in the J3/PA-18 is unique in it is the only aircraft that is using this combination of procedural and ALS lighting effects all together. The c172p is close but not exactly the same.
The biggest difference between the two is the c172p is using only one spot light (nasal light manager controlled) that uses the "stretch" parameter and the J3 is using two spot lights that use the stretch parameter.

I know this is a lot of information and probably not explained all that well as I find it difficult to explain all the different effects used and their appropriate names when describing this. Nor the exact issue the c172p had that has been fixed. However the same steps taken on the c172p to fix it were done to the j3/pa-18, or at least I attempted this.

I could really use some help figuring this out and if it was something I am doing wrong or something else. Unfortunately the code for all this is complex. I think it all resides in Nasal/light-manager.nas and Systems/als-lights.xml as well as the ALS shader effects coding in fgdata and of course the object switch animations in Models/ j3cub.xml and Models/ pa-18.xml

I'm going to keep digging in the code but I am stumped at the moment and have no choice but to turn off the effects until it is figured out.

Examining any differences between the effects code of the c172p and j3/pa-18 may hold a clue.

I'm hoping a fresh set of eyes will spot something obvious.
Last edited by Johan G on Thu Aug 15, 2019 11:25 am, edited 1 time in total.
Reason: Split off from the topic "JSBSim Piper J-3 Cub".
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Segfault when looking out left window to taxi and landin

Postby icecode » Fri Aug 16, 2019 12:12 pm

I don't have much to add as I'm not really familiar with ALS lights or the Nasal involved in controlling them, but I can say that it's not related to effects or shaders. The graphics pipeline and the GPU almost always eat whatever they are given without complaining. The only exception to this are memory operations on the GPU, eg. texture reservation, loading etc. The effects framework and OSG are very robust so I'd rule out that possibility.
icecode
 
Posts: 709
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: Segfault when looking out left window to taxi and landin

Postby Thorsten » Fri Aug 16, 2019 1:06 pm

Could it be a naming thing that two derived effects for the light appearance / effect on the surface share the same name and that causes issues? Usually the framework seems to be remarkably resilient against such problems, but I don't think there's a guarantee.

Otherwise, echoing what IcecodeGL has written - I know from long experience that it is really really hard to trigger a segfault with Effect files or shader code - the GPU usually isn't discouraged by something as mundane as a NaN or infinity - it just keeps drawing something, so even feeding non-existing properties to a shader won't cause real issues.

Also, while it is possible to trigger segfaults from Nasal, it's not really easy either (I think can name only three ways to do that).
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Segfault when looking out left window to taxi and landin

Postby wlbragg » Fri Aug 16, 2019 3:58 pm

Thanks guys, that was enough to point me in the right direction, well actually left.
It is an "untextured" object (a white lamp under the clear landing light cover) that when made visible with the select animation and enters the viewed scene causes a segfault.
I have noticed in the past with other objects, that if they have only a material and are not textured they blow the sim out. why? More specifically, why some do and some don't?
Is it because you are trying to applying an effect that requires a texture to a mesh that is not textured?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Segfault when looking out left window to taxi and landin

Postby wlbragg » Fri Aug 16, 2019 4:04 pm

Is it because you are trying to applying an effect that requires a texture to a mesh that is not textured?

Answered my own question, i removed the lamp from any effects other than a material animation and it solved the issue.
Wouldn't hurt to catch that type of improper coding and at least put a line in the log about it.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070


Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 4 guests