ASan will not even let me open any dialog or even menu.
Edit: turns out the problem is that system PLIB was preferred, despite CMake vars pointing to the right one.
Versions:
flightgear 11932bac4 2020-08-24 Trying to fix EnvironmentManager shutdown crash. (origin/next, origin/HEAD, next) [James Turner]
simgear 6f2b81b4 2020-08-24 Fix for the fact we find_package(AAX) all the time. (HEAD -> next, origin/next, origin/HEAD) [James Turner]
fgdata 48fb9ffde 2020-08-24 Updated German translations from Udo Kaune. (origin/next, origin/HEAD, next) [James Turner]
Aha nice! I'll try to work out a fix :)
This /might/be a false positive. At least, my version of PLIB, the bug seems like it's fixed. What exact PLIB versikon do you have, and where did you download/install it from?
It's ArchLinux PLib, and I can't find it anywhere in Pacman anymore, so it may have been removed, and the old files simply lingering here. From what I can see it was
1.8.5-8from 2019-02-07 15:56 before they deleted it.Last edit: Anonymous 2020-08-24
Okay, can you try Plib from trunk / SVN?
Will try.
With latest PLib
a89f6f8 2012-08-24 Fixing a compile error. Thanks to Alex D-HUND for reporting it. (HEAD -> master, git-svn) [wolfram_kuss]Okay the fix was made in 2008, so not sure what is going on here. Can you confirm that line 1474 of your pu.h looks like ' delete [] displayed_text ; displayed_text = NULL ;' ?
Yes:
Okay, it's weird then: the ASan error is saying 'you used delete when you should have used delete[]' .. but we /are/. using delete[], if I'm reading everything correctly.
Can you repeat with a debug build and see if chanegs the backrtrace information? Becuase the function is in a header, I wonder if something weird is going on
It looks the same with
The usual ones were:
Should I try checking with -O0, -O1 or -O2?
Last edit: Anonymous 2020-08-24
But it's saying
new []is mismatched withdeletenot withdelete []? I don't know what that even means but I assume they both should have the[](is that some kind of pointer thing)?Yes it's a weird pointer thing, but the important point is if you use new[], you need to use delete[] as well. And as far as I can see from the code, we are. The error is saying 'you used new[], but used delete /without/ []'. But you checked and the header you showed me has the version with []. So I'm confused.
Can you try -g with -O0 ? That might make it clearer.
I'd especially like to know a file+line number location for ' #1 0x555556559f5e in non-virtual thunk to puInput::setValue(float) (/home/mike/var/games/fg/flightgear/bin/fgfs+0x1005f5e)
' - since right now we can't tell, and I'd like to be 100% sure it's using the pu.h we think it is.
I see a major difference between my distro supplied pu.h (version 1.8.5) and the HEAD r2173 version, which is very, very likely to be the source of this issue. Here is the trunk version of the puInput class:
And then the 1.8.5 version:
Note the
delete displayed_text;having been fixed asdelete [] displayed_text;. The SVN commit that fixed this is:For reference, Melchior Franz was a FlightGear developer. And the 1.8.5 release that distros use was committed at:
So clearly a FlightGear ASan build cannot use the system PLIB.
And the message from Melchior Franz to the PLIB developers:
I will try getting it to crash with
-O0 -pipe -gStrange, but O2 and O0 look the same.
Sorry about the confusion, I know what's going on now. It was still including the old plib from the OS that was left over from the package that had disappeared.
I moved
/usr/include/plibaway to see, and it stopped building, because it was still taking those despite thePLIB_INCLUDE_DIR:PATH=/home/mike/var/games/fg/plib/includein my CMakeCache.txt after having usedPLIBDIR="${PLIB}"with cmake.After moving system PLIB includes and libraries away and adding the
it compiled, and the issue is gone. So the problem was CMake not obeying the set PLib location.
Diff:
Edited bug description due to changed nature of the bug.
I've now pushed an update to use our own version of pu.h which should fix this issue.