[Asterisk-code-review] ast_coredumper: Refactor to better find things (asterisk[16])

Kevin Harwell asteriskteam at digium.com
Mon Oct 25 13:41:05 CDT 2021


Attention is currently required from: Michael Bradeen, George Joseph.
Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16628 )

Change subject: ast_coredumper:  Refactor to better find things
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

Patchset:

PS1: 
> Ran on existing FPBX 15 instance. […]
I am seeing similar too (Ubuntu 20.04). If I execute the script from the top level Asterisk source directory, e.g. sudo ./contrib/scripts/ast_coredumper then it attempts to process every file and directory under the Asterisk source as a 'core' file.

I see this behavior as well when not using certain command line options. For instance the following executes fine:

sudo ./contrib/scripts/ast_coredumper --running --outputdir=/tmp/cores --pid=`pidof asterisk`

But if I remove the "running" option it tries to process all files under the execution directory:

sudo ./contrib/scripts/ast_coredumper --outputdir=/tmp/cores --pid=`pidof asterisk`

Example output:

Processing /home/kharwell/src/asterisk/16/configure.ac
Creating /tmp/cores/configure.ac-thread1.txt
Creating /tmp/cores/configure.ac-brief.txt
Creating /tmp/cores/configure.ac-full.txt
Creating /tmp/cores/configure.ac-locks.txt
Creating /tmp/cores/configure.ac-info.txt
Processing /home/kharwell/src/asterisk/16/funcs
Creating /tmp/cores/funcs-thread1.txt
Creating /tmp/cores/funcs-brief.txt
Creating /tmp/cores/funcs-full.txt
Creating /tmp/cores/funcs-locks.txt
Creating /tmp/cores/funcs-info.txt


File contrib/scripts/ast_coredumper:

https://gerrit.asterisk.org/c/asterisk/+/16628/comment/fb644717_3bc1fe8a 
PS1, Line 404: 	$prog [ --help ] [ --running | --RUNNING ] [ --pid="pid" ]
If I give it an invalid pid, for example:

sudo ./contrib/scripts/ast_coredumper --running --outputdir=/tmp/cores --pid=abcd

I get the following output on the CLI:

Found a single asterisk instance running as process abcd
WARNING:  Taking a core dump of the running asterisk instance will suspend call processing while the dump is saved.  Do you wish to continue? (y/N) y
Dumping  running asterisk process to /tmp/cores/core-asterisk-running-2021-10-25T13-38-00-0500

Even though the pid is invalid it still asks about suspending calls. If I choose 'y' nothing is output to the directory. The message(s) are a bit misleading. If possible try to find a way to check the pid's validity before other processing.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16628
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I674be64bdde3ef310b6a551d4911c3b600ffee59
Gerrit-Change-Number: 16628
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-CC: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-Attention: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-Attention: George Joseph <gjoseph at digium.com>
Gerrit-Comment-Date: Mon, 25 Oct 2021 18:41:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20211025/6620f2a0/attachment.html>


More information about the asterisk-code-review mailing list