core not generating for raise(SIGABRT)
by chakka.lokesh from LinuxQuestions.org on (#544N2)
I have set
Quote:
Following is the sample code I have written :
Code:#define _GNU_SOURCE
#include<signal.h>
#include<stdlib.h>
#include<stdio.h>
#include<unistd.h>
int main()
{
raise( SIGABRT );
if( setresuid( 0, 0, 0 ) == -1 )
{
fprintf( stderr, "%s %d\n", __func__, __LINE__ );
exit(1);
}
return 0;
}Following are the commands I am executing :
Quote:
If I try ./a.out, core is not getting generated. But core is getting generated for sudo ./a.out. Is there a way I can generate the core just by using ./a.out


Quote:
ulimit -c unlimited |
Code:#define _GNU_SOURCE
#include<signal.h>
#include<stdlib.h>
#include<stdio.h>
#include<unistd.h>
int main()
{
raise( SIGABRT );
if( setresuid( 0, 0, 0 ) == -1 )
{
fprintf( stderr, "%s %d\n", __func__, __LINE__ );
exit(1);
}
return 0;
}Following are the commands I am executing :
Quote:
$ gcc dump.c $ sudo chown root:root a.out $ sudo chmod +s a.out $ ./a.out $ sudo ./a.out |