Skip to content

Fix Sanitizer failures in FS tests #23243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2024
Merged

Conversation

dschuff
Copy link
Member

@dschuff dschuff commented Dec 20, 2024

  • Add a mode parameter to the open() call in test_fs_enotdir to avoid
    reading the uninitialized parameter when using O_CREAT
  • Add a call to closedir pair the call to fdopendir in in
    test_fs_readdir_ino_matches_stat_ino, which allows the implementation to
    free the underlying stream and make LSan happy.

* Add a mode parameter to the open() call in test_fs_enotdir to avoid
  reading the uninitialized parameter when using O_CREAT
* Add a call to closedir pair the call to fdopendir in in
  test_fs_readdir_ino_matches_stat_ino, which allows the implementation to
  free the underlying stream and make LSan happy.
@dschuff dschuff requested review from kripken and hoodmane December 20, 2024 19:52
@hoodmane hoodmane enabled auto-merge (squash) December 20, 2024 20:01
@hoodmane hoodmane disabled auto-merge December 20, 2024 20:01
Copy link
Collaborator

@hoodmane hoodmane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up after me again @dschuff

@dschuff
Copy link
Member Author

dschuff commented Dec 20, 2024

No worries. This happens because we don't run the sanitizers until after the changes make it over to Chromium.

Arguably the latter change also shouldn't be necessary, under the usual model where the process gets cleaned up on exit. fdopendir is a little weird since the spec doesn't seem to guarantee that an underlying allocation happens, but it does anyway. It seemed easier to just do this than to try to make LSan happier in general with this.

@dschuff dschuff merged commit 06f343d into emscripten-core:main Dec 20, 2024
27 of 29 checks passed
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.

3 participants