Board index FlightGear Support Multiplayer

FG segfault when changing LOD ranges

Trouble getting online, setting up a server?
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- copy&paste your commandline.

Please, also see Requesting Technical Help.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

Re: FG segfault when changing LOD ranges

Postby AR-1 » Mon Sep 25, 2023 9:15 am

@SurferTim
1) This seems correct to me
2) Indeed I have seen "no metar available" for a couple of seconds
AR-1
 
Posts: 148
Joined: Tue Dec 06, 2022 3:14 pm
Callsign: AR-1
Version: next
OS: Debian

Re: FG segfault when changing LOD ranges

Postby SurferTim » Mon Sep 25, 2023 10:03 am

I don't know what else to tell you. I figured after almost 2 years, that bug would have been fixed. Maybe it isn't the same bug.

Bad news: Yours (and I imagine others) crashes a lot.
Good news: Mine never crashes.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1612
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: FG segfault when changing LOD ranges

Postby polly » Tue Sep 26, 2023 11:29 am

I'm sorry, can you possibly add some background to this patch ? I've gone bach trough the thread, which references other threads and all seem to be talking about Canvas, Multi displays, Threading, Shiva with a lot of exposition but no direct reference to any problems with a plain PLib menu causing a crash.
Was there an issue with the LOD menu that was never mentioned in the threads but which cleared while applying a supposed multi-threading patch ? Thanks.
User avatar
polly
 
Posts: 819
Joined: Thu Nov 04, 2010 3:45 pm

Re: FG segfault when changing LOD ranges

Postby SurferTim » Tue Sep 26, 2023 1:48 pm

Let me look. It was a 2 line change to a SimGear file.

Edit: Here is the post with the fix. Thanks to Hooray!
viewtopic.php?f=4&t=39475&start=75#p390955
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1612
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: FG segfault when changing LOD ranges

Postby polly » Tue Sep 26, 2023 2:22 pm

Thanks, I got that fix, it's whether or not there was a problem with a PLib menu at the time that a Canvas fix somehow affected. The lead developer has requested some detail since the original threads are not easy to follow.
User avatar
polly
 
Posts: 819
Joined: Thu Nov 04, 2010 3:45 pm

Re: FG segfault when changing LOD ranges

Postby SurferTim » Tue Sep 26, 2023 2:34 pm

You are correct. It is hard to follow. I tried so many things that hadn't worked and was becoming frustrated. That was around page 7.
Basically, any canvas display caused my system to crash, like this:

Initially with one display, it took a little less than an hour to crash.
Finally, with 3 displays, the fails happened quickly. I couldn't even get to the runway before a crash.
All this time, I had to wait for the MP server or FG would crash back to my desktop.

Then Hooray talked me into that 2 line addition to the SimGear file, and both the problems went away, never to return.
...and they all lived happily ever after.
The End.
:D
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1612
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: FG segfault when changing LOD ranges

Postby polly » Tue Sep 26, 2023 2:53 pm

OK Thanks, but I'm trying to understand how this is related to a reported segfault in the View-LOD menu; I'd run the debug and traced it to a spot in the PUI code when I understood your posts to be telling me this patch fixed this PLib issue.
I've flagged this patch as a fix for the View-LOD PLib menu.
What I'm reading now is, your issue was Canvas related and the patch is not confirmed to fix a segfault on a PLib menu, is that correct ? Thanks
User avatar
polly
 
Posts: 819
Joined: Thu Nov 04, 2010 3:45 pm

Re: FG segfault when changing LOD ranges

Postby SurferTim » Tue Sep 26, 2023 2:56 pm

I don't know about PLib. Is View-LOD a canvas display?
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1612
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: FG segfault when changing LOD ranges

Postby polly » Tue Sep 26, 2023 3:02 pm

No, it's the top-of screen menu, accessed by F10-View-Adjust LOD Ranges; the old menu system predates Canvas.
User avatar
polly
 
Posts: 819
Joined: Thu Nov 04, 2010 3:45 pm

Re: FG segfault when changing LOD ranges

Postby SurferTim » Tue Sep 26, 2023 3:06 pm

It appears to be down to a dilemma.
1) Keep waiting for MP server before selecting menu items.
2) try the 2 line patch.

The question is: Are you willing to try the patch?

Edit: What old menu system> My main screen menu under "equipment" has a canvas map.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1612
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: FG segfault when changing LOD ranges

Postby wkitty42 » Tue Sep 26, 2023 3:55 pm

SurferTim wrote in Tue Sep 26, 2023 3:06 pm:Edit: What old menu system>

the entire PLIB menu system accessed via F10... the canvas map was added later as have been all canvas items in FG now...
"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: 8941
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: FG segfault when changing LOD ranges

Postby Hooray » Tue Sep 26, 2023 9:25 pm

SurferTim wrote in Tue Sep 26, 2023 1:48 pm:I don't know what else to tell you. I figured after almost 2 years, that bug would have been fixed. Maybe it isn't the same bug.
[...]
Let me look. It was a 2 line change to a SimGear file.

[...]
Then Hooray talked me into that 2 line addition to the SimGear file, and both the problems went away, never to return.
...and they all lived happily ever after.
[...]
Edit: Here is the post with the fix. Thanks to Hooray!
viewtopic.php?f=4&t=39475&start=75#p390955


Hi Tim,

as far I as I understand, the folks here are talking about a multiplayer related crash, I don't currently see if/how this should be related to said patch.

to be honest, I could hardly remember that topic - but frankly, now that I do recall the patch, I am also surprised that this got never fixed properly.

It's possible that the nature of my patch was not "proper enough" to make the review, I really don't know - I am not actively involved these days, I do remember talking to Jules back then who appreciated the troubleshooting that we did in your topic - and I do think that I moved some of the relevant bits over to the wiki.

If the issue only happens when [not] using MP, that would indicate a threading path that my patch didn't address - I really don't know, I never used MP at all.
Based on my understanding, MP models are paged in/out using PagedLOD, and I believe that work was done by Stuart (?) - so if there are side effects relating to MP being on/off, that's what I'd personally check next, assuming that PagedLOD may be using worker threads that are not properly synchronized with the ShivaVG, but I am really talking out of my .... here

(I do realize that this must sound like Japanese to you, but looking at the thread, it seems that wkitty42 did provide help and backtraces back then, maybe we can recruit him once again ?)

It's best to file a proper bug report with sufficient details so that people can reproduce the issue - it isn't unlikely that your original issue and my patch are unrelated to what MP users are now seeing here, unless it's also affected by the OSG threading mode ?

EDIT: The Canvas.Path issue is summed up here: https://wiki.flightgear.org/FlightGear_ ... 8OpenVG.29

Given that it's been two years, I believe a proper bug report would make sense at this point - and you should get Stuart, Fernando and James involved to get a proper guesstimate as to what might be going on here...And if it's still Shiva related, you guys should also get Erik and Scott involved/CC'ed since they both worked on Shiva in the past.

I suppose, and hope, with these 5+ folks the critical mass should be sufficient to gather some really useful feedback to help us better understand/fix the issue once and for all.
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: 12703
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: FG segfault when changing LOD ranges

Postby SurferTim » Wed Sep 27, 2023 5:35 am

Hi Hooray! Like I said earlier, I don't know what else to tell you, except I'm just telling you the facts.
Before the patch, my FG2020.4.0 d_n_c ALWAYS crashed if I didn't wait a minute before selecting "Fly" from the launcher.
After the patch, it has NEVER crashed, even selecting "Fly" within moments of starting the launcher.
The patch was the only change. It was your recommendation. If it hasn't been fixed, that would be up to you to push for a change.
Good news: Mine always works.
Thanks! :D

Edit: Just one more thing. My problem crash ended with a Segfault in the log. The segfault in the subject is what caught my attention.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1612
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: FG segfault when changing LOD ranges

Postby Hooray » Wed Sep 27, 2023 8:00 pm

I believe by now it must have been over a year ago since I built/ran FG, so I am not in a particularly good position to judge what's going on.

While I don't quite see how these issues could be related, I will enjoy the credit you're giving my patch while it lasts :lol:

Seriously though, the folks still running into segfaults should definitely consider filing a proper bug report.
If this issue is still the problem and if this patch fixes it, it needs to go up the chain to be discussed among core devs.

Personally, I am unlikely to have any significant spare time in the next couple of months to help with this, and if I had a little more time, I would be more interested in looking at some of the Canvas/Compositor issues that Fernando mentioned - which is to say, I am basically out ... sorry folks :D

If any of the folks mentioned above are currently still around, I would suggest to get them involved - even if just to discuss the original patch/problem (as in, Stuart, Jules, Fernando, James and Scott that come to mind) - to get the process started, someone who uses the d&c script (hello wkitty42 ??) could open a merge request to get the patch discussed/reviewed and integrated (linking back to the original topic), which is probably going to do more in a single week than sitting idle on the forum for another 2 yrs
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: 12703
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: FG segfault when changing LOD ranges

Postby polly » Thu Sep 28, 2023 2:05 pm

A segfault happens on a memory access out of bounds and so a fix for one segfault may be unrelated to another's.

In this case, when the High Detail slider is clicked, the pointer for the name of the parent dialog is invalid. This happens if both MP server is not connected and AI traffic is not enabled ( at least here ) ; if either MP or AI are active the Parent Dialog has a name, 'static-lod'. Perhaps an AI/MP dialog shouldn't be accessible if AI and MP are inactive, perhaps those menu entries shouldn't be clicked.

It's not clear the CanvasPath patch has a certain effect, I've seen the segfault after applying the patch, maybe less frequently, so I cannot say for sure if the segfault is caused by uninitialised properties or by a thread timing issue.
User avatar
polly
 
Posts: 819
Joined: Thu Nov 04, 2010 3:45 pm

PreviousNext

Return to Multiplayer

Who is online

Users browsing this forum: No registered users and 1 guest