Force Coredump
Hi all,
I need force a coredump file. So i tryed :
int *i = 0;if(*i)
exit(1);
tryed to kill -11 'pid'
...
but i just received a seg. fault message, and doesn´t create coredump file.
Anybody knows why ?
att
Breno
Quoted 1 line · Breno
Anybody knows why ?
Perhaps you don't have writing access to the directory where the program is placed, or there is already a core file in the same directory, which you don't have writing access to. Another possibility (more likely) is that 'ulimit -c' is set too low. Try typing 'ulimit -c unlimited' and see if that works. This command will produce a core file for every segfault that occurs, which may be inconvenient, so take a note of what ulimit is set to before you change it.
Hope that helps. Good luck.
Signature · 3 lines
Tim Cambrant <[email protected]> GPG KeyID 0x59518702 Fingerprint: 14FE 03AE C2D1 072A 87D0 BC4D FA9E 02D8 5951 8702
Done , but no coredump file
%ulimit -c unlimited
%./test
Segmention fault
%ls -lisa
test* test.c
-----test.c ------
#include <stdio.h>
int main()
{
int *i = 0;
if(*i)
exit(1);
}------------------
test is owned by the same user of directory
att,
Breno
----- Original Message -----
From: <[email protected]>
To: "Breno" <[email protected]>
Cc: <[email protected]>
Sent: Monday, November 24, 2003 11:31 AM
Subject: Re: Force Coredump
Quoted 4 lines · Breno
Quoted 1 line
Anybody knows why ?
Perhaps you don't have writing access to the directory where the program
is placed, or there is already a core file in the same directory, which you don't have writing access to. Another possibility (more likely) is that 'ulimit -c' is set too low. Try typing 'ulimit -c unlimited' and see if that works. This command will produce a core file for every segfault that occurs, which may be inconvenient, so take a note of what ulimit is set to before you change it.
Quoted 12 lines
Hope that helps. Good luck.
--
Tim Cambrant <[email protected]>
GPG KeyID0x59518702
Fingerprint: 14FE 03AE C2D1 072A 87D0 BC4D FA9E 02D8 5951 8702 -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
On Mon, 2003-11-24 11:15:51 -0200, Breno <[email protected]> wrote in message <[email protected]>:
Quoted 11 lines
Hi all,
I need force a coredump file. So i tryed :
int *i = 0;
if(*i)
exit(1);tryed to kill -11 'pid'
...
but i just received a seg. fault message, and doesn´t create coredump file.
That's correct - "kill -l" lists signal no. 11 as SIGSEGV. Most probably, you'd try SIGABRT which is ment for this purpose. But remember, you'll need write permissions on the directory as well as a matching ulimit.
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Quoted 7 lines · Breno
Done , but no coredump file
%ulimit -c unlimited
%./test
Segmention fault
%ls -lisa
test*test.c
You also need read permissions on the executable itself (it must be dumpable). BTW, have you checked /proc/sys/kernel/core* ? Perhaps there's a pattern which references a directory in which you have no permissions ?
HTH,
Willy