Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
OpenMesh
OpenMesh
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 11
    • Issues 11
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenMesh
  • OpenMeshOpenMesh
  • Issues
  • #73

Closed
Open
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
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None