[asterisk-users] [SOLVED] Re: Feature Request: what about "core stop panic" ?

George Joseph gjoseph at digium.com
Wed Sep 7 14:41:55 CDT 2016


On Wed, Sep 7, 2016 at 11:03 AM, Olivier <oza.4h07 at gmail.com> wrote:

>
>
> 2016-09-06 14:37 GMT+02:00 George Joseph <gjoseph at digium.com>:
>
>>
>>
>> On Tue, Sep 6, 2016 at 1:55 AM, Olivier <oza.4h07 at gmail.com> wrote:
>>
>>> Hello,
>>>
>>> After testing "pkill -SEGV -f /usr/sbin/asterisk" on Debian Jessie
>>> platform, I've got several questions :
>>>
>>>
>>> 1.  When I issue a "cd /tmp; asterisk -cvvvvvvvvvvvg -U asterisk -G
>>> asterisk" command, and then issue a "pkill -SEGV asterisk" command,
>>> I can read on Asterisk console:
>>> *CLI> Segmentation error (core dumped)
>>> (*) I translated into english the exact output I got.
>>>
>>> I see a /tmp/core file exists.
>>>
>>> My asterisk.conf includes:
>>> full = verbose,notice,warning,error,debug
>>>
>>> After Asterisk's stop, my /var/log:asterisk/full doesn't include any
>>> mention to Segmentation error.
>>> I cannot find anything in dmesg, /var/log/messages or /var/log/kern.log
>>> as I did when a real segmentation fault occurred on production system.
>>>
>>> I would expect Asterisk to log something.
>>> Is this expected behaviour ?
>>>
>>
>> Yes.  Asterisk can't really log anything when it ends abruptly because of
>> critical signals like SEGV and since it was user initiated, rather than an
>> actual SEGV, there won't be a message in the kernel log buffer.
>>
>>
>>>
>>>
>>> 2. When I issue a "cd /tmp; systemctl start asterisk" command, and then
>>> issue a "pkill -SEGV asterisk" command,
>>> I can read on Asterisk console:
>>> Disconnected from Asterisk server
>>> Asterisk cleanly ending (0).
>>> Executing last minute cleanups
>>>
>>> I cannot find any core file anyware.
>>>
>>> File /var/log:asterisk/full doesn't include any mention to Segmentation
>>> error.
>>>
>>> Where should core file be created when Asterisk is run as a daemon by
>>> asterisk user and group ?
>>> Is there a setting I can use to specify the directory used (so that we
>>> can make sure appropriate ownership is set) ?
>>>
>>
>> "$ sysctl kernel.core_pattern" will show you where core files are
>> written.  For Asterisk to produce the core file, it has to be started with
>> the '-g' option so make sure your asterisk.service file is adding the
>> option.
>>
>>
> My system shows:
> # ps aux | grep asteri
> asterisk   429  7.3  2.4  59468 25088 ?        Ssl  18:47   0:03
> /usr/sbin/asterisk -U asterisk -G asterisk -g
> ...
> # sysctl kernel.core_pattern
> kernel.core_pattern = core
>

Since "core" is a relative file name, the file will be in whatever the
working directory is for the process.  You may have to hunt it down.  For
better debugging, you might want to set core_pattern to something like
" /tmp/core-%e-%t".  That way all core files will have a name like
"/tmp/core-asterisk-1473164587.7705".  "man core" should give you more info
on constructing the file name.



>
> Option -g is present.
>
> So either, the "pkill -SEGV asterisk" command  doesn't trigger any
> coredump "Asterisk cleanly ending (0)",
> either the core dump is not produced (find / -name "core.*" doesn't find
> anything) for some reason.
>
>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20160907/14e76887/attachment.html>


More information about the asterisk-users mailing list