Re: Forcing C program to core dump

2006-12-07 Thread Alex Zbyslaw

Niclas Zeising wrote:


Garrett Cooper wrote:


Hello,
   This may be obvious to some, but after some Googling (apparently 
with the wrong search terms, perhaps) and reading the gcc/gdb 
manpages, I can't seem to find out how to get a program to produce 
core dumps.
   So I was wondering, is there some simple means to produce core 
dumps or a set of conditions that I need to adhere to in order to get 
the OS to core dump the progrdam???

Thanks,
-Garrett



Just kill it with the abort signal (SIGABRT) or some other signal that 
makes the program dump core. Be aware though that if you are catching 
or ignoring the signal, this won't work.

Regards!
//Niclas


Which usually defaults to ctl-\ from the shell so it's easy to kill a 
foreground program with bothering to find process id's etc.


OK, not what you actually wanted to do, but for completeness :-)

--Alex


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Forcing C program to core dump

2006-12-06 Thread Garrett Cooper

Hello,
   This may be obvious to some, but after some Googling (apparently 
with the wrong search terms, perhaps) and reading the gcc/gdb manpages, 
I can't seem to find out how to get a program to produce core dumps.
   So I was wondering, is there some simple means to produce core dumps 
or a set of conditions that I need to adhere to in order to get the OS 
to core dump the progrdam???

Thanks,
-Garrett
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Forcing C program to core dump

2006-12-06 Thread Garrett Cooper

Garrett Cooper wrote:

Hello,
   This may be obvious to some, but after some Googling (apparently 
with the wrong search terms, perhaps) and reading the gcc/gdb 
manpages, I can't seem to find out how to get a program to produce 
core dumps.
   So I was wondering, is there some simple means to produce core 
dumps or a set of conditions that I need to adhere to in order to get 
the OS to core dump the progrdam???

Thanks,
-Garrett

   Did a bit more poking around and determined how to do it. It wasn't 
core dumping because I didn't set the maximum limit for the coredump 
size to unlimited (ulimit -c unlimited).
   Good page about this topic: 
http://linuxfocus.berlios.de/English/July2004/article343.shtml.

-Garrett
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Forcing C program to core dump

2006-12-06 Thread Max Laier
On Wednesday 06 December 2006 20:02, Garrett Cooper wrote:
 Hello,
 This may be obvious to some, but after some Googling (apparently
 with the wrong search terms, perhaps) and reading the gcc/gdb manpages,
 I can't seem to find out how to get a program to produce core dumps.
 So I was wondering, is there some simple means to produce core
 dumps or a set of conditions that I need to adhere to in order to get
 the OS to core dump the progrdam???

See gcore(1) and abort(3).  sysctl -a | grep core might turn up some 
interesting sysctls.

-- 
/\  Best regards,  | [EMAIL PROTECTED]
\ /  Max Laier  | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | [EMAIL PROTECTED]
/ \  ASCII Ribbon Campaign  | Against HTML Mail and News


pgp7Tja5B2ZqY.pgp
Description: PGP signature


Re: Forcing C program to core dump

2006-12-06 Thread Viktor Vasilev
On Wednesday 06 December 2006 20:02 Garrett Cooper wrote:
 Hello,
 This may be obvious to some, but after some Googling (apparently
 with the wrong search terms, perhaps) and reading the gcc/gdb manpages,
 I can't seem to find out how to get a program to produce core dumps.
 So I was wondering, is there some simple means to produce core dumps
 or a set of conditions that I need to adhere to in order to get the OS
 to core dump the progrdam???

Some signals default action is to cause the program to dump core, 
when they're delivered. You can see the list in the signal(3) man 
page. libc also provides the abort(3) function, which does what 
you want. The code is here:

  /usr/src/lib/libc/stdlib/abort.c


Cheers,
Vik
-- 
PGP Key: 0xE09DC8D8/6799 4011 EBDE 6412 05A1 090C DBDF 5887 E09D C8D8
Signed/encrypted mail welcome!


pgpXtluuOBwyC.pgp
Description: PGP signature


Re: Forcing C program to core dump

2006-12-06 Thread Niclas Zeising

Garrett Cooper wrote:

Hello,
   This may be obvious to some, but after some Googling (apparently with 
the wrong search terms, perhaps) and reading the gcc/gdb manpages, I 
can't seem to find out how to get a program to produce core dumps.
   So I was wondering, is there some simple means to produce core dumps 
or a set of conditions that I need to adhere to in order to get the OS 
to core dump the progrdam???

Thanks,
-Garrett


Just kill it with the abort signal (SIGABRT) or some other signal that 
makes the program dump core. Be aware though that if you are catching or 
ignoring the signal, this won't work.

Regards!
//Niclas
--
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Forcing C program to core dump

2006-12-06 Thread Garrett Cooper

Niclas Zeising wrote:

Garrett Cooper wrote:

Hello,
   This may be obvious to some, but after some Googling (apparently 
with the wrong search terms, perhaps) and reading the gcc/gdb 
manpages, I can't seem to find out how to get a program to produce 
core dumps.
   So I was wondering, is there some simple means to produce core 
dumps or a set of conditions that I need to adhere to in order to get 
the OS to core dump the progrdam???

Thanks,
-Garrett


Just kill it with the abort signal (SIGABRT) or some other signal that 
makes the program dump core. Be aware though that if you are catching 
or ignoring the signal, this won't work.

Regards!
//Niclas
Wow. I got a lot of interesting ways to kill and force a coredump. 
Haha... Not quite what I had in mind, but I guess that's what I get for 
improperly wording the question.
Thank you all, the information I've gotten recently is definitely 
educational and it'll probably end up being useful later!

-Garrett
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]