Unix Programming - Unable to generate core dumps for a program

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > June 2006 > Unable to generate core dumps for a program





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Unable to generate core dumps for a program
Frank Meerkötter

2006-06-03, 1:14 pm

Hi,

i'm having trouble generating core dumps for a certain program.
In general i can get a core dump. When running "kill -SIGILL $$" i
end up with a nice shining core file of my current shell. So in
principal it works but when doing the same thing to the program
i would like to debug no core dump is generated (it just quits).

The ulimit for core files is unlimited and the current working
directory is writeable. What else could be the problem that no
core dump is generated?

Can a program do something that prevents coredump generation?

Thanks.

Regards,
Frank

Bjorn Reese

2006-06-03, 1:14 pm

Frank Meerkötter wrote:

> Can a program do something that prevents coredump generation?


On AIX a program can prevent coredumping by setting the SA_NODUMP flag
with sigaction() for every appropriate signal.

--
mail1dotstofanetdotdk
Frank Meerkötter

2006-06-03, 1:14 pm

Bjorn Reese wrote:
> Frank Meerk=F6tter wrote:


Hi,

>
> On AIX a program can prevent coredumping by setting the SA_NODUMP flag
> with sigaction() for every appropriate signal.


The system i'm running on is linux (2.6) which doesn't have this flag.

Thanks for reply.

Regards,
Frank

Paul Pluzhnikov

2006-06-03, 1:14 pm

"Frank Meerkötter" <frank@betaversion.net> writes:

> Can a program do something that prevents coredump generation?


On any UNIX system, a program can establish signal handler for all
core-dumping signals, and call _exit() when that handler is invoked.

Since you are on linux, run the program under strace and see if in
fact it does that for SIGILL. If so, see if it also does that for
other core-dumping signals (usually SIGQUIT is the signal you'll
want to send -- its *only* reason is to stop program with a core).

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Jordan Abel

2006-06-03, 1:14 pm

2006-06-03 <1149345627.647575.136850@y43g2000cwc.googlegroups.com>,
Frank Meerkötter wrote:
> Hi,
>
> i'm having trouble generating core dumps for a certain program.
> In general i can get a core dump. When running "kill -SIGILL $$" i
> end up with a nice shining core file of my current shell. So in
> principal it works but when doing the same thing to the program
> i would like to debug no core dump is generated (it just quits).
>
> The ulimit for core files is unlimited and the current working
> directory is writeable. What else could be the problem that no
> core dump is generated?
>
> Can a program do something that prevents coredump generation?


it might be setting its own ulimit.
Maxim Yegorushkin

2006-06-03, 7:25 pm


Paul Pluzhnikov wrote:
> "Frank Meerk=F6tter" <frank@betaversion.net> writes:
>
>
> On any UNIX system, a program can establish signal handler for all
> core-dumping signals, and call _exit() when that handler is invoked.


One can also block all ignorable signals using sigprocmask().

Paul Pluzhnikov

2006-06-03, 7:25 pm

"Maxim Yegorushkin" <maxim.yegorushkin@gmail.com> writes:

> One can also block all ignorable signals using sigprocmask().


True. However that is *not* what's happening to the OP program, since
it "just quits". If it blocked SIGILL, it would "just keep running".

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Bas

2006-06-03, 7:25 pm

>
> Can a program do something that prevents coredump generation?
>


Yes. The program can prevent coredump generation by calling setrlimit.


Barry Margolin

2006-06-04, 1:28 am

In article <e5t2uj$tqe$1@news3.zwoll1.ov.home.nl>,
"Bas" <no-email@forme.nl> wrote:

>
> Yes. The program can prevent coredump generation by calling setrlimit.


Another thing that will prevent core dumps is if the program is setuid.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Jordan Abel

2006-06-04, 1:28 am

2006-06-04 <barmar-E9421C.21424703062006@comcast.dca.giganews.com>,
Barry Margolin wrote:
> In article <e5t2uj$tqe$1@news3.zwoll1.ov.home.nl>,
> "Bas" <no-email@forme.nl> wrote:
>
>
> Another thing that will prevent core dumps is if the program is setuid.


That would also prevent him sending signals
Barry Margolin

2006-06-04, 7:19 pm

In article <slrne84ghe.1n6f.random@random.yi.org>,
Jordan Abel <random@random.yi.org> wrote:

> 2006-06-04 <barmar-E9421C.21424703062006@comcast.dca.giganews.com>,
> Barry Margolin wrote:
>
> That would also prevent him sending signals


I thought you could send signals if your UID matches the saved UID. Or
can you only send keyboard-generated signals to processes you started?

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Michael Kerrisk

2006-06-04, 7:19 pm

On Sun, 04 Jun 2006 15:37:15 -0400, Barry Margolin
<barmar@alum.mit.edu> wrote:

>In article <slrne84ghe.1n6f.random@random.yi.org>,
> Jordan Abel <random@random.yi.org> wrote:
>
>
>I thought you could send signals if your UID matches the saved UID. Or
>can you only send keyboard-generated signals to processes you started?


Barry, you are correct: an unprivileged process can signal another
process if the real or effective UID of the sender matches the real
UID or saved set-user-ID of the receiver.

Cheers,

Michael


Jordan Abel

2006-06-04, 7:19 pm

2006-06-04 <barmar-886AC6.15371504062006@comcast.dca.giganews.com>,
Barry Margolin wrote:
> In article <slrne84ghe.1n6f.random@random.yi.org>,
> Jordan Abel <random@random.yi.org> wrote:
>
>
> I thought you could send signals if your UID matches the saved UID. Or
> can you only send keyboard-generated signals to processes you started?


Keyboard-generated signals don't come from you, they come from the tty
driver.
Jordan Abel

2006-06-04, 7:19 pm

2006-06-04 <rug682l8g36lpdvislohf834n2l55bp8ut@4ax.com>,
Michael Kerrisk wrote:
> On Sun, 04 Jun 2006 15:37:15 -0400, Barry Margolin
> <barmar@alum.mit.edu> wrote:
>
>
> Barry, you are correct: an unprivileged process can signal another
> process if the real or effective UID of the sender matches the real
> UID or saved set-user-ID of the receiver.


Doesn't that open the door to easy exploitation of race conditions via
SIGSTOP/SIGCONT?
Maxim Yegorushkin

2006-06-05, 7:28 am


Paul Pluzhnikov wrote:
> "Maxim Yegorushkin" <maxim.yegorushkin@gmail.com> writes:
>
>
> True. However that is *not* what's happening to the OP program, since
> it "just quits". If it blocked SIGILL, it would "just keep running".


Sorry, I missed "just quits" bit.

Barry Margolin

2006-06-06, 1:27 am

In article <slrne86jhd.1n6f.random@random.yi.org>,
Jordan Abel <random@random.yi.org> wrote:

> 2006-06-04 <rug682l8g36lpdvislohf834n2l55bp8ut@4ax.com>,
> Michael Kerrisk wrote:
>
> Doesn't that open the door to easy exploitation of race conditions via
> SIGSTOP/SIGCONT?


It makes the window larger, but it was already there to begin with. So
setuid programs have to be programmed to defend against this possibility.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Steven Ding

2006-06-10, 1:21 pm

Frank Meerk=F6tter ??:
> Hi,
>=20
> i'm having trouble generating core dumps for a certain program.
> In general i can get a core dump. When running "kill -SIGILL $$" i
> end up with a nice shining core file of my current shell. So in
> principal it works but when doing the same thing to the program
> i would like to debug no core dump is generated (it just quits).
>=20
> The ulimit for core files is unlimited and the current working
> directory is writeable. What else could be the problem that no
> core dump is generated?
>=20
> Can a program do something that prevents coredump generation?
>=20
> Thanks.
>=20
> Regards,
> Frank
>=20

You can try to set rlimit. I remember (but not sure) on some systems=20
such as solaris, core can't be generated if rlimit is unlimited?

--=20
Steven Ding
Email: wjding<at>gmail.com
Michael Paoli

2006-06-12, 1:30 am

Frank Meerk=F6tter wrote:
> i'm having trouble generating core dumps for a certain program.

Make sure all the prerequisite conditions are met,
e=2Eg. is the program able to write file named core in the current
working directory.
http://www.fastcgi.com/archives/fas...une/001290.html
Seems I've run across some man page before that spelled out all the
sufficient and necessary conditions for program to dump core, but at
present I'm not quickly and easily locating such.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com