Skip to content

Fixes a race condition in the dual contouring code.#2045

Merged
alecjacobson merged 1 commit intolibigl:mainfrom
ubc-nvining:main
Jun 4, 2022
Merged

Fixes a race condition in the dual contouring code.#2045
alecjacobson merged 1 commit intolibigl:mainfrom
ubc-nvining:main

Conversation

@ubc-nvining
Copy link
Copy Markdown
Contributor

The previous version of the code would call new_vertex() outside of the mutex right below it, which would in turn trigger a call to resize a bunch of std::vector<>s. The patch addresses the issue by moving the vertex such that the initialization of ev is contained within the mutex.

Fixes #2044.

Tested by meshing a handful of signed distance fields created using Chris Batty's SDF generator.

Checklist

  • All changes meet libigl style-guidelines.
  • Adds new .cpp file.
  • Adds corresponding unit test.
  • This is a minor change.

The previous version of the code would call new_vertex() outside of the mutex, which would trigger a call to resize some std::vector<>s.
This addresses the issue by moving the vertex such that the initialization of ev is contained within the mutex.
@alecjacobson
Copy link
Copy Markdown
Contributor

lgtm, will wait for the CI to finish just in case.

@ubc-nvining
Copy link
Copy Markdown
Contributor Author

Alec: gentle reminder to finish reviewing this guy. Thanks!

@alecjacobson alecjacobson merged commit 3370a3e into libigl:main Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reading freed memory on dual contouring.

2 participants