From 2736ea16e3eeb4445a0bea005cf6433c68022b2d Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Wed, 1 Jul 2026 19:22:04 -0500 Subject: [PATCH 1/2] Print all failed assertion expressions We print all the specialized assertions' expressions, but in the general case we've apparently just been relying on file/line output, which is less friendly. --- include/base/libmesh_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/base/libmesh_common.h b/include/base/libmesh_common.h index d907f4a5fe3..57c65bb38d9 100644 --- a/include/base/libmesh_common.h +++ b/include/base/libmesh_common.h @@ -308,7 +308,7 @@ extern bool warned_about_auto_ptr; #define libmesh_assert_msg(asserted, msg) \ do { \ if (!(asserted)) { \ - libmesh_error_msg(msg); \ + libmesh_error_msg("Assertion `" #asserted "' failed.\n" << msg); \ } } while (0) #define libmesh_exceptionless_assert_msg(asserted, msg) \ From 5eefca0c235422c37621d2f84c04f1f9f7e2f4a1 Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Wed, 1 Jul 2026 19:32:25 -0500 Subject: [PATCH 2/2] Errors should report file+line before stack trace Two experienced developers today (including myself) both failed to notice that we were printing this data at all, because our eyes glazed over after a dozen or two stack frames. --- src/base/libmesh_common.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/libmesh_common.C b/src/base/libmesh_common.C index ff303af36b9..c8e6d197056 100644 --- a/src/base/libmesh_common.C +++ b/src/base/libmesh_common.C @@ -91,12 +91,13 @@ void report_error(const char * file, int line, const char * date, const char * t } reporting_error = true; + libMesh::MacroFunctions::here(file, line, date, time, os); + if (libMesh::global_n_processors() == 1 || libMesh::on_command_line("--print-trace")) libMesh::print_trace(os); else libMesh::write_traceout(); - libMesh::MacroFunctions::here(file, line, date, time, os); reporting_error = false; }