On Fri, Aug 02, 2002 at 07:31:53PM +0800, Stas Bekman wrote:
> > 
> > I think the name shouldn't contain SEGV since that's just one of the
> > causes of a core. Another fairly common one is a Bus Error.
> 
> What signals result in the core dump? BUS SEGV PIPE ABRT? any others?

On FreeBSD:
$ man 2 sigaction | grep core
     SIG_DFL.  The defaults are process termination, possibly with core dump;
     SIGQUIT         create core image       quit program
     SIGILL          create core image       illegal instruction
     SIGTRAP         create core image       trace trap
     SIGABRT         create core image       abort(3) call (formerly SIGIOT)
     SIGEMT          create core image       emulate instruction executed
     SIGFPE          create core image       floating-point exception
     SIGBUS          create core image       bus error
     SIGSEGV         create core image       segmentation violation
     SIGSYS          create core image       non-existent system call invoked

> Currently the module traps only SIGSEGV, hence the name. Can you really 
> fork and fire up gdb on SIGBUS and other SIGs?

I don't see why not.

> > How about Debug::CoreStackTrace?
> 
> The point of this module is that there is no core involved here ;)

Debug::NoCoreStackTrace  :)

> But I guess it's fine, assuming that the module gets extended to other
> signals as well.

How about Debug::OnFaultTrace, or Debug::AutoFaultTrace?

> The module also includes Debug::SIGSEGVFault which dereferences a NULL 
> pointer and causes SIGSEGV. how should it be renamed then? 
> Debug::CoreDump? I guess I could release it separately. I bundled it up 
> because it's needed to test Debug::SIGSEGVTrace. What do you think?

You can probably drop it.  The dump() builtin also triggers a core dump:
$ perldoc -f dump | grep core
This causes an immediate core dump. [...]

>From memory dump() basically sends the process a SIGABRT signal.
Just arrange to catch that and you're done.

> BTW, meanwhile I put it on CPAN here:
> http://search.cpan.org/search?mode=module&query=SIGSEGVTrace
> 
> > Have you looked at the sigtrap module? Your work may be a natutral
> > extension to that.
> 
> It cannot be used, because the sighandler must be assigned on the C 
> level. If you do it on the perl level, under 5.8.0 it won't work because 
> of the way the signals handling is delayed in 5.8.0.

Ah. Okay.

Tim.

Reply via email to