Replies: 2 comments 4 replies
|
Thanks for raising this question @sebproell. In my experience whenever such an error is thrown, this means that a bug of some sort was triggered (often by a previously not considered edge case). In general having this "notification" is a good thing - however, it requires a lot of experience to debug 4C if such a floating point exception is raised. And as @sebproell mentioned, usually these "bugs" will also show up somewhere else, e.g., result values, convergence of algorithms, ... . So my take on this is: every improvement in usability/debuggability w.r.t. fe exceptions is a good thing four 4C. I am not an expert in how such things are handled on the c++, but maybe this could be optional or only in debug mode. |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
#1476 revealed that we are doing something that is UB: throwing from a trap handler, here: https://github.com/4C-multiphysics/4C/blob/main/apps/global_full/4C_global_full_main.cpp#L253
This has been introduced in 20ba962 with the goal to get a nice stack trace. However, the stack trace contains the C++ exception unwind mechanism, which fails to perform the unwind since we are not in a C++ context when the OS calls the handler. So this is a bit questionable. The actual call site shows up further down in the stack trace on my machine but this seems completely OS-dependent.
Overall, the program aborts suddenly and prints a garbled stack trace. I made the following observations:
feenableexceptand you will see thatstructure_newsuddenly enablesFE_OVERFLOW.-fnon-call-exceptionswhich enables throwing from signal handlers, but this seems to be little used, and clang seems to have regressed on it.All reactions