[asterisk-users] How can I check backtrace files ?

George Joseph
Wed, 06 Dec 2017 14:52:02 -0000

On Tue, Dec 5, 2017 at 9:20 AM, Olivier <oza.4h07 at gmail.com> wrote:

> Hello,
>
> I carefully read [1] which details how backtrace files can be produced.
>
> Maybe this seems natural to some, but how can I go one step futher, and
> check that produced XXX-thread1.txt, XXX-brief.txt, ... files are OK ?
>
> In other words, where can I find an example on how to use one of those
> files and check by myself, that if a system ever fails, I won't have to
> wait for another failure to provide required data to support teams ?
>

It's a great question but I could spend a week answering it and not scratch
the surface. :)   It's not a straightforward thing unless you know the code
in question.  The most common is a segmentation fault (segfault or SEGV).
In that case, the thread1.txt file is the place to start.  Since most of
the objects passed around are really pointers to objects, the most obvious
cause would be a 0x0 for a value.  So for instance "chan=0x0".  That
would
be a pointer to a channel object that was not set when it probably should
have been.  Unfortunately, it's not only 0x0 that could cause a segv.
 Anytime a program tries to access memory it doesn't own, that signal is
raised.  So let's say there a 256 byte buffer which the process owns.  If
there's a bug somewhere that causes the program to try and access bytes
beyond the end of the buffer, you MAY get a segv if that process doesn't
also own that memory.  If this case, the backtrace won't show anything
obvious because the pointers all look valid.  There probably would be an
index variable (i or ix, etc) that may be set to 257 but you'd have to know
that the buffer was only 256 bytes to realize that that was the issue.

Deadlocks are even harder to troubleshoot.  For that, you need to look at
full.txt to see where the threads are stuck and find the 1 thread that's
holding the lock that the others are stuck on.

Sorry.  I wish I had a better answer because it'd help a lot if folks could
do more investigation themselves.





>
> Best regards
>
> [1] https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>



--
George Joseph
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20171206/33f71cc6/attachment.html>