public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] How do I get a core dump from seg-faulting software?
@ 2021-12-16 15:55 Alan Mackenzie
  2021-12-16 16:32 ` karl
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alan Mackenzie @ 2021-12-16 15:55 UTC (permalink / raw
  To: gentoo-user

Hello, Gentoo.

I'm developing software, and it crashes in its build process.  I want a
core dump, to help find out where and why it's crashing.

I've got CONFIG_ELF_CORE and CONFIG_COREDUMP both configured to yes in
my kernel.

When I do

    $ uclimit -H -c

, it tells me "unlimited".

But still, no dump.  :-(

What am I missing?

-- 
Alan Mackenzie (Nuremberg, Germany).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] How do I get a core dump from seg-faulting software?
  2021-12-16 15:55 [gentoo-user] How do I get a core dump from seg-faulting software? Alan Mackenzie
@ 2021-12-16 16:32 ` karl
  2021-12-17 11:29   ` Alan Mackenzie
  2021-12-16 20:23 ` Rich Freeman
  2021-12-16 23:18 ` tastytea
  2 siblings, 1 reply; 7+ messages in thread
From: karl @ 2021-12-16 16:32 UTC (permalink / raw
  To: gentoo-user

Alex:
> I've got CONFIG_ELF_CORE and CONFIG_COREDUMP both configured to yes in
> my kernel.
> 
> When I do
> 
>     $ uclimit -H -c
> 
> , it tells me "unlimited".
> 
> But still, no dump.  :-(
> 
> What am I missing?

Have you tried:

$ man gcore
$ man 5 core

Regards,
/Karl Hammar



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] How do I get a core dump from seg-faulting software?
  2021-12-16 15:55 [gentoo-user] How do I get a core dump from seg-faulting software? Alan Mackenzie
  2021-12-16 16:32 ` karl
@ 2021-12-16 20:23 ` Rich Freeman
  2021-12-17 11:27   ` Alan Mackenzie
  2021-12-16 23:18 ` tastytea
  2 siblings, 1 reply; 7+ messages in thread
From: Rich Freeman @ 2021-12-16 20:23 UTC (permalink / raw
  To: gentoo-user

On Thu, Dec 16, 2021 at 10:55 AM Alan Mackenzie <acm@muc.de> wrote:
>
> But still, no dump.  :-(
>
> What am I missing?

Are you using systemd?  It has a mechanism to consolidate core dumps
to a system directory with a tool to view/debug them and retention
policies.  I think that all is enabled by default, but it has been a
while since I touched it.  If it is enabled then that might explain
why dumps aren't where you expect them.

-- 
Rich


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] How do I get a core dump from seg-faulting software?
  2021-12-16 15:55 [gentoo-user] How do I get a core dump from seg-faulting software? Alan Mackenzie
  2021-12-16 16:32 ` karl
  2021-12-16 20:23 ` Rich Freeman
@ 2021-12-16 23:18 ` tastytea
  2021-12-17 11:20   ` Alan Mackenzie
  2 siblings, 1 reply; 7+ messages in thread
From: tastytea @ 2021-12-16 23:18 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

On 2021-12-16 15:55+0000 Alan Mackenzie <acm@muc.de> wrote:

> Hello, Gentoo.
> 
> I'm developing software, and it crashes in its build process.  I want
> a core dump, to help find out where and why it's crashing.
> 
> I've got CONFIG_ELF_CORE and CONFIG_COREDUMP both configured to yes in
> my kernel.
> 
> When I do
> 
>     $ uclimit -H -c
> 
> , it tells me "unlimited".
> 
> But still, no dump.  :-(
> 
> What am I missing?
> 

You need to enable them explicitly. If you're using PAM:
    echo '* soft core unlimited' > /etc/security/limits.conf

It only has an effect after your next login. For more information, see
<https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces#Core_dumps>.

Kind regards, tastytea

-- 
Get my PGP key with `gpg --locate-keys tastytea@tastytea.de` or at
<https://tastytea.de/tastytea.asc>.

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] How do I get a core dump from seg-faulting software?
  2021-12-16 23:18 ` tastytea
@ 2021-12-17 11:20   ` Alan Mackenzie
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Mackenzie @ 2021-12-17 11:20 UTC (permalink / raw
  To: gentoo-user

Hello, tastytea.

On Fri, Dec 17, 2021 at 00:18:12 +0100, tastytea wrote:
> On 2021-12-16 15:55+0000 Alan Mackenzie <acm@muc.de> wrote:

> > Hello, Gentoo.

> > I'm developing software, and it crashes in its build process.  I want
> > a core dump, to help find out where and why it's crashing.

> > I've got CONFIG_ELF_CORE and CONFIG_COREDUMP both configured to yes in
> > my kernel.

> > When I do

> >     $ uclimit -H -c

> > , it tells me "unlimited".

> > But still, no dump.  :-(

> > What am I missing?


> You need to enable them explicitly. If you're using PAM:
>     echo '* soft core unlimited' > /etc/security/limits.conf

> It only has an effect after your next login. For more information, see
> <https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces#Core_dumps>.

Thanks greatly!  This was a very helpful answer.  I've now edited that
file, and will be ready next time there's a problem like this.

As half expected when you ask a question like this, I found the problem
in my build software anyhow.  I was doing one too many pointer
dereferences on a (in C) **bool.

> Kind regards, tastytea

> -- 
> Get my PGP key with `gpg --locate-keys tastytea@tastytea.de` or at
> <https://tastytea.de/tastytea.asc>.

-- 
Alan Mackenzie (Nuremberg, Germany).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] How do I get a core dump from seg-faulting software?
  2021-12-16 20:23 ` Rich Freeman
@ 2021-12-17 11:27   ` Alan Mackenzie
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Mackenzie @ 2021-12-17 11:27 UTC (permalink / raw
  To: gentoo-user

Hello, Rich.

On Thu, Dec 16, 2021 at 15:23:53 -0500, Rich Freeman wrote:
> On Thu, Dec 16, 2021 at 10:55 AM Alan Mackenzie <acm@muc.de> wrote:

> > But still, no dump.  :-(

> > What am I missing?

> Are you using systemd?  It has a mechanism to consolidate core dumps
> to a system directory with a tool to view/debug them and retention
> policies.  I think that all is enabled by default, but it has been a
> while since I touched it.  If it is enabled then that might explain
> why dumps aren't where you expect them.

No, I'm on openrc.  I think tastytea's answer will work.

Thanks!

> -- 
> Rich

-- 
Alan Mackenzie (Nuremberg, Germany).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] How do I get a core dump from seg-faulting software?
  2021-12-16 16:32 ` karl
@ 2021-12-17 11:29   ` Alan Mackenzie
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Mackenzie @ 2021-12-17 11:29 UTC (permalink / raw
  To: gentoo-user

Hello, Karl.

On Thu, Dec 16, 2021 at 17:32:58 +0100, karl@aspodata.se wrote:
> Alex:
> > I've got CONFIG_ELF_CORE and CONFIG_COREDUMP both configured to yes in
> > my kernel.

> > When I do

> >     $ uclimit -H -c

> > , it tells me "unlimited".

> > But still, no dump.  :-(

> > What am I missing?

> Have you tried:

> $ man gcore
> $ man 5 core

I've looked at them now, thanks.  It was tastytea who spotted the crux,
the file /etc/security/limits.conf.

> Regards,
> /Karl Hammar

-- 
Alan Mackenzie (Nuremberg, Germany).


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-17 11:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-16 15:55 [gentoo-user] How do I get a core dump from seg-faulting software? Alan Mackenzie
2021-12-16 16:32 ` karl
2021-12-17 11:29   ` Alan Mackenzie
2021-12-16 20:23 ` Rich Freeman
2021-12-17 11:27   ` Alan Mackenzie
2021-12-16 23:18 ` tastytea
2021-12-17 11:20   ` Alan Mackenzie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox