Hi,

ext Jayesh Salvi wrote:
> If you can modify application's code (at least the main() entry point) you
> can register signal handlers for SIGSEGV, SIGABRT (most common causes of
> program crashes) etc. Do "man signal" for more info. If the program is in
> other languages then there should be corresponding ways to register these
> signal handlers.
> 
> If you don't have access to source code then only way that I can suggest is
> running from debugger.
> 
> If you end up registering your signal handlers - do only little in those
> signal handlers. It's not a good idea to keep executing once you have
> corrupted memory - you might run into more ugly errors.

In general trapping FATAL signals causes more troubles than it's worth.

On ARM you cannot get working backtraces (unless you compile all code on
the target with -fno-omit-frame-pointer), so it's pretty pointless to
catch SIGSEGV & SIGABRT.  At worst you make it impossible to find the
real problem.

E.g. if C-library aborts your program due to memory corruption, no
function requiring memory allocation, such as backtrace(), printf() etc
works properly, they crash instead (maybe causing recursion and
eventually really "fun to debug" backtrace in the core dump).


        - Eero
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to