Tip: my notes on 28's new core dump

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Tip: my notes on 28's new core dump

ToddAndMargo
Hi All,

    Fedora changed the way core dumps are generated.
These are my notes:

-T


Fedora 28+ core dumps:

As of Fedora 28, core dumps have to be extracted by the administrator
(root):

These commands will give you a list of core dumps

         # coredumpctl --reverse list
         # ls -l /var/lib/systemd/coredump/

You need the PID of the core dumps parent to create a coe dump:

     coredumpctl has a PID column.  "--reverse" puts the youngest at the
top:

     # coredumpctl --reverse list
     TIME                            PID   UID   GID SIG COREFILE  EXE
     Wed 2018-02-21 12:00:46 PST   20759     0     0   6 missing
/opt/Cimcor/CimTrak/CimT


     # ls -l /var/lib/systemd/coredump/
     -rw-r-----. 1 root root 1622777 May 31 03:04
core.CimTrakServer\x2eb.0.a91f9e4dc86f4e7ea65bd7dbd7eb5429.28086.1527761078000000.lz4

     The second to last set of numbers (28086 above) is the PID


To find a particular program's youngest pid (sub program name for
"CimTrak"):
     # coredumpctl --reverse list | perl6 -e 'my $x=slurp(); for split
"\n", $x -> $Line {if $Line ~~ / CimTrak / { say $Line.words[4]; last } };'
     9405



To extract a core dump:

    # coredumpctl dump {PID} --output /tmp/{PID}.core
    This will place the Core file will be located in /tmp/

    For example:
         # coredumpctl dump 9405 --output /tmp/9405.core



_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@.../message/U7TZ4TNZVA4SRPN2JUAJRZERW4RGACTF/
Reply | Threaded
Open this post in threaded view
|

Re: Tip: my notes on 28's new core dump

Sam Varshavchik
ToddAndMargo writes:

> These commands will give you a list of core dumps
>
>         # coredumpctl --reverse list
>         # ls -l /var/lib/systemd/coredump/
>
> You need the PID of the core dumps parent to create a coe dump:

An even better solution is simply:

echo "core" >/proc/sys/kernel/core_pattern

and core dumps will get generated wherever they used to be generated, before  
all this systemd clusterfrak: in the current directory.

On the machine where you do development work, and have to deal with core  
dumps all the time, you can rig this to be done automatically during the  
boot, and completely avoid having to deal with all that brain damage.


_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@.../message/KGYBADZBNWNNDLZMORLVBEJ776FHPD2G/

attachment0 (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Tip: my notes on 28's new core dump

ToddAndMargo
On 06/01/2018 08:15 PM, Sam Varshavchik wrote:

> ToddAndMargo writes:
>
>> These commands will give you a list of core dumps
>>
>>         # coredumpctl --reverse list
>>         # ls -l /var/lib/systemd/coredump/
>>
>> You need the PID of the core dumps parent to create a coe dump:
>
> An even better solution is simply:
>
> echo "core" >/proc/sys/kernel/core_pattern
>
> and core dumps will get generated wherever they used to be generated,
> before all this systemd clusterfrak: in the current directory.
>
> On the machine where you do development work, and have to deal with core
> dumps all the time, you can rig this to be done automatically during the
> boot, and completely avoid having to deal with all that brain damage.

Cool!


_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@.../message/W2BD6DKOSLBLMVZWIRMRW7EV333Y25J3/
Reply | Threaded
Open this post in threaded view
|

Re: Tip: my notes on 28's new core dump

Tom Horsley-5
In reply to this post by Sam Varshavchik
On Fri, 01 Jun 2018 23:15:24 -0400
Sam Varshavchik wrote:

> On the machine where you do development work, and have to deal with core  
> dumps all the time, you can rig this to be done automatically during the  
> boot, and completely avoid having to deal with all that brain damage.

Permanently go back to the "old" way:

cat 'kernel.core_pattern = core' >> /etc/sysctl.conf

Also, I can't tell if it is still screwed up or not because
the bugzilla about it is incomprehensible, but you may
also need to edit /etc/systemd/system.conf and set

DefaultLimitCORE=0:infinity

At one time, this changed so that ulimit was always set for
everyone to always dump core (in the previous reality
you had to use ulimit -c to enable core dumps when you
knew you wanted them). This changed default then left core
files scattered all over your system.
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@.../message/437PHTJ2HJISUEKINLUUGDYGOMCA2KAQ/
Reply | Threaded
Open this post in threaded view
|

Re: Tip: my notes on 28's new core dump

Ahmad Samir
On 2 June 2018 at 14:48, Tom Horsley <[hidden email]> wrote:

> On Fri, 01 Jun 2018 23:15:24 -0400
> Sam Varshavchik wrote:
>
>> On the machine where you do development work, and have to deal with core
>> dumps all the time, you can rig this to be done automatically during the
>> boot, and completely avoid having to deal with all that brain damage.
>
> Permanently go back to the "old" way:
>
> cat 'kernel.core_pattern = core' >> /etc/sysctl.conf

Most likely a typo, you meant 'echo' not cat.

--
Ahmad Samir
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@.../message/EGJTT7NZ2PPFBRPJHVB2UFRKZHQIWJGZ/
Reply | Threaded
Open this post in threaded view
|

Re: Tip: my notes on 28's new core dump

Tom Horsley-5
On Sat, 2 Jun 2018 15:04:17 +0200
Ahmad Samir wrote:

> Most likely a typo, you meant 'echo' not cat.

True! Thanks for the correction.
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@.../message/GEMBTD2K6RDTLXJ5LQTTWC75EHZTT7IK/
Reply | Threaded
Open this post in threaded view
|

Re: Tip: my notes on 28's new core dump

Sam Varshavchik
In reply to this post by Tom Horsley-5
Tom Horsley writes:

> On Fri, 01 Jun 2018 23:15:24 -0400
> Sam Varshavchik wrote:
>
> > On the machine where you do development work, and have to deal with core
> > dumps all the time, you can rig this to be done automatically during the
> > boot, and completely avoid having to deal with all that brain damage.
>
> Permanently go back to the "old" way:
>
> cat 'kernel.core_pattern = core' >> /etc/sysctl.conf
Hmm, I looked into this. What you really want to do is

echo "kernel.core_pattern = core" >/etc/sysctl.d/50-coredump.conf

According to the comments in sysctl.conf, this should override what systemd  
installs in /usr/lib/sysctl.d

> Also, I can't tell if it is still screwed up or not because
> the bugzilla about it is incomprehensible, but you may
> also need to edit /etc/systemd/system.conf and set
>
> DefaultLimitCORE=0:infinity
>
> At one time, this changed so that ulimit was always set for
> everyone to always dump core (in the previous reality
> you had to use ulimit -c to enable core dumps when you
> knew you wanted them). This changed default then left core
> files scattered all over your system.
Actually, it's better to manually set the ulimit in your shell. This way, if  
some random process dumps core it won't spew it somewhere.

If I ever get motivated enough, I might look into a wrapper that checks if  
the process that's dumping core comes from /home, and if so writes the core  
file normally, else it gets thrown away completely.


_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@.../message/P7WAXFKMMTCW6JKMIQMUE647JW2FHTS6/

attachment0 (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Tip: my notes on 28's new core dump

Tom Horsley-5
On Sat, 02 Jun 2018 09:23:35 -0400
Sam Varshavchik wrote:

> Actually, it's better to manually set the ulimit in your shell. This way, if  
> some random process dumps core it won't spew it somewhere.

Right, that is what the DefaultLimitCore change accomplishes.
Without it, everything that aborts dumps core all the time
(i.e. random processes spew core files all over your system :-).
(At least it did when they first made the change, perhaps
it is better now, but I continue to set the default in order
to prevent any recurrence).
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@.../message/AYAFVDHZM7ATWAKYLH4CWMZA5VSS6U43/