Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My process gets killed on linux server without manual intervention. I have verified the following scenarios.
•No manual intervention done to kill either by user or admin
•RAM and SWAP are not exhausted
* dmesg didn't provide any useful info
•'strace' gives me the message that "+++ killed by SIGKILL +++" - This makes me to assume that Kernel has killed the process.
The process occupies 16.5GB of virtual memory where the RAM is 16GB and the SWAP being 50GB.
/*
* Signal handler for kill signal
*/
void sigkill_sigaction(int signal __attribute__ ((unused)), siginfo_t *si, void *arg __attribute__ ((unused)))
{
log("Caught sigkill at address %p, sent by pid: %d\n", si->si_addr, si->pid);
}
int main(int argc, char **argv)
{
struct sigaction sa;
/* Set up to catch sigkill */
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_sigaction = sigkill_sigaction;
sa.sa_flags = SA_SIGKILL;
sigaction(SIGKILL, &sa, NULL);
...
}
Note that the si_siginfo structure has other info you can use (from sigaction(2) manual page):
Code:
The siginfo_t argument to sa_sigaction is a struct with the following elements:
siginfo_t {
int si_signo; /* Signal number */
int si_errno; /* An errno value */
int si_code; /* Signal code */
int si_trapno; /* Trap number that caused
hardware-generated signal
(unused on most architectures) */
pid_t si_pid; /* Sending process ID */
uid_t si_uid; /* Real user ID of sending process */
int si_status; /* Exit value or signal */
clock_t si_utime; /* User time consumed */
clock_t si_stime; /* System time consumed */
sigval_t si_value; /* Signal value */
int si_int; /* POSIX.1b signal */
void *si_ptr; /* POSIX.1b signal */
int si_overrun; /* Timer overrun count; POSIX.1b timers */
int si_timerid; /* Timer ID; POSIX.1b timers */
void *si_addr; /* Memory location which caused fault */
long si_band; /* Band event (was int in
glibc 2.3.2 and earlier) */
int si_fd; /* File descriptor */
short si_addr_lsb; /* Least significant bit of address
(since kernel 2.6.32) */
}
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.