writing a (userland) core dump with incomplete info

Martin Husemann <[email protected]> Sat, 28 Dec 2024 14:51:50 +0100
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
Hey folks,

a mabye stupid question: PR 58936 describes a userland process smashing
its memory and triggering a core dump, but due to the memory corruption
we get invalid addresses for the environmen and then fail to find the
proper auxv vector:

proc_getauxv(pid 21737 cmd swipl) - 
   ps_envstr 0x697220616e737765  nenvstr 1920154122  auxv 0x69722065020d47bd


proc_getauxv() then fails with EFAULT and we fail writing the auxv note
in the core dump, and then stop the whole core writing process early, leaving
the user with a zero sized swipl.core file.

Can we do better? Does it make sense try debugging stuff w/o the auxv vector?

Martin