Troubleshooting crashes: Difference between revisions

Jump to navigation Jump to search
m
→‎Debugging Segfaults & Obtaining Backtraces: http://sourceforge.net/p/flightgear/mailman/message/32749837/
(→‎Minimal startup profile: Added batch file (thanks to User:Hooray for the tip))
m (→‎Debugging Segfaults & Obtaining Backtraces: http://sourceforge.net/p/flightgear/mailman/message/32749837/)
Line 310: Line 310:


valgrind et all are great if you know how to use them, but for end users, these tools are too fine-grained, we would ideally support some per-subsystem or per-feature granularity for end users.
valgrind et all are great if you know how to use them, but for end users, these tools are too fine-grained, we would ideally support some per-subsystem or per-feature granularity for end users.
== Using AddressSanitizer ==
{{FGCquote
  |AddressSanitizer does a similar job to Valgrind with less overhead <br/>
(~2.5x memory use, and nearly full speed), but requires recompiling; I <br/>
haven't seen the crash under it yet (or at all today), if anyone does <br/>
please post your log.
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32749837/
    |title=<nowiki>Re: [Flightgear-devel] crash in SGPropertyNode::fireValueChanged</nowiki>
    |author=<nowiki>Rebecca Palmer</nowiki>
    |date=<nowiki>2014-08-22</nowiki>
  }}
}}
<syntaxhighlight lang="bash">
#this is for Linux with llvm-3.4, libsqlite3-dev, flite1-dev, libhtsengine-dev; it will probably work on Mac (with possibly different  ASAN_SYMBOLIZER_PATH) but not Windows
#simgear
cmake ../../git/simgear -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_C_FLAGS="-fsanitize=address -fno-omit-frame-pointer -O2 -g"
-DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer -O2 -g"
-DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address -fno-omit-frame-pointer
-O2 -g" -DCMAKE_VERBOSE_MAKEFILE=1 -DSIMGEAR_SHARED=ON
make
sudo make install
#flightgear
cmake ../../git/flightgear -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_C_FLAGS="-fsanitize=address -fno-omit-frame-pointer -O2 -g"
-DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer -O2 -g"
-DCMAKE_VERBOSE_MAKEFILE=1 -DSIMGEAR_SHARED=ON -DENABLE_IAX=OFF
-DENABLE_FGCOM=OFF -DSYSTEM_SQLITE=ON
make
sudo make install
#run
ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-3.4/bin/llvm-symbolizer
ASAN_OPTIONS="symbolize=1 alloc_dealloc_mismatch=0" fgfs [options] 2>
asan_log.txt
#post asan_log.txt to developers mailing list and/or the issue tracker
</syntaxhighlight>


== The original idea and future developments ==
== The original idea and future developments ==

Navigation menu