top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How can I avoid the Abort, Retry, Fail messages?

–1 vote
359 views
How can I avoid the Abort, Retry, Fail messages?
posted Jul 25, 2014 by Manish Tiwari

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

When DOS encounters a critical error, it issues a call to interrupt 24, the critical error handler. Your C compiler library contains a function named harderr() that takes over the handling of calls to interrupt 24. The harderr() function takes one argument, a pointer to a function that is called if there is a hardware error.

Your user-defined hardware error-handling function is passed information regarding the specifics of the hardware error that occurred. In your function, you can display a user-defined message to avoid the ugly Abort, Retry, Fail message. This way, your program can elegantly handle such simple user errors as your not inserting the disk when prompted to do so.

answer Jul 26, 2014 by Sidharth Malhotra
Similar Questions
+2 votes

Considering working with a shard replica-set cluster, some emergency such as re-pick primary node will happen and maybe we can retry the command several times for waiting for recover of mongo.

Is there anyone know when use c driver api such as mongoc_collection_update, mongoc_collection_commond, mongoc_collection_insert, which error codes tell me that I can retry command for making the application more robust.

0 votes

I want to understand in which cases SCTP abort occurs and how it is get resolved ?

+1 vote

in the following code func.c :

 int Myfunc1(int i, int z)
 {
 return i;
 }

 int main()
 {
 int ans;

 /* casting the function into an 'int (int)' function */
 ans = ((int(*)(int))(Myfunc1))(5);

 printf("ans: %dnn", ans);

 return 0;
 }

I tried to cast an int(int,int) function into an int(int) function an got the gcc warning and note:

 func.c:13:32: warning: function called through a non-compatible type [enabled by default]
 func.c:13:32: note: if this code is reached, the program will abort

and when trying to run I get:

 Illegal instruction (core dumped)

But if i compile this file with a .cpp ending with the gcc compiler it works OK.

+5 votes

I have few queries about inline function, can anyone please help?

  1. In what stage of compilation inline function is replaced with function call?
  2. Under what conditions inline function will fail?
  3. How to verify whether inline function is successfully replaced or not?
...