Dumping a core from inside of process

Lev Walkin vlm at netli.com
Thu Aug 21 15:00:31 PDT 2003


Artem 'Zazoobr' Ignatjev wrote:
> Hello, hackers
> 
> I'm writing some program, which dlopens() a lot of shared objects, and
> can do nasty things to it's own memory. Some day I decided to trap fatal
> memory signals, like SIGILL, SIGBUS and SIGSEGV, and wrote a handler for
> these, which swears with bad words into syslog, dlcloses() all that
> objects, and quits. 

What if a handler dlcloses() something which is already in process of
dlclosing() at the time the handler fires?

> But today I found that it's very useful - to have coredump handy, since
> its eases debug a lot. What is the (correct) way to make a coredump of
> your own memory (and, it'll be nice to have all that stack frames and
> registers written as they were when the signal did occured, not what
> they were when we are already in signal handler)

man 3 abort

-- 
Lev Walkin
vlm at netli.com



More information about the freebsd-hackers mailing list