-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CTD at KDEN in DataCleansing / GetToPos #207
Comments
Could be linked to #208: The latter makes planes disappear rather suddenly quite often, way more often than what normally would be expected. So if there is still some kind of race condition that would allow a plane to be removed while in a separate thread calculations on it are still on, then the auto-land issue #208 would increase the likelihood of this race condition being triggered. |
Accessing aircraft in So there is a theoretical point in time, as short as it may be, for a race condition:
Solution: Consequently guard all |
Code changes didn't solve the problem. New crashes surfaced at slightly different positions, obviously in different situation, but still it is the calculation thread, which crashes, and still it is when accessing the plane's current position
In the 4th pattern, the exception shown in Visual Studio even clearly reads:
stating that an internal pointer of the While sorting all crash dumps I noted that one was left from yesterday, which I forgot to assign to any of the patterns...turns out: That crash dump of yesterday shows what is now noted here as pattern 3. What strikes me is that for reaching the point of crash in the 4th pattern, execution came very surely past the spot in the 3rd pattern: 3rd PatternCall Stack
So it is again
crash_report_01_25_2021_15_28_06 - 3rd pattern.zip 4th PatternCall Stack
The place calling
|
Will try to catch |
Regression introduced with changes for #207
Describe the bug
One user reports reoccuring crashes when nearing or being at KDEN, standard X-Plane scenery. In the crash dumps he provided two patterns are visible, but they are just one line apart in the source code, so I treat them for the moment as related.
At the same time, other provided crash dumps point into X-Plane. We should not completely forget about them because what we see here is quite weird...not sure what happened to our memory. And maybe sometimes it happens to X-Plane's memory?
To Reproduce
Have LiveTraffic run at KDEN.
Channels involved are OpenSky and Open Glider Network. No ADSBEx, no RealTraffic.
Active channels are important as the issue is about auto-land aircraft.
Expected behavior
No crash.
Technical Info:
1st Pattern in LTFlightData:916 calling
pAc->GetToPos
Log.txt
Two dumps report the same call stack:
crash_report_01_24_2021_17_25_50.zip
crash_report_01_22_2021_18_42_05.zip
Call Stack
In
GetToPos
it crashes while applying theoperator <
:The
operator <
is the actual point of bad memory access. It's a one-liner:The memory location accessed is reported as
0x0000000000000018
. Probably, the timestampts
is just 18 bytes down from the beginning.Interesting is, however, that the crash location is the
operator <
, not the also inlined functionts()
, which returns one of thepositionTy::v
valarray
elements.2nd Pattern in LTFlightData:917 calling
LTAptFindRwy
This is just one line down in
CalcNextPos
, ie. right after the call topAc->GetToPos
.Log Text
crash_report_01_22_2021_17_19_06.zip
Call Stack
So we now call into
LTAptFindRwy
and crash while reading address0x0000000000000020
(so it is 2 bytes later) in line 2511 ofLTApt.cpp
:Analysis
The crash is in the
LT_CalcPos
worker thread, which is why the X-Plane log couldn't identify LiveTraffic as the crash didn't occur in X-Plane's main thread.Situation is: Plane is approaching with no live data. Auto-land is kicking in. But before (1st pattern) or while (2nd pattern= trying to actually find a runway the crash happens at the above locations.
1st pattern We are in code of an aircraft object. The aircraft object has been used before. One could think into the direction of aircraft removal while this code is going on...but aircraft removal is pretty tightly safeguarded with two mutexes. And if that would be the reason we would hear a lot more people scream and it would not be limited to KDEN.
2nd pattern is totally unrelated to the aircraft object but combs through the apt scenery data. The objects involved are the airport, its rwy endpoints, and a position passed down from
CalcNextPos
. And guess what...the position is the result of a call to_ac.GetToPos()
inLTAptFindRwy
(LTApt.h:55).So the constant in both patterns is the aircraft's position. But why at KDEN?
The text was updated successfully, but these errors were encountered: