Results 1 to 10 of 10
Hi again,
I was just wondering if anyone knew how to figure out why a c++ program I wrote si terminated prematurely without any seg faults or anything else by ...
- 07-22-2004 #1Just Joined!
- Join Date
- Jul 2004
- Location
- Seattle, WA or Lewisburg, PA. Depending on time of year.
- Posts
- 37
how to find out why linux terminates program?
Hi again,
I was just wondering if anyone knew how to figure out why a c++ program I wrote si terminated prematurely without any seg faults or anything else by linux (i think its a knoppix distro that's runnign on the machines I'm using) I just dont'' understand why it would terminate my program, since I can't seem to find any problem in my code...
thanks
- 07-22-2004 #2
- 07-22-2004 #3Linux Engineer
- Join Date
- Jul 2003
- Location
- Uppsala, Sweden
- Posts
- 1,278
exactly.. maby some magic dust fell on your computer or something :) please post the code you are having problems with also what disto/kernel version/compiler version and any compile options you used to compile it.
Proud to be a GNU/Gentoo Linux user!
- 07-22-2004 #4Linux User
- Join Date
- Jul 2004
- Posts
- 256
Make sure you run it from a term, so you can see stderr and stdout.
--monkey
- 07-22-2004 #5
- 07-22-2004 #6Linux Engineer
- Join Date
- May 2003
- Location
- Greece / Athens
- Posts
- 1,169
if you run it in console mode use redirection of stderr(2) to a file with &2> filename
Linux For Ever!
- 07-22-2004 #7Just Joined!
- Join Date
- Jul 2004
- Location
- Seattle, WA or Lewisburg, PA. Depending on time of year.
- Posts
- 37
Hey, sorry i wasn't very desscriptive, but I really can't be, especially with posting the code. I was just trying to see if there waas a general method for such things, not for a particular solution. Please don't misunderstand though, I really do appreciate all the replies!
Stahisx, do you mean? IN the mean time, what is stderr(2), that sounds like a stupid question I know. I've used stderr a bunch, but what is stderr(2)?Code:program-name &2 > "outputfileneme"
Actually, this might help... can redhat (i don't know what version) terminate a program if that program will use all available ram and over? like a program-destruct? This occured to me while i was trying to fix things today...
thanks again!
- 07-23-2004 #8Just Joined!
- Join Date
- Jul 2004
- Location
- Berea College
- Posts
- 22
Yes, if a program starts using too much memory the kernel will kill the program. It does this to help prevent memory overflows (which can corrupt your kelnel)
- 07-23-2004 #9Linux Engineer
- Join Date
- May 2003
- Location
- Greece / Athens
- Posts
- 1,169
stderr holds all the errors occur when something goes wrong.so with this code you redirect errors in a file.you can also use /var/log/messages to see error logs...
Linux For Ever!
- 07-30-2004 #10Just Joined!
- Join Date
- Jun 2004
- Posts
- 11
this may not matter much and im no guru, but i use knoppix and its an unstable kernel version if that matters..... just a thought and hope it helps =)
daemox


Reply With Quote
