Re: How do I get a coredump file from an application?

From: Odhiambo Washington <odhiambo_at_gmail.com>
Date: Thu, 07 Oct 2021 07:28:28 UTC
On Thu, Oct 7, 2021 at 6:09 AM Kurt Hackenberg <kh@panix.com> wrote:

> On Wed, Oct 06, 2021 at 12:37:55PM +0300, Odhiambo Washington wrote:
>
> >And an Exim developer has given me this task - to get Exim to
> >create dump.
> >I quote him below:
> >
> >*Arranging one is hard as Exim is setuid.  I've not tried **on a BSD, but
> >Linux requires some deliberate relaxation of security*
>
> You said you've already set the sysctl kern.sugid_coredump.
>
> That developer seems to have missed that, apparently, Exim catches the
> signal SIGSEGV, which means that signal will never cause a coredump.
> You could confirm that Exim catches that signal by searching the
> source code for calls to signal() or sigaction(), or for "SIGSEGV", or
> for the log string "maybe attempt to write to immutable memory".
>
> If Exim catches that signal, then the only way to get a coredump is to
> make Exim not catch that signal -- that is, temporarily remove the
> call to signal() or sigaction().
>
> See the man pages signal(3) and sigaction(2).
>
> Attached are two small sample programs that demonstrate a segmentation
> violation without and with catching the signal.  When the signal is
> not caught, the OS writes a coredump file; when the signal is caught,
> no coredump is produced.
>

Hi Kurt,

Thanks so much for the explanation. Let me discuss this with the Exim
developer and see if we end up with something.


-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' :-)