Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   how i handle a system that automatically become crshed (http://www.programmingforums.org/showthread.php?t=13914)

amitpansuria Sep 5th, 2007 1:54 AM

how i handle a system that automatically become crshed
 
helo,
suppose u have well build in product system which is build in linux o.s. now due to reason system automatically become crash(software crash),then how do u handle such crash. which is better way to handle such crash.
amit

rwm Sep 5th, 2007 2:52 AM

I suppose something would be causing the system to crash, so you should be checking for errors, and handling them.

For example, you could try using assert, but thats becoming replaced with the more popular exceptions, for example:

:

class Exception : public std::exception
{
    ...
};

class DivByZeroException : public Exception
{
    ...
};


:

...
if(IsZero(val))
    throw DivByZeroExc();
...


and in main, for example, you could have:

:

int main()
{
    try
    {
        ... //do something
    }
    catch(Exception x)
    {
        //handle
    }
}


Google for exceptions. That should help.

:D

lectricpharaoh Sep 5th, 2007 4:16 AM

Quote:

Originally Posted by amitpansuria
helo,
suppose u have well build in product system which is build in linux o.s. now due to reason system automatically become crash(software crash),then how do u handle such crash. which is better way to handle such crash.
amit

<parse error>

<brain explodes>

That is to say, HUH?

rwm Sep 5th, 2007 4:23 AM

Don't be a meansie hard ass! ;)

lectricpharaoh Sep 5th, 2007 4:42 AM

Quote:

Originally Posted by rwm
Don't be a meansie hard ass! ;)

I'm not. I honestly couldn't figure out what he was trying to say, other than his program crashed (or keeps crashing), and he wants to know what to do. He phrases it like a multiple choice ("which is better way"), but doesn't indicate which options are available, or which have been considered. There was no helpful information given, no specific details of what he was trying to accomplish or how the program was crashing.

In that, the post was no different than many others we get here, but the abuses he heaped upon the English language cried out for response. Yes, I realize that English is most certainly not the native language of the OP, but that post was just incomprehensible.

rwm Sep 5th, 2007 5:25 AM

I was kidding!

Some people just can't speak/write english ;)

peaceofpi Sep 5th, 2007 3:40 PM

I'll give it a whirl
Quote:

helo,
suppose u have well build in product system which is build in linux o.s. now due to reason system automatically become crash(software crash),then how do u handle such crash. which is better way to handle such crash.
amit
Suppose you have a [???] product system which is built in Linux. Now due to an unknown reason, the system crashes because of the software. How do you handle the crash, and what is the best way?

Something like this should be implemented in forum registration

DaWei Sep 5th, 2007 3:54 PM

Debug the product and reboot the system.

lectricpharaoh Sep 5th, 2007 5:34 PM

Invest in a wetware upgrade for the biological component of the system. This should remedy a lot of the inter-system communications issues.

Seif Sep 5th, 2007 5:36 PM

I would handle it by displaying a message blaming the end user for breaking my code ;)


All times are GMT -5. The time now is 9:36 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC