Skip to content

Work around GCC -O3 SIGFPE - #4107

Open
sushma-4 wants to merge 2 commits into
developfrom
FEM_test
Open

Work around GCC -O3 SIGFPE#4107
sushma-4 wants to merge 2 commits into
developfrom
FEM_test

Conversation

@sushma-4

Copy link
Copy Markdown

The GEOS build was successful with GCC 13.3.0 on our platform, however two unit tests were failing at runtime with SIGFPE:

  • testFEMConsistency
  • testFEMConsistency
***** ExternalError
***** Rank 03
***** Message from Signal (detected from Signal Handler):
Floating point error encountered:
Unknown reason.

So I rebuilt the application few ways:

  1. Built in debug mode - No erros
  2. Release build with -O2 instead of -O3 - no errors
  3. Release build using -g for debug info:
    • The FEM consistency tests reproduced the same SIGFPE.
    • Running the failing case under gdb localized the failure to FieldSpecificationEqual::SpecifyFieldValue while applying displacement boundary conditions.

The failure occurred in: cpp8if( entries[ j ] >= 0 && entries[ j ] < minDiagonal )

Using a temporary diagnostic print, I confirmed that the matrix entry involved in the failing case was finite and negative,
Since this value should not mathematically raise a floating-point exception during the comparison, the issue appears to be specific to the GCC 13.3.0 Release -O3 optimization/code-generation path.

This PR introduces a narrow workaround by materializing the matrix entry into a volatile scalar before performing the comparison using volatile

@sushma-4 sushma-4 self-assigned this Jul 31, 2026
@sushma-4 sushma-4 added the ci: run CUDA builds Allows to triggers (costly) CUDA jobs label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: run CUDA builds Allows to triggers (costly) CUDA jobs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant