Project

General

Profile

Task #654

Make the default fatal error handler not abort

Added by Teemu Murtola over 9 years ago. Updated over 6 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
core library
Target version:
Difficulty:
uncategorized
Close

Description

For finding bugs in clean-up paths during development, it would probably be best for the default error handler not to abort on fatal errors. Instead, control should return to the caller, which would then be responsible for propagating the error code upwards. Existing code might be difficult to adapt to such changes, but what we could do is to modify the handler in src/gromacs/fatalerror/fatalerror.cpp to do this, perhaps only on debug builds and/or when an environment variable is set. This would help in new code. Unit tests most likely will always use their own error handler, but for other testing, the current abort() call effectively prevents finding any bugs in clean-up code (which is one of the reasons why the selection code uses gmx_fatal() very little).

The change itself is easy, but what should be thought about is what is the best way to handle the issue.

History

#1 Updated by Teemu Murtola about 9 years ago

  • Status changed from New to Closed
  • Assignee set to Teemu Murtola

This issue is no longer relevant now that a decision was made to use exceptions for error handling in new code.

#2 Updated by Teemu Murtola over 6 years ago

  • Project changed from Source code reorganization to GROMACS
  • Category set to core library
  • Status changed from Closed to Rejected
  • Target version set to 5.0

Also available in: Atom PDF