Board index FlightGear Support

Crash - deleting still referenced object

All general support: help on flying, installation, hardware, getting online etc. There are lots of users and developers to help you out.
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?
- what graphics card do you have?
- does the problem occur with any aircraft, at any airport?
- where did you download your aircraft/scenery from?
- is there any output printed to the console (black window)?
- copy&paste your commandline (tick the "Show commandline box on the last page of FGRun or the "Others" section on the Mac launcher).

If you experience FlightGear crashes, please report a bug using the issue tracker (can be also used for feature requests).
To run FlightGear on old computers with bad OpenGL support, please take a look at this wiki article.

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.

Crash - deleting still referenced object

Postby legoboyvdlp » Mon Dec 17, 2018 5:46 pm

Code: Select all
  530.62 [WARN]:OSG        Warning: deleting still referenced object 000001307BA9F480 of type 'class osg::Referenced * __ptr64'
  530.62 [ALRT]:opengl              the final reference count was 1, memory corruption possible.

Running FlightGear's terminate handler. The program is going to exit due to a fatal error condition, sorry.


Any ideas what's causing the OSG error (and I assume therefore the OpenGL error?
User avatar
legoboyvdlp
 
Posts: 6246
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Crash - deleting still referenced object

Postby Richard » Tue Dec 18, 2018 1:50 am

This isn't an OpenGL error; it is entirely within OSG. However as to what causes the error there really isn't enough information to be able to give any sort of informed opinion. It is likely related to the background model loading, and I suspect that probably a texture; but that's only based on my experience of similar crashes; so in short there isn't currently an answer; but we're working on it.
Richard
 
Posts: 660
Joined: Sun Nov 02, 2014 10:17 pm
Version: Git
OS: Win10

Re: Crash - deleting still referenced object

Postby TribalBob » Thu Dec 20, 2018 1:14 pm

legoboyvdlp wrote in Mon Dec 17, 2018 5:46 pm:
Code: Select all
  530.62 [WARN]:OSG        Warning: deleting still referenced object 000001307BA9F480 of type 'class osg::Referenced * __ptr64'
  530.62 [ALRT]:opengl              the final reference count was 1, memory corruption possible.

Running FlightGear's terminate handler. The program is going to exit due to a fatal error condition, sorry.


Any ideas what's causing the OSG error (and I assume therefore the OpenGL error?



Going to guess this is related to the issue being discussed here: viewtopic.php?f=25&t=34069
TribalBob
 
Posts: 47
Joined: Thu Aug 23, 2018 11:58 am

Re: Crash - deleting still referenced object

Postby iamzac » Sat Jan 05, 2019 4:08 pm

I also have been experiencing random crashes since using 2018.3.1 where the end of the log file usually looks like this:

Code: Select all
opengl:4:C:\Jenkins\workspace\Windows-release\install\msvc140-64\include\simgear/debug/OsgIoCapture.hxx:29:Warning: deleting still referenced object 000001D5B70934D0 of type 'class osg::Referenced * __ptr64'

opengl:5:C:\Jenkins\workspace\Windows-release\install\msvc140-64\include\simgear/debug/OsgIoCapture.hxx:24:         the final reference count was 1, memory corruption possible.


Before 2018.3.1 I only used x-plane for a few months so I don't know when this started.

It seems related to this older bug too:

https://forum.flightgear.org/viewtopic.php?f=17&t=25750

I didn't report it until now because I was waiting to see some pattern to do a proper report but i can't see it, it happens apparently random so it might be some kind of race condition and I can't find a way to reproduce.

It happens with different planes, at different places, at different times.
For example sometimes it crashes immediately at start, before the loading is even finished and then I just start again with nothing changed and all is fine.
Today it crashed about 3 or 4 times over many short sessions (I was doing various other tests for unrelated) and each time it didn't repeat when I attempted to repeat my actions.
I didn't collect old logs to compare but I am starting today.
iamzac
 
Posts: 96
Joined: Fri Nov 07, 2014 7:52 am
OS: Windows / Kubuntu

Re: Crash - deleting still referenced object

Postby wkitty42 » Sat Jan 05, 2019 9:55 pm

please file a new bug report or add to the existing one if you think they are the same and it isn't too old... if it isn't for the same version of FG you are running, i'd create a new bug and make sure to tick the version you are having the problem with... then provide additional information if requested as the bug is processed... the link to the bug tracker is at the top of the page ;)
"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: 5018
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Crash - deleting still referenced object

Postby legoboyvdlp » Sat Jan 05, 2019 10:01 pm

Richard is actively working on this according to a conversation on Discord, but it's a somewhat strange bug in OSG (first reported in 2009 or maybe earlier!) that is the root cause. It might be up to the OSG people to fix it...
User avatar
legoboyvdlp
 
Posts: 6246
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Crash - deleting still referenced object

Postby wkitty42 » Sat Jan 05, 2019 10:34 pm

ahhh... that fix might be hard to come by unless they are willing to update older versions... i'm running OSG 3.4.2 from their repo and i know that 3.6 is out but there's some work needed in FG to be able to use it... they may even be working on 3.7 or 3.8 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: 5018
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Crash - deleting still referenced object

Postby iamzac » Mon Jan 07, 2019 6:18 am

An update on this in case someone else arrives at this thread after some google search like I did, apparently Richard Harrison might have found the cause for this bug:
[Flightgear-devel] OSG deleting still referenced object

After reading how he did a 40 hours debug session to make this happen, I realize that this bug seems much more likely to appear when you have a large number of short sessions (like when you do some plane developing that requires this) than during normal longer sessions, which would explain why most people didn't notice it.
I had it happen many times in the first minute, sometimes later like in the first 5 minutes or so, but until now I didn't have any crash in a longer flight, but I might be wrong.

Since 2018.3.2 release is right around the corner and this bug doesn't seem like it will be fixed until then, maybe at least the devs might add some extra information to the error message now that they have some idea, just in case there are more than one bugs with the same manifestation.
iamzac
 
Posts: 96
Joined: Fri Nov 07, 2014 7:52 am
OS: Windows / Kubuntu

Re: Crash - deleting still referenced object

Postby Richard » Mon Jan 07, 2019 12:38 pm

iamzac wrote in Mon Jan 07, 2019 6:18 am:... I realize that this bug seems much more likely to appear when you have a large number of short sessions ... but until now I didn't have any crash in a longer flight, but I might be wrong.


Probably you're wrong as due to the asynchronous nature of the problem that I diagnosed it could happen at any time and is very timing dependent because for the bug to happen an exact sequence of events needs to happen in two different threads at the same time. There is another change related to the comparison of the expiry time that changes this sequence.

What I didn't say on the devlist message because I assume the purpose of the DatabasePager is well understood by the readership is that the problem is happening during the loading of models in the background database thread when the model (or texture) is shared and already in the object cache and just expired; and thus the crash is more likely to happen around populated airports or cities simply because of the quantity of models to be loaded.

Also remember that I'm also using the current development (2019.1) codebase and also have my new DDS texture cache code turned on which may also affect the sequencing that causes the problem.

Please you can make a flightplan that causes your FG to crash and send it to me together with the aircraft model details (with a link if not FGAddon) and your rendering settings and exact FlightGear version. If you are able to do this I'll be able to find out if I can reproduce your crash which would be great as having a reproducible test case that happens in minutes rather than hours would be a massive help to fixing the problem.

At the moment I don't know if/when a fix will be available but we're working on it; if you or anyone else can provide a flightplan that makes the problem happen reliably it'll speed up the development process.
Richard
 
Posts: 660
Joined: Sun Nov 02, 2014 10:17 pm
Version: Git
OS: Win10

Re: Crash - deleting still referenced object

Postby legoboyvdlp » Mon Jan 07, 2019 1:40 pm

Flying with full shaders except urban, OSM buildings + roads, medium vegetation, departing EGAC to EGLL using the IDG-A32X and http://github.com/legoboyvdlp/Ireland-fg-CustomScenery usually results in such a crash approximately thirty seconds after departure, usually just after turning left approximately over the town of Lisburn (south west of Belfast) at around 2000 - 3000 feet.
User avatar
legoboyvdlp
 
Posts: 6246
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Crash - deleting still referenced object

Postby Richard » Mon Jan 07, 2019 4:03 pm

legoboyvdlp wrote in Mon Jan 07, 2019 1:40 pm:Flying with full shaders except urban, OSM buildings + roads, medium vegetation, departing EGAC to EGLL using the IDG-A32X and http://github.com/legoboyvdlp/Ireland-fg-CustomScenery usually results in such a crash approximately thirty seconds after departure, usually just after turning left approximately over the town of Lisburn (south west of Belfast) at around 2000 - 3000 feet.


Thanks - but really I'd like a flightplan that you've used that makes the problem happen, Also I'd need the runway number that you used and aircraft model.
Richard
 
Posts: 660
Joined: Sun Nov 02, 2014 10:17 pm
Version: Git
OS: Win10

Re: Crash - deleting still referenced object

Postby legoboyvdlp » Mon Jan 07, 2019 4:12 pm

sure - will do - although I can't really see how the autopilot flight plan makes much difference... as I didn't even get to cruise altitude?

I was following the standard departure for runway 22 of a climb to 2000 followed by a left turn to the first waypoint, DUFFY.

The flightplan used in each case was if I remember correct,
Code: Select all
N0378F290 DUFFY L15 MAKUX SOSIM UL15 GIGTO UQ4 WAL UY53 NUGRA


And the model would have been probably the IAE V2500 version with the BAW livery.
User avatar
legoboyvdlp
 
Posts: 6246
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Crash - deleting still referenced object

Postby iamzac » Mon Jan 07, 2019 4:53 pm

Richard wrote in Mon Jan 07, 2019 12:38 pm:the crash is more likely to happen around populated airports or cities simply because of the quantity of models to be loaded.

Most of my flights start near a large city with (old) custom osm2city data.

Richard wrote in Mon Jan 07, 2019 12:38 pm:Please you can make a flightplan that causes your FG to crash and send it to me together with the aircraft model details (with a link if not FGAddon) and your rendering settings and exact FlightGear version. If you are able to do this I'll be able to find out if I can reproduce your crash which would be great as having a reproducible test case that happens in minutes rather than hours would be a massive help to fixing the problem.


Since several crashes happened to me shortly after starting, I am trying to repeat my penultimate crash wich happened at LOWI about 30 seconds after start using this batch script (I edited it and replaced some of my custom stuff with a message like <MY ...>):

Code: Select all
@echo off
cls

echo Starting FlightGear error check loop at:
date /T
time /T
echo.
pause
echo.

set /A count=0

:loop
set /A count=count+1
echo Loop %count%, starting FlightGear...
cd "<MY PATH TO FLIGHTGEAR>"
start "FlightGear" /B fgfs.exe  <MY SETTINGS WHEN IT CRASHED> >nul 2>&1
timeout /t 120
echo.
taskkill /f /im fgfs.exe
timeout /t 5
echo.
findstr /L /C:"the final reference count was 1, memory corruption possible." "<MY PATH TO LOG>\fgfs.log"
if %ERRORLEVEL% EQU 0 goto stop
goto loop

:stop
echo.
echo FOUND crash in log file and finished FlightGear error check loop at:
date /T
time /T
echo.
pause


But I have a problem with this script, when it starts FlightGear steals the focus which means I can't use my PC while running this script so I won't be able to run it for long if I can't find a solution.
If anyone knows how to do this tell me.

I will keep running it (while not using the PC) for a maximum of about 10 hours and if no crash I will repeat it at another location where it crashed in the past until I find a crash that happens at least twice in a not so long interval and if I do I will write here.
Until now no success.

But it will really help speed things up if I can find a way to stop it from stealing focus.
Last edited by iamzac on Mon Jan 07, 2019 5:00 pm, edited 2 times in total.
iamzac
 
Posts: 96
Joined: Fri Nov 07, 2014 7:52 am
OS: Windows / Kubuntu

Re: Crash - deleting still referenced object

Postby iamzac » Mon Jan 07, 2019 4:57 pm

Another thing I noticed: we three (me, Richard and legoboyvdlp) use windows 10.
Before moving to this FlightGear version I was using FlightGear under linux and I don't remember random crashes.
So one thing to find out would be if anyone with linux experienced this to see if it's OS related.
iamzac
 
Posts: 96
Joined: Fri Nov 07, 2014 7:52 am
OS: Windows / Kubuntu

Re: Crash - deleting still referenced object

Postby WoodSTokk » Mon Jan 07, 2019 5:03 pm

I use Debian testing/unstable (Buster/Sid) and have a crash with 2018.3.1 while flying from LOWW to LOWI.
Manual navigating from LOWW to LNZ VOR to SBG VOR to RTT NDB. On the leg from SBG to RTT FG crashed.
I had never a crash with 2018.2.2.
WoodSTokk
 
Posts: 145
Joined: Tue Oct 17, 2017 2:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: OE-WST
IRC name: WoodSTokk
Version: 2018.3.1
OS: Debian Buster/Sid

Next

Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest