[PPL-devel] Re: Question PPL : abort?

Roberto Bagnara bagnara at cs.unipr.it
Sun Sep 1 16:39:08 CEST 2002


Martin Rohde wrote:
 > After calculating, say, 25000 intersections of polyhedra, I get an
 > 'abort' error message. It terminates the program.
 >
 > What does this mean?

Dear Martin,

in general, we can be much more helpful if you provide us with
some code we can run to reproduce the problem and with the complete
error messages.  So, what follows is just a guess.

The Parma Polyhedra Library uses C++ exceptions for reporting
errors to the users.  In particular, the library throws an exception
whenever a method is called in an illegal way (what "illegal" means
is explained in the documentation of the method in question).

If there is no matching handler for the exception, the C++ standard
function terminate() is called.  On most implementations, the default
terminate() function will call abort().

Of course, I cannot be sure this is what happens in your case.
One possibility to narrow down the problem is as follows.
Add the following code just before your main() function:

#include <stdexcept>
#include <iostream>

#define CATCH_STD_EXCEPTION(exception) \
catch(const std::exception& e) { \
   std::cerr << #exception " caught: " << e.what() << std::endl; \
   return 1; \
}

#define CATCH_ALL \
CATCH_STD_EXCEPTION(bad_alloc) \
CATCH_STD_EXCEPTION(invalid_argument) \
CATCH_STD_EXCEPTION(runtime_error) \
CATCH_STD_EXCEPTION(exception) \
catch(...) { \
   std::cerr << "unknown exception caught" << std::endl; \
   return 1; \
}

Then transform your main() function so that it reads

int
main() try {
   ... // All the code belonging to main() here.
}
CATCH_ALL

The output you get should now be more descriptive than a simple
"Aborted" message.  If you let us know what the result is I am
pretty confident we will be able to find what the problem is.
All the best

     Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it




More information about the PPL-devel mailing list