2003-11-24 13:15:40

by Breno

[permalink] [raw]
Subject: 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


2003-11-24 13:32:27

by Tim Cambrant

[permalink] [raw]
Subject: Re: Force Coredump

On Mon, Nov 24, 2003 at 11:15:51AM -0200, Breno wrote:
> 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.

--
Tim Cambrant <[email protected]>
GPG KeyID 0x59518702
Fingerprint: 14FE 03AE C2D1 072A 87D0 BC4D FA9E 02D8 5951 8702

2003-11-24 13:47:54

by Breno

[permalink] [raw]
Subject: Re: Force Coredump

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


> On Mon, Nov 24, 2003 at 11:15:51AM -0200, Breno wrote:
> > 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.
>
> --
> Tim Cambrant <[email protected]>
> GPG KeyID 0x59518702
> 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/

2003-11-24 14:06:31

by Jan-Benedict Glaw

[permalink] [raw]
Subject: Re: Force Coredump

On Mon, 2003-11-24 11:15:51 -0200, Breno <[email protected]>
wrote in message <[email protected]>:
> 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

--
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));


Attachments:
(No filename) (875.00 B)
signature.asc (189.00 B)
Digital signature
Download all attachments

2003-11-24 15:13:14

by Willy Tarreau

[permalink] [raw]
Subject: Re: Force Coredump

On Mon, Nov 24, 2003 at 11:48:10AM -0200, Breno wrote:
> 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