Board index FlightGear Development

Segfault after File > Reset

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Segfault after File > Reset

Postby MariuszXC » Mon Sep 06, 2021 11:34 am

In 'next', choosing Menu > File > Reset results in immediate core dump, when multithreading is set to AutomaticSelection in defaults.xml.

Command:
Code: Select all
./run_fgfs_debug.sh --httpd=8080 --telnet=5000 --airport=EPGD --enable-auto-coordination --aircraft=c172p


Version:
Code: Select all
/sim/version/flightgear: 2020.4.0
/sim/version/simgear: 2020.4.0
/sim/version/openscenegraph: 3.6.5
/sim/version/build-id: none
/sim/version/build-number: 0
/sim/version/build-type: Dev
/sim/version/revision: c50fe8de07b8722d89062d7aa3d9f13db5b2d565
/sim/rendering/gl-vendor: Intel Open Source Technology Center
/sim/rendering/gl-renderer: Mesa DRI Intel(R) Haswell Mobile
/sim/rendering/gl-version: 3.0 Mesa 18.0.5
/sim/rendering/gl-shading-language-version: 1.30
/sim/rendering/max-texture-size: 16384
/sim/rendering/depth-buffer-bits: 24
/sim/version/flightgear: 2020.4.0
/sim/version/simgear: 2020.4.0
/sim/version/openscenegraph: 3.6.5
/sim/version/build-id: none
/sim/version/build-number: 0
/sim/version/build-type: Dev
/sim/version/revision: c50fe8de07b8722d89062d7aa3d9f13db5b2d565
/sim/rendering/gl-vendor: Intel Open Source Technology Center
/sim/rendering/gl-renderer: Mesa DRI Intel(R) Haswell Mobile
/sim/rendering/gl-version: 3.0 Mesa 18.0.5
/sim/rendering/gl-shading-language-version: 1.30
/sim/rendering/max-texture-size: 16384
/sim/rendering/depth-buffer-bits: 24


In defaults.xml:
Code: Select all
<multithreading-mode>AutomaticSelection</multithreading-mode>


Results:
Code: Select all
[Thread 0x7fff9fffe700 (LWP 22828) exited]
[Thread 0x7fffa890c700 (LWP 22827) exited]
[Thread 0x7fffe98b6700 (LWP 22824) exited]
[New Thread 0x7fffe98b6700 (LWP 22844)]
[Thread 0x7fffaac41700 (LWP 22823) exited]
[Thread 0x7fffaf443700 (LWP 22822) exited]
[Thread 0x7fffd154a700 (LWP 22817) exited]
[Thread 0x7fffd96fb700 (LWP 22813) exited]
[Thread 0x7fffd8efa700 (LWP 22814) exited]
[Thread 0x7fffd254c700 (LWP 22815) exited]
[Thread 0x7fffd1d4b700 (LWP 22816) exited]
[Thread 0x7fffdb7ff700 (LWP 22810) exited]

Thread 6 "fgfs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe2630700 (LWP 22808)]
0x00007ffff5ecdb2e in osg::GraphicsContext::runOperations() () from ../../openscenegraph/lib/libosg.so.162
(gdb) quit


Not deterministic, as on second run it does not show the location:
Code: Select all
  137.17 [INFO]:nasal      0 Transport
  137.17 [INFO]:nasal      0 Greenspace
[Thread 0x7fff9fffe700 (LWP 22915) exited]
[Thread 0x7fffa890c700 (LWP 22914) exited]
[New Thread 0x7fffe98b6700 (LWP 22933)]
[Thread 0x7fffe98b6700 (LWP 22911) exited]
[Thread 0x7fffaac41700 (LWP 22910) exited]
[Thread 0x7fffaf443700 (LWP 22909) exited]
[Thread 0x7fffd154a700 (LWP 22903) exited]
[Thread 0x7fffd96fb700 (LWP 22899) exited]
[Thread 0x7fffd8efa700 (LWP 22900) exited]
[Thread 0x7fffd254c700 (LWP 22901) exited]
[Thread 0x7fffd1d4b700 (LWP 22902) exited]
[Thread 0x7fffdb7ff700 (LWP 22894) exited]

Thread 6 "fgfs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe2630700 (LWP 22892)]
0x0000000000000000 in ?? ()
(gdb)


Does not happen with multithreading disabled in defaults.xml.
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: Segfault after File > Reset

Postby Hooray » Mon Sep 06, 2021 11:46 am

Could you please post a full gdb backtrace (thread apply all bt)
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Segfault after File > Reset

Postby MariuszXC » Mon Sep 06, 2021 12:05 pm

Yes, sure, here it is (a full session, just in case)
Code: Select all
Reading symbols from ./fgfs...done.
(gdb) thread apply all bt
(gdb) r
Starting program: ...compile/fg_next/install/flightgear/bin/fgfs --fg-root=...compile/fg_next/install/flightgear/bin/../fgdata --httpd=8080 --telnet=5000 --airport=EPGD --enable-auto-coordination --aircraft=c172p
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
...compile/fg_next/simgear/simgear/props/props.cxx:285: name=SG_PROPERTY_LOCKING value=<unset> returning: 1
...compile/fg_next/simgear/simgear/props/props.cxx:285: name=SG_PROPERTY_LOCKING_VERBOSE value=<unset> returning: 0
Did init FPE
Boostrap-1
[New Thread 0x7fffe98b6700 (LWP 23380)]
Boostrap-2
[Thread 0x7fffe98b6700 (LWP 23380) exited]
[New Thread 0x7fffe98b6700 (LWP 23381)]
DidInitHome
...compile/fg_next/simgear/simgear/props/props.cxx:106: active: /sim[0]/property-locking[0]/active[0] verbose: /sim[0]/property-locking[0]/verbose[0] timing: /sim[0]/property-locking[0]/timing[0] parent_listeners: /sim[0]/property-locking[0]/parent_listeners[0]
[Thread 0x7fffe98b6700 (LWP 23381) exited]
[New Thread 0x7fffe98b6700 (LWP 23382)]
DidLogToHome
[New Thread 0x7fffe98b6700 (LWP 23383)]
[Thread 0x7fffe98b6700 (LWP 23382) exited]
    0.08 [ALRT]:view       Creating osgViewer::CompositeViewer
Now checking for plug-in osgPlugins-3.6.5/osgdb_nvtt.so
    0.10 [ALRT]:view       Using CompositeViewer
    0.10 [ALRT]:view       Creating osgViewer::View
    0.10 [ALRT]:view       adding view to composite_viewer.
    0.23 [WARN]:general    Enabling ATI/AMD viewport hack
[New Thread 0x7fffe2630700 (LWP 23384)]
[New Thread 0x7fffe98b6700 (LWP 23385)]
[Thread 0x7fffe98b6700 (LWP 23383) exited]
    0.39 [INFO]:terrasync  Starting automatic scenery download/synchronization to '.../.fgfs/TerraSync'.
[New Thread 0x7fffdb7ff700 (LWP 23386)]
[New Thread 0x7fffe98b6700 (LWP 23388)]
[Thread 0x7fffe98b6700 (LWP 23385) exited]
[New Thread 0x7fffe98b6700 (LWP 23389)]
[Thread 0x7fffe98b6700 (LWP 23388) exited]










[New Thread 0x7fffd96fb700 (LWP 23390)]
[New Thread 0x7fffd8efa700 (LWP 23391)]
[New Thread 0x7fffd254c700 (LWP 23392)]
[New Thread 0x7fffd1d4b700 (LWP 23393)]
[New Thread 0x7fffd154a700 (LWP 23394)]
    8.77 [ALRT]:io         mipmapping: texture size not a power-of-two: ...compile/fg_next/install/flightgear/fgdata/Aircraft/git/c172p/Models/Interior/Panel/Instruments/gear/breakers-switches.png
    8.77 [ALRT]:io         mipmapping: texture size not a power-of-two: ...compile/fg_next/install/flightgear/fgdata/Aircraft/git/c172p/Models/Effects/interior/lm_gear-breakers.png
   16.88 [ALRT]:io         mipmapping: texture size not a power-of-two: ...compile/fg_next/install/flightgear/fgdata/Aircraft/git/c172p/Models/Exterior/rbf/rbf.png
[New Thread 0x7fffaf443700 (LWP 23396)]
[New Thread 0x7fffaf443700 (LWP 23397)]
[Thread 0x7fffaf443700 (LWP 23396) exited]
[New Thread 0x7fffaf443700 (LWP 23398)]
[Thread 0x7fffaf443700 (LWP 23397) exited]
[New Thread 0x7fffaac41700 (LWP 23399)]
[New Thread 0x7fffe98b6700 (LWP 23400)]
[Thread 0x7fffe98b6700 (LWP 23389) exited]
   20.68 [INFO]:nasal      Failed to find view-number-raw=nil
   20.94 [INFO]:nasal      Request detected to initialize Advanced Weather on startup...
   21.07 [INFO]:nasal      Loading local weather routines...
   21.12 [ALRT]:general    Canvas constructor: node=/canvas/by-index/texture
   21.12 [ALRT]:general    Canvas constructor: node=/canvas/by-index/texture[1]
   21.12 [ALRT]:general    Canvas constructor: node=/canvas/by-index/texture[2]
   21.28 [INFO]:nasal      towing is active!
   21.28 [ALRT]:nasal      ERROR: Cannot add listener to tied property /sim[0]/current-view[0]/heading-offset-deg[0]
   21.32 [INFO]:nasal      KMA20 audio panel initialized
   21.32 [INFO]:nasal      Hobbs system stopped
   21.32 [INFO]:nasal      Hobbs system stopped
   21.32 [INFO]:nasal      Starter off
   21.33 [INFO]:nasal      KI266 dme indicator #0 initialized
   21.35 [INFO]:nasal      Astro Tech LC-2 Chronometer Loaded
   21.35 [INFO]:nasal      Electrical system initialized
   21.39 [ALRT]:nasal      ERROR: Cannot add listener to tied property /instrumentation[0]/gps[0]/mode[0]
[New Thread 0x7fffaab40700 (LWP 23401)]
[New Thread 0x7fffaa33f700 (LWP 23402)]
[New Thread 0x7fffa890c700 (LWP 23403)]
[New Thread 0x7fff9fffe700 (LWP 23404)]
[Thread 0x7fffaa33f700 (LWP 23402) exited]
   25.44 [INFO]:OSG       
   25.44 [WARN]:OSG        PNG lib warning : Interlace handling should be turned on when using png_read_image
   25.63 [INFO]:nasal      Annunciator panel: initialized
   25.63 [ALRT]:flight     Failed to save initial FDM property state
   30.08 [INFO]:nasal      Starting hard-coded terrain presampling
   76.09 [INFO]:nasal      Garmin 196 loading cities
   81.79 [INFO]:nasal      Garmin 196 loading cities done
  123.60 [INFO]:nasal      Primer reset to 0
  123.73 [INFO]:nasal      0 Transport
  123.83 [INFO]:nasal      0 Transport
  123.84 [INFO]:nasal      0 Transport
  123.84 [INFO]:nasal      0 Transport
  123.94 [INFO]:nasal      0 Greenspace
  123.94 [INFO]:nasal      0 Greenspace
  123.94 [INFO]:nasal      0 Transport
  123.94 [INFO]:nasal      0 Railroad
  123.94 [INFO]:nasal      0 Transport
  124.14 [INFO]:nasal      0 Railroad
  124.14 [INFO]:nasal      0 Transport
  124.24 [INFO]:nasal      0 Greenspace
  124.25 [INFO]:nasal      0 Transport
  124.33 [INFO]:nasal      0 Greenspace
  124.34 [INFO]:nasal      0 Transport
  124.34 [INFO]:nasal      0 Transport
  124.34 [INFO]:nasal      0 Transport
  124.34 [INFO]:nasal      0 Greenspace
  124.43 [INFO]:nasal      0 Greenspace
  124.43 [INFO]:nasal      0 Railroad
  124.52 [INFO]:nasal      0 Transport
  124.52 [INFO]:nasal      0 Greenspace
  124.61 [INFO]:nasal      0 Transport
  124.61 [INFO]:nasal      0 Transport
  124.70 [INFO]:nasal      0 Transport
  124.70 [INFO]:nasal      0 Transport
  124.80 [INFO]:nasal      0 Greenspace
  124.81 [INFO]:nasal      0 Greenspace
  124.81 [INFO]:nasal      0 Transport
  124.81 [INFO]:nasal      0 Greenspace
  124.99 [INFO]:nasal      0 Transport
[Thread 0x7fff9fffe700 (LWP 23404) exited]
[Thread 0x7fffa890c700 (LWP 23403) exited]
[New Thread 0x7fffe98b6700 (LWP 23420)]
[Thread 0x7fffe98b6700 (LWP 23400) exited]
[Thread 0x7fffaac41700 (LWP 23399) exited]
[Thread 0x7fffaf443700 (LWP 23398) exited]
[Thread 0x7fffd154a700 (LWP 23394) exited]
[Thread 0x7fffd96fb700 (LWP 23390) exited]
[Thread 0x7fffd8efa700 (LWP 23391) exited]
[Thread 0x7fffd254c700 (LWP 23392) exited]
[Thread 0x7fffd1d4b700 (LWP 23393) exited]
[Thread 0x7fffdb7ff700 (LWP 23386) exited]

Thread 6 "fgfs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe2630700 (LWP 23384)]
0x00007ffff5ecdb2e in osg::GraphicsContext::runOperations() () from ../../openscenegraph/lib/libosg.so.162
(gdb) q
A debugging session is active.

   Inferior 1 [process 23376] will be killed.

Quit anyway? (y or n) y
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: Segfault after File > Reset

Postby wkitty42 » Mon Sep 06, 2021 3:29 pm

MariuszXC wrote in Mon Sep 06, 2021 12:05 pm:
Code: Select all
Reading symbols from ./fgfs...done.
(gdb) thread apply all bt
(gdb) r
Starting program: ...compile/fg_next/install/flightgear/bin/fgfs --fg-root=...compile/fg_next/install/flightgear/bin/../fgdata --httpd=8080 --telnet=5000 --airport=EPGD --enable-auto-coordination --aircraft=c172p

this is the wrong place to "thread apply all bt"...

MariuszXC wrote in Mon Sep 06, 2021 12:05 pm:
Code: Select all
Thread 6 "fgfs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe2630700 (LWP 23384)]
0x00007ffff5ecdb2e in osg::GraphicsContext::runOperations() () from ../../openscenegraph/lib/libosg.so.162
(gdb) q

do it here after the SIGSEGV instead of 'q'... then you can 'q' after it finishes outputting everything...
"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: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Segfault after File > Reset

Postby MariuszXC » Mon Sep 06, 2021 8:20 pm

wkitty42 wrote in Mon Sep 06, 2021 3:29 pm:this is the wrong place to "thread apply all bt"...
do it here after the SIGSEGV instead of 'q'... then you can 'q' after it finishes outputting everything...


/me blushes
right you are.

Code: Select all
   26.72 [INFO]:OSG       
   26.72 [WARN]:OSG        PNG lib warning : Interlace handling should be turned on when using png_read_image
   26.89 [INFO]:nasal      Annunciator panel: initialized
   26.90 [ALRT]:flight     Failed to save initial FDM property state
   31.97 [INFO]:nasal      Starting hard-coded terrain presampling
   31.97 [INFO]:nasal      Primer reset to 0
   79.21 [INFO]:nasal      Garmin 196 loading cities
   84.82 [INFO]:nasal      Garmin 196 loading cities done
[Thread 0x7fff9fffe700 (LWP 24065) exited]
[Thread 0x7fffa890c700 (LWP 24064) exited]
[New Thread 0x7fffe98b6700 (LWP 24076)]
[Thread 0x7fffe98b6700 (LWP 24061) exited]
[Thread 0x7fffaac41700 (LWP 24060) exited]
[Thread 0x7fffaf443700 (LWP 24059) exited]
[Thread 0x7fffd154a700 (LWP 24054) exited]
[Thread 0x7fffd96fb700 (LWP 24050) exited]
[Thread 0x7fffd8efa700 (LWP 24051) exited]
[Thread 0x7fffd254c700 (LWP 24052) exited]
[Thread 0x7fffd1d4b700 (LWP 24053) exited]
[Thread 0x7fffdb7ff700 (LWP 24047) exited]

Thread 6 "fgfs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe2630700 (LWP 24045)]
0x0000000000000000 in ?? ()
(gdb) thread apply all bt

Thread 25 (Thread 0x7fffe98b6700 (LWP 24076)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff3d4a0fc in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x0000000001101283 in std::condition_variable::wait<SGWaitCondition::wait(std::mutex&)::<lambda()> > (__p=..., __lock=..., this=0x2f99cf0)
    at .../compile/fg_next/simgear/simgear/threads/SGThread.cxx:125
#3  SGWaitCondition::wait (this=this@entry=0x2f99cc0, mutex=...) at .../compile/fg_next/simgear/simgear/threads/SGThread.cxx:125
#4  0x0000000001018a13 in SGBlockingQueue<simgear::LogEntry>::pop (this=0x2f99c40) at /usr/include/c++/9/bits/std_mutex.h:103
#5  logstream::LogStreamPrivate::run (this=0x2f99c00) at .../compile/fg_next/simgear/simgear/debug/logstream.cxx:378
#6  0x0000000001102b22 in SGThread::start_routine (data=0x2f99c00) at .../compile/fg_next/simgear/simgear/threads/SGThread.cxx:98
#7  0x00007ffff3d4fa00 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x00007ffff49506ba in start_thread (arg=0x7fffe98b6700) at pthread_create.c:333
#9  0x00007ffff349b51d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 21 (Thread 0x7fffaab40700 (LWP 24062)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff3d4a0fc in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00000000011016db in SGExclusiveThread::wait (this=this@entry=0x33d1acb0) at .../compile/fg_next/simgear/simgear/threads/SGThread.cxx:220
#3  0x0000000001102ad8 in SGExclusiveThread::run (this=0x33d1acb0) at .../compile/fg_next/simgear/simgear/threads/SGThread.cxx:256
#4  SGThread::start_routine (data=0x33d1acb0) at .../compile/fg_next/simgear/simgear/threads/SGThread.cxx:97
#5  0x00007ffff3d4fa00 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff49506ba in start_thread (arg=0x7fffaab40700) at pthread_create.c:333
#7  0x00007ffff349b51d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7fffe2630700 (LWP 24045)):
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff5ecdb31 in osg::GraphicsContext::runOperations() () from ../../openscenegraph/lib/libosg.so.162
#2  0x00007ffff5f4ea9d in osg::OperationThread::run() () from ../../openscenegraph/lib/libosg.so.162
#3  0x00007ffff5ecfbaa in non-virtual thunk to osg::GraphicsThread::run() () from ../../openscenegraph/lib/libosg.so.162
#4  0x00007ffff5b1a3bf in OpenThreads::ThreadPrivateActions::StartThread(void*) () from ../../openscenegraph/lib/libOpenThreads.so.21
#5  0x00007ffff49506ba in start_thread (arg=0x7fffe2630700) at pthread_create.c:333
#6  0x00007ffff349b51d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7ffff7ef7c00 (LWP 24037)):
#0  0x00007ffff347e927 in sched_yield () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff5b19929 in OpenThreads::Thread::YieldCurrentThread() () from ../../openscenegraph/lib/libOpenThreads.so.21
#2  0x00007ffff5f4e2b5 in osg::OperationThread::cancel() () from ../../openscenegraph/lib/libosg.so.162
#3  0x00007ffff5ecae49 in osg::GraphicsContext::setGraphicsThread(osg::GraphicsThread*) () from ../../openscenegraph/lib/libosg.so.162
#4  0x00007ffff669966a in osgViewer::ViewerBase::stopThreading() () from ../../openscenegraph/lib/libosgViewer.so.162
#5  0x0000000000d3e4c1 in fgStartNewReset () at .../compile/fg_next/flightgear/src/Main/fg_init.cxx:1291
#6  0x0000000000d72e9b in fgIdleFunction () at .../compile/fg_next/flightgear/src/Main/main.cxx:453
#7  0x0000000000cd4742 in fgOSMainLoop () at .../compile/fg_next/flightgear/src/Viewer/fg_os_osgviewer.cxx:370
#8  0x0000000000d769a0 in fgMainInit (argc=<optimized out>, argv=0x7fffffffdc68) at .../compile/fg_next/flightgear/src/Main/main.cxx:817
#9  0x00000000005653c6 in main (argc=7, argv=0x7fffffffdc68) at .../compile/fg_next/flightgear/src/Main/bootstrap.cxx:331
(gdb)


note to self: don't post in a hurry.
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: Segfault after File > Reset

Postby Bjoern » Tue Sep 07, 2021 7:16 pm

Feel free to join the discussion on the issue tracker: https://sourceforge.net/p/flightgear/codetickets/2127/?page=0
Bjoern
 
Posts: 484
Joined: Fri Jan 06, 2012 11:00 pm
Location: TXL (RIP)
Version: Next
OS: ArchLinux


Return to Development

Who is online

Users browsing this forum: No registered users and 7 guests