12-05-2012
How to create core through program at the time of crash by handling signals?
I am in process of writing a library which can make any application of my product capable of creating core in the application's log folder with a product friendly core file name programatically. In my library I am registering for certain signals e.g. SIGILL, SIGFPE, SIGBUS, SIGSEGV, SIGSYS, SIGABRT and in the handler routine of my signal I am forking gcore to create dump of the current process.
I am able to successfully create the core in this manner if any application which uses my library runs a faulty code e.g. Illegal Memory Access (Segmentation Violation) etc. However the core created in this manner does not take me to the faulty code location and displays the Signal Handler routine stack.
On windows this can be done through registering handler by calling SetUnhandledExceptionFilter. When OS calls the handler in case of any unhandled exception it also passes _EXCEPTION_POINTERS which is used for dump creation. The dump created in this manner contains the correct information of faulty code.
Through AIX signal handling I am only getting signal number in the handler routine. How can create correct core in the given situation on AIX programatically. Forking gcore is not working here as correct core is not getting generated. If any sample program is available then that would be great.
I am using AIX 6.1
10 More Discussions You Might Find Interesting
1. Programming
Hi,
i cannot find in which file and function the signals are handled by
default.Can anyone help me?
How can i create a 33th signal?
Thanks (3 Replies)
Discussion started by: Panos
3 Replies
2. UNIX for Dummies Questions & Answers
Hi,
Is there anything you can do to a *nix (SuSE Linux actually) which allows it to *try* to do a reboot if something crashes the system?
I know they have something at work (but I don't work with the servers myself) which makes the server reboot if it crashes/locks (works about 80% of the... (0 Replies)
Discussion started by: d11wtq
0 Replies
3. Shell Programming and Scripting
Hi,
Iam having the file as follows:
QWASEDRF1234567890098765 abc@quebex.com 000000000-932333 678394-56=3 9033894
QWASEDRF1234567890098765 abc@quebex.com 000000000-932333 678394-56=3 9033894
OPIUYTREE0986666544443322 dcsx@olivaa.net ... (14 Replies)
Discussion started by: nivas
14 Replies
4. Filesystems, Disks and Memory
Hi there,
I found a link to a file /dev/core of 17 GB
Is it ok??? I couldn't find many information about it.
Any suggestion would be appreciated!!!
Thanks in advance,
Giordano Bruno
PS: I'm working with FEDORA 6 (2 Replies)
Discussion started by: Giordano Bruno
2 Replies
5. Programming
Hi All,
I have scenario where my callback function data_update() can be called anytime. I have written the function data_update() such that it will create detached thread for processing the data sent to this function.
data_update()
{
pthread_attr_t attr_thread;
... (1 Reply)
Discussion started by: wonderman
1 Replies
6. Programming
I´m writing this program in QNX , I`m kinda new to UNIX and programing in general, and when I try to run it it gives me the Memory Fault error. Can anyone help?
#include <stdio.h>
#include <fcntl.h>
void main(void)
{int a,ter;
char buf;
printf("a=");
scanf("%d",a);
ter=open... (6 Replies)
Discussion started by: GiganteAsesino
6 Replies
7. Programming
in a single main() function,so need signal handling. Use Posix Message Queue IPC mechanism , can ignore the priority and other linked list message,to implement the scenario:
client:Knock Knock
server:who's there
client: Eric
Server:Eric,Welcome.
client:exit
all process terminated
... (1 Reply)
Discussion started by: ouou
1 Replies
8. UNIX for Dummies Questions & Answers
Greetings,
I am writing a small program in C on UNIX, in which I am using (POSIX reliable) signals.
1. Suppose I have a signal : SIGX, and the corresponding signal handler : sigx_handler.
It is possible to receive SIGX in my process, and, while executing sigx_handler, to receive
again... (0 Replies)
Discussion started by: aigoia
0 Replies
9. Solaris
I am in process of writing a library which can make any application of my product capable of creating core in the application's log folder with a product friendly core file name programatically. In my library I am registering for certain signals e.g. SIGILL, SIGFPE, SIGBUS, SIGSEGV, SIGSYS, SIGABRT... (5 Replies)
Discussion started by: rajeev_ks
5 Replies
10. UNIX for Advanced & Expert Users
What will happen if signal comes while a system call is being executed?
How it will be handled? (1 Reply)
Discussion started by: rupeshkp728
1 Replies
LEARN ABOUT FREEBSD
savecore
SAVECORE(8) BSD System Manager's Manual SAVECORE(8)
NAME
savecore -- save a core dump of the operating system
SYNOPSIS
savecore -c [-v] [device ...]
savecore -C [-v] [device ...]
savecore [-fkvz] [-m maxdumps] [directory [device ...]]
DESCRIPTION
The savecore utility copies a core dump into directory, or the current working directory if no directory argument is given, and enters a
reboot message and information about the core dump into the system log.
The options are as follows:
-C Check to see if a dump exists, and display a brief message to indicate the status. An exit status of 0 indicates that a dump is
there, 1 indicates that none exists. This option is compatible only with the [-v] option.
-c Clear the dump, so that future invocations of savecore will ignore it.
-f Force a dump to be taken even if either the dump was cleared or if the dump header information is inconsistent.
-k Do not clear the dump after saving it.
-m maxdumps Maximum number of dumps to store. Once the number of stored dumps is equal to maxdumps the counter will restart from 0.
-v Print out some additional debugging information. Specify twice for more information.
-z Compress the core dump and kernel (see gzip(1)).
The savecore utility looks for dumps on each device specified by the device argument(s), or on each device in /etc/fstab marked as ``dump''
or ``swap''. The savecore utility checks the core dump in various ways to make sure that it is complete. If it passes these checks, it
saves the core image in directory/vmcore.# and information about the core in directory/info.#. For kernel textdumps generated with the
textdump(4) facility, output will be stored in the tar(5) format and named directory/textdump.tar.#. The ``#'' is the number from the first
line of the file directory/bounds, and it is incremented and stored back into the file each time savecore successfully runs.
The savecore utility also checks the available disk space before attempting to make the copies. If there is insufficient disk space in the
file system containing directory, or if the file directory/minfree exists and the number of free kilobytes (for non-superusers) in the file
system after the copies were made would be less than the number in the first line of this file, the copies are not attempted.
If savecore successfully copies the kernel and the core dump, the core dump is cleared so that future invocations of savecore will ignore it.
The savecore utility is meant to be called near the end of the initialization file /etc/rc (see rc(8)).
SEE ALSO
gzip(1), getbootfile(3), textdump(4), tar(5), dumpon(8), syslogd(8)
HISTORY
The savecore utility appeared in 4.1BSD.
Support for kernel textdumps appeared in FreeBSD 7.1.
BUGS
The minfree code does not consider the effect of compression or sparse files.
BSD
December 17, 2012 BSD