Skip to content
Snippets Groups Projects

Truncate denormalized floating point values to 0 when writing ASCII

Merged Steffen Müthing requested to merge bug/do-not-crash-paraview-on-macos into master

Paraview (well, probably VTK) on macOS crashes when reading ASCII files with denormalized float values. This seems to be due to libc++'s IO stream implementation, which sets the fail bit when reading a denormalized value. On top of that, Paraview just segfaults when encountering a fail bit while loading VTK files.

libstdc++ does not set the failt bit, and I don't know what is the correct behavior, but having Paraview mysteriously crash on DUNE output files is not good.

So this patch truncates subnormal floating point values to 0 when writing ASCII. This should not seriously influence any visualization results, but it might trip up people who use exact floating point comparisons for tests (but then you shouldn't do that anyway...).

Merge request reports

Pipeline #20079 passed

Pipeline passed for 7b8af4fd on bug/do-not-crash-paraview-on-macos

Merged by Steffen MüthingSteffen Müthing 5 years ago (Aug 1, 2019 10:30am UTC)

Loading

Pipeline #20080 passed

Pipeline passed for d91ccd8c on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading