machinekit/machinekit — pull request #280 by mhaberler (2014-08-26 09:25:18+00:00)
Title: symbolic backtrace support for RT

This PR adds support for symbolic backtrace of rtapi_app and rtapi_msgd, much easing the effort to debug crashes in RT; usually the faulting filename/linenumber is accurately pinpointed - example log:

rtapi_app:26724:user signal 11 - 'Segmentation fault' received, dumping core (current dir=/home/mah/machinekit/src)
rtapi_app:26724:user --- rtapi_app backtrace: ---
rtapi_app:26724:user 76e7da39 extra_setup (/tmp/tmp10uAJu/die.comp:23)
rtapi_app:26724:user 76e7d881 export (/tmp/tmp10uAJu/die.c:46)
rtapi_app:26724:user 76e7d989 rtapi_app_main (/tmp/tmp10uAJu/die.c:63)
rtapi_app:26724:user 00013a3f do_load_cmd (rtapi/posix/rtapi_app.cc:345)
rtapi_app:26724:user 000153b9 rtapi_request (rtapi/posix/rtapi_app.cc:555)
rtapi_app:26724:user --------------------

This support is conditional on libbacktrace being installed. Libbacktrace is bundled with gcc-4.8 and later, and will be autodetected; backtrace code is compiled conditionally if libbacktrace is available. On jessie (which has gcc >= 4.8) this support comes automatic.

Unfortunately no libbacktrace debian package is available for earlier gcc versions. However, it can be easily installed manually from https://github.com/mhaberler/libbacktrace .

runtestes on all architectures - i386, amd86, arm5, armv7l.

Backtrace could easily be added to e.g. milltask and other demons; see usage examples in src/rtapi/rtapi_msgd.cc .

Also, a minor fix to scripts/realtime - detect the common error of not running 'sudo make setuid'' early on.

Autodetect tcl/tk 8.6.