Board index FlightGear Support Compiling

FlightGear 2019.1.2 Invalid pointer error in Linux Fedora 31  Topic is solved

Building FlightGear from source, and in the need for help?

FlightGear 2019.1.2 Invalid pointer error in Linux Fedora 31

Postby RedGriffin » Fri Apr 17, 2020 9:39 am

Hello there,
I have always compiled myself FlightGear and it has always gone fine until yesterday. I can successfully compile both simgear and flightgear, but when I run it - either with or without options - I always get

Code: Select all
free(): invalid pointer
Aborted (core dumped)


This is the only output I get so I guess it is something related to the initialization part of FlightGear before actually launching the main loop.
I am using Linux Fedora 31 and I noticed this error after having upgraded the system to the latest packages and libraries. This of course makes me think FlightGear is not working anymore with some new library.
I have also tried to compile the development version of FlightGear (I guess it is 2019.2) by cloning all the repositories from git, but I get the very same result.
For your information, I follow the procedure suggested in the INSTALL files (create a build directory, cmake then make) and I have also tried to "play" with some memory alignment options in gcc. For your information, I am using gcc version 9.3.1 20200408

Any idea of what it could be or maybe someone out there has met the same error and possibly fixed it, before I may start step debugging the code?

Thank you.

This is the output of ldd:

Code: Select all
        linux-vdso.so.1 (0x00007ffd0eafa000)
        libopenal.so.1 => /lib64/libopenal.so.1 (0x00007f1839be8000)
        libSM.so.6 => /lib64/libSM.so.6 (0x00007f1839bdd000)
        libICE.so.6 => /lib64/libICE.so.6 (0x00007f1839bbf000)
        libX11.so.6 => /lib64/libX11.so.6 (0x00007f1839a79000)
        libXext.so.6 => /lib64/libXext.so.6 (0x00007f1839a64000)
        libudev.so.1 => /lib64/libudev.so.1 (0x00007f1839a36000)
        libGL.so.1 => /lib64/libGL.so.1 (0x00007f18399a0000)
        libGLU.so.1 => /lib64/libGLU.so.1 (0x00007f183992e000)
        libosgText.so.131 => /lib64/libosgText.so.131 (0x00007f18398bd000)
        libosgSim.so.131 => /lib64/libosgSim.so.131 (0x00007f1839816000)
        libosgDB.so.131 => /lib64/libosgDB.so.131 (0x00007f18396b7000)
        libosgParticle.so.131 => /lib64/libosgParticle.so.131 (0x00007f1839654000)
        libosgFX.so.131 => /lib64/libosgFX.so.131 (0x00007f1839616000)
        libosgUtil.so.131 => /lib64/libosgUtil.so.131 (0x00007f18393f4000)
        libosgViewer.so.131 => /lib64/libosgViewer.so.131 (0x00007f18392db000)
        libosgGA.so.131 => /lib64/libosgGA.so.131 (0x00007f1839222000)
        libosg.so.131 => /lib64/libosg.so.131 (0x00007f1838f1c000)
        libOpenThreads.so.20 => /lib64/libOpenThreads.so.20 (0x00007f1838f12000)
        libevent_core-2.1.so.6 => /lib64/libevent_core-2.1.so.6 (0x00007f1838ed4000)
        libplibpuaux.so.1.8.5 => /lib64/libplibpuaux.so.1.8.5 (0x00007f1838ea8000)
        libplibpu.so.1.8.5 => /lib64/libplibpu.so.1.8.5 (0x00007f1838e86000)
        libplibsg.so.1.8.5 => /lib64/libplibsg.so.1.8.5 (0x00007f1838e6e000)
        libplibul.so.1.8.5 => /lib64/libplibul.so.1.8.5 (0x00007f1838e67000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f1838e45000)
        libspeex.so.1 => /lib64/libspeex.so.1 (0x00007f1838e25000)
        libspeexdsp.so.1 => /lib64/libspeexdsp.so.1 (0x00007f1838e10000)
        libgsm.so.1 => /lib64/libgsm.so.1 (0x00007f1838e01000)
        libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00007f1838dab000)
        libQt5Svg.so.5 => /lib64/libQt5Svg.so.5 (0x00007f1838d4f000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f1838d35000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f1838d28000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f1838d21000)
        libcurl.so.4 => /lib64/libcurl.so.4 (0x00007f1838c90000)
        libQt5Widgets.so.5 => /lib64/libQt5Widgets.so.5 (0x00007f18385e6000)
        libQt5Quick.so.5 => /lib64/libQt5Quick.so.5 (0x00007f1838108000)
        libQt5Gui.so.5 => /lib64/libQt5Gui.so.5 (0x00007f1837bc9000)
        libQt5Qml.so.5 => /lib64/libQt5Qml.so.5 (0x00007f18376e4000)
        libQt5Network.so.5 => /lib64/libQt5Network.so.5 (0x00007f1837522000)
        libQt5Core.so.5 => /lib64/libQt5Core.so.5 (0x00007f1836fee000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f1836df5000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f1836caf000)
        libmvec.so.1 => /lib64/libmvec.so.1 (0x00007f1836c83000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f1836c67000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f1836a9e000)
        libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f1836a94000)
        libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f1836a69000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1839d3f000)
        libGLX.so.0 => /lib64/libGLX.so.0 (0x00007f1836a35000)
        libGLdispatch.so.0 => /lib64/libGLdispatch.so.0 (0x00007f1836978000)
        libXrandr.so.2 => /lib64/libXrandr.so.2 (0x00007f1836969000)
        libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007f1836689000)
        libplibfnt.so.1.8.5 => /lib64/libplibfnt.so.1.8.5 (0x00007f183666d000)
        libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007f18365ba000)
        libnghttp2.so.14 => /lib64/libnghttp2.so.14 (0x00007f183658e000)
        libidn2.so.0 => /lib64/libidn2.so.0 (0x00007f183656c000)
        libssh.so.4 => /lib64/libssh.so.4 (0x00007f18364fb000)
        libpsl.so.5 => /lib64/libpsl.so.5 (0x00007f18364e8000)
        libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007f1836452000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f1836400000)
        libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f183630d000)
        libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f18362f4000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f18362ed000)
        libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007f183629c000)
        liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007f183628b000)
        libbrotlidec.so.1 => /lib64/libbrotlidec.so.1 (0x00007f183627c000)
        libpng16.so.16 => /lib64/libpng16.so.16 (0x00007f1836244000)
        libharfbuzz.so.0 => /lib64/libharfbuzz.so.0 (0x00007f183614c000)
        libicui18n.so.63 => /lib64/libicui18n.so.63 (0x00007f1835e69000)
        libicuuc.so.63 => /lib64/libicuuc.so.63 (0x00007f1835c96000)
        libpcre2-16.so.0 => /lib64/libpcre2-16.so.0 (0x00007f1835c12000)
        libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f1835aea000)
        libXau.so.6 => /lib64/libXau.so.6 (0x00007f1835ae2000)
        libXrender.so.1 => /lib64/libXrender.so.1 (0x00007f1835ad5000)
        liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f1835aac000)
        liblz4.so.1 => /lib64/liblz4.so.1 (0x00007f1835a8b000)
        libgcrypt.so.20 => /lib64/libgcrypt.so.20 (0x00007f183596d000)
        libunistring.so.2 => /lib64/libunistring.so.2 (0x00007f18357e7000)
        libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f18357d5000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f18357ce000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f18357b5000)
        libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007f1835795000)
        libbrotlicommon.so.1 => /lib64/libbrotlicommon.so.1 (0x00007f1835770000)
        libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007f18356af000)
        libgraphite2.so.3 => /lib64/libgraphite2.so.3 (0x00007f183568a000)
        libicudata.so.63 => /lib64/libicudata.so.63 (0x00007f1833c99000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f1833c25000)
        libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007f1833c00000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f1833bd3000)
        libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007f1833b98000)
        libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f1833b84000)
        libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f1833af2000)
Red Griffin - IK0TOJ
Author and developer of Red Griffin ATC (Wiki) - Enjoy my Youtube Channel
RedGriffin
 
Posts: 161
Joined: Tue Dec 25, 2018 7:04 pm
Location: Perugia, Italy
Callsign: IK0TOJ
Version: 2020.3 git
OS: Linux Fedora 32

Re: FlightGear 2019.1.2 Invalid pointer error in Linux Fedor

Postby legoboyvdlp » Fri Apr 17, 2020 11:10 am

A backtrace would help, is it possible to get one using gdb?
User avatar
legoboyvdlp
 
Posts: 7674
Joined: Sat Jul 26, 2014 1:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: FlightGear 2019.1.2 Invalid pointer error in Linux Fedor

Postby RedGriffin » Fri Apr 17, 2020 11:45 am

legoboyvdlp wrote in Fri Apr 17, 2020 11:10 am:A backtrace would help, is it possible to get one using gdb?

Yes, you are right.
I forgot to include the backtrace. Here it is:

Code: Select all
(gdb) bt
#0  0x00007ffff4d68625 in raise () from /lib64/libc.so.6
#1  0x00007ffff4d518d9 in abort () from /lib64/libc.so.6
#2  0x00007ffff4dac4af in __libc_message () from /lib64/libc.so.6
#3  0x00007ffff4db3a9c in malloc_printerr () from /lib64/libc.so.6
#4  0x00007ffff4db549c in _int_free () from /lib64/libc.so.6
#5  0x0000000000d32c6d in std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_destroy_data_aux(std::_Deque_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>, std::_Deque_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>) ()
#6  0x00007ffff7a4aa21 in osgDB::Registry::initDataFilePathList() ()
   from /lib64/libosgDB.so.131
#7  0x00007ffff7a4b070 in osgDB::Registry::Registry() ()
   from /lib64/libosgDB.so.131
#8  0x00007ffff7a4ca65 in osgDB::Registry::instance(bool) ()
   from /lib64/libosgDB.so.131
#9  0x00007ffff79c2c08 in osgDB::RegisterCompressorProxy::RegisterCompressorProxy(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, osgDB::BaseCompressor*) () from /lib64/libosgDB.so.131
#10 0x00007ffff79bddc1 in _GLOBAL__sub_I_Compressors.cpp ()
--Type <RET> for more, q to quit, c to continue without paging--
   from /lib64/libosgDB.so.131
#11 0x00007ffff7fe1f2a in call_init.part () from /lib64/ld-linux-x86-64.so.2
#12 0x00007ffff7fe2031 in _dl_init () from /lib64/ld-linux-x86-64.so.2
#13 0x00007ffff7fd314a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#14 0x0000000000000001 in ?? ()
#15 0x00007fffffffd9fe in ?? ()
#16 0x0000000000000000 in ?? ()


Edit: I better recompile flightgear with debug information in order to have a better and meaningful backtrace. It seems however it is a problem in initialization stage. It is clear the problem is caused by OpenSceneGraph DB.
Red Griffin - IK0TOJ
Author and developer of Red Griffin ATC (Wiki) - Enjoy my Youtube Channel
RedGriffin
 
Posts: 161
Joined: Tue Dec 25, 2018 7:04 pm
Location: Perugia, Italy
Callsign: IK0TOJ
Version: 2020.3 git
OS: Linux Fedora 32

Re: FlightGear 2019.1.2 Invalid pointer error in Linux Fedor

Postby legoboyvdlp » Fri Apr 17, 2020 11:56 am

Are you compiling against OSG 3.6 by any chance?

Someone else had this issue in February (well, the same backtrace - a different error) and resolved it by downgrading to OSG 3.6.3.

In any case, FlightGear has its own fork of OSG at : https://github.com/zakalawe/osg/tree/fgfs-342-1

The main differences are several important fixes, osgText works properly, and builds are considerably faster since stuff that FlightGear doesn't use is removed.
User avatar
legoboyvdlp
 
Posts: 7674
Joined: Sat Jul 26, 2014 1:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: FlightGear 2019.1.2 Invalid pointer error in Linux Fedor

Postby RedGriffin » Fri Apr 17, 2020 1:46 pm

legoboyvdlp wrote in Fri Apr 17, 2020 11:56 am:Are you compiling against OSG 3.6 by any chance?

Someone else had this issue in February (well, the same backtrace - a different error) and resolved it by downgrading to OSG 3.6.3.

In any case, FlightGear has its own fork of OSG at : https://github.com/zakalawe/osg/tree/fgfs-342-1

The main differences are several important fixes, osgText works properly, and builds are considerably faster since stuff that FlightGear doesn't use is removed.

Fedora 31 has osg 3.4.1, so it seems to be way lower than 3.6.3.

This is what I have currently installed in my system:

OpenSceneGraph-qt-3.4.1-11.fc31.x86_64
OpenSceneGraph-libs-3.4.1-11.fc31.x86_64
OpenSceneGraph-3.4.1-11.fc31.x86_64
OpenSceneGraph-qt-devel-3.4.1-11.fc31.x86_64
OpenSceneGraph-devel-3.4.1-11.fc31.x86_64

Do you suggest I should build OpenSceneGraph myself?
Red Griffin - IK0TOJ
Author and developer of Red Griffin ATC (Wiki) - Enjoy my Youtube Channel
RedGriffin
 
Posts: 161
Joined: Tue Dec 25, 2018 7:04 pm
Location: Perugia, Italy
Callsign: IK0TOJ
Version: 2020.3 git
OS: Linux Fedora 32

Re: FlightGear 2019.1.2 Invalid pointer error in Linux Fedor

Postby legoboyvdlp » Fri Apr 17, 2020 2:18 pm

Ok - that's a little unexpected, I have never seen 3.4 causing troubles - that backtrace is consistent with 3.6 problems.

It might well be worth trying the 3.4.2 fork as that's one known to work.
User avatar
legoboyvdlp
 
Posts: 7674
Joined: Sat Jul 26, 2014 1:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: FlightGear 2019.1.2 Invalid pointer error in Linux Fedor

Postby RedGriffin » Fri Apr 17, 2020 4:32 pm

legoboyvdlp wrote in Fri Apr 17, 2020 2:18 pm:Ok - that's a little unexpected, I have never seen 3.4 causing troubles - that backtrace is consistent with 3.6 problems.

It might well be worth trying the 3.4.2 fork as that's one known to work.

This is getting weird. I have checked with the Fedora repository and I see Open Scene Graph has never been updated or upgraded since Fedora 31 has been released. So, Fedora 31 has been released with osg version 3.4.1.
And I certainly upgraded to Fedora 31 last year and I can absolutely confirm FlightGear worked absolutely fine since then.
I suspect it is something not directly related to OpenScene Grapg 3.4.1 as this is the version I used for compiling and running FlightGear at least since October 2019.

I also recompiled FligthGear with debug information but it seems I am not getting much luck - so far - in spotting the point from where the crash is originating.
gdb however confirms it is osgdb to cause the error.
Red Griffin - IK0TOJ
Author and developer of Red Griffin ATC (Wiki) - Enjoy my Youtube Channel
RedGriffin
 
Posts: 161
Joined: Tue Dec 25, 2018 7:04 pm
Location: Perugia, Italy
Callsign: IK0TOJ
Version: 2020.3 git
OS: Linux Fedora 32

Re: FlightGear 2019.1.2 Invalid pointer error in Linux Fedor

Postby wkitty42 » Fri Apr 17, 2020 5:59 pm

i would certainly consider compiling your own OSG for FG to use... if you are using the dnc script, it is quite easy... i build here with OSG 3.6.5 IIRC...
"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: 6494
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: FlightGear 2019.1.2 Invalid pointer error in Linux Fedor  

Postby RedGriffin » Sat Apr 18, 2020 10:47 am

Bug fixed!!!
It seems the problem was Open Scene Graph 3.4.1 distributed with Fedora 31, although it is the version distributed with FC31 since its release.
I completely uninstalled all FC31 OpenSceneGraph packages and cloned the 3.6.5 repository from git. I therefore compiled it and installed.
FlightGear is now running again as usual and the error seems to be gone.
As a side note, I noticed that now I get a slightly higher frame rate and I do not known whether it is because of 3.6.5 version or for the optimization options I usually use with gcc. So far, so good.

I also tried to compile FlightGear 2019.2 (cloned from sourceforge git repository) and also in this case it is now working well although I still have problems with my custom scenery which seems not to be usable with 2019.2 as it cannot find and use the objects defined in the scenery and located inside the custom scenery tree.
So I am stick with 2019.1.2 for the moment.

Case is closed and dismissed! :-D
Red Griffin - IK0TOJ
Author and developer of Red Griffin ATC (Wiki) - Enjoy my Youtube Channel
RedGriffin
 
Posts: 161
Joined: Tue Dec 25, 2018 7:04 pm
Location: Perugia, Italy
Callsign: IK0TOJ
Version: 2020.3 git
OS: Linux Fedora 32


Return to Compiling

Who is online

Users browsing this forum: No registered users and 2 guests