Signal handling and core file creation

Hello,

we are working on a big application that sometimes decides to create core files and block the rest of the application components to work. The creation of the core file takes long on our v880, becausethe core file is 7-10GB in size.

Now we found the#pragma init (..) to introduce a signal handler into an executable. Now we have a function that is called, if SIGSEGV or SIGBUS happen. We created a smal file containing a funtion for setting the signal handling and the function to be called in case of the two signals. In this funtion we call some p-functions like pfiles, ... This file is compiled to be a shared library and is liked to the application.

But, sometime a core file is created and sometimes not. We did not find out what the reason is. Does someone know?

We want the output of the p-functions and the core file. Is there a way?

Solaris 8

Compiler Collection 7

Sun Fire v880 (6x 900MHz, 12GB, 6x 72GB disk)

Kind regards

Oliver

[1038 byte] By [fuchsol] at [2007-11-26 8:44:39]
# 1

if you corrupt your stackpointer so the kernel cannot put the info needed for the signal

onto the stack then the signal handler cannot be called and the core file will be created.

or you take a segv whilst in the segv handler.

You might want to use sigaltstack() to define a nice clean alternate signal stack,

and use the SA_ONSTACK flags to sigaction() to set up the signal handler in your

_init function.

The only way then to avoid a big core file is to limit the core dump size using ulimit

or the newer resource controls or find why it is dumping core ;-)

tim

timuglow at 2007-7-6 22:27:32 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...