Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • OpenMesh OpenMesh
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 13
    • Issues 13
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenMeshOpenMesh
  • OpenMeshOpenMesh
  • Issues
  • #73
Closed
Open
Issue created Sep 24, 2020 by Jan Möbius@moebiusOwner

Bug in PropertyT<bool> restore function

I stumbled across a pretty infuriating bug in OpenMesh 8.0 (I think it still might exist in 8.1) in the restore function for PropertyT<bool> (Property.hh) (though this issue may exist elsewhere quite possibly...).

The issue occurs at the beginning of the for loop where the bit packing happens (around line 313). The problematic statement is _istr >> bits;

The problem is std::istream by default skips white space characters (https://en.cppreference.com/w/cpp/io/manip/skipws), so if one of the bytes in the stream being restored happens to be 0x20 (32 - 'space' character), it will be skipped, leading to the stream getting out of sync with the bytes read (I was able to track this down using lots of _is.tellg(); calls).

I've made a minimal change in Property.hh to ensure white space characters aren't skipped: _istr >> std::noskipws; right before the for loop. There might be a better more central place to enable this setting but it resolves the bug for us for now. If anyone has any feedback on the best place for this fix I'd love to know!

Assignee
Assign to
Time tracking