Skip to content

Add tests for src/snmalloc/override/new.cc#839

Open
paulhdk wants to merge 13 commits intomicrosoft:mainfrom
paulhdk:test-new
Open

Add tests for src/snmalloc/override/new.cc#839
paulhdk wants to merge 13 commits intomicrosoft:mainfrom
paulhdk:test-new

Conversation

@paulhdk
Copy link
Copy Markdown

@paulhdk paulhdk commented Mar 29, 2026

First-time contributor taking a stab at #85.

Questions:

  • The standard explicitly requests that new and delete don't introduce data races. Should we explicitly test that, e.g., with ThreadSanitizer?
  • I noticed in passing that rust.cc does not have any tests. Is there a reason why there aren't any or
    should that be tracked in a separate issue?

closes: #85

@paulhdk
Copy link
Copy Markdown
Author

paulhdk commented Mar 29, 2026

@microsoft-github-policy-service agree

@mjp41
Copy link
Copy Markdown
Member

mjp41 commented Mar 29, 2026

Hi @pauhdk, thanks for taking this.

The standard explicitly requests that new and delete don't introduce data races. Should we explicitly test that, e.g., with ThreadSanitizer?

We run TSan in CI. So any concurrent test will get checked with TSan.

I noticed in passing that rust.cc does not have any tests. Is there a reason why there aren't any or
should that be tracked in a separate issue?

This should also be done, but a separate PR.

We still support building with C++17, so that has caused some failures in CI. Also, there should be a clangformat pass. It will build a target with clangformat that formats the code correctly. If you can't get that to work, the CI failure should display a patch.

Copy link
Copy Markdown
Member

@mjp41 mjp41 left a comment

Choose a reason for hiding this comment

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

Thanks. I have made a few suggestions that will hopefully get it through CI.

The TSan build is failing due to duplicate symbols. We might have to disable this test on TSan sadly.

paulhdk and others added 3 commits March 30, 2026 10:58
Co-authored-by: Matthew Parkinson <mjp41@users.noreply.github.com>
Co-authored-by: Matthew Parkinson <mjp41@users.noreply.github.com>
Co-authored-by: Matthew Parkinson <mjp41@users.noreply.github.com>
@paulhdk
Copy link
Copy Markdown
Author

paulhdk commented Mar 30, 2026

Thanks. I have made a few suggestions that will hopefully get it through CI.

Thank you! You beat me to it. Probably shouldn't have pushed before addressing all of your previous comments.

The TSan build is failing due to duplicate symbols. We might have to disable this test on TSan sadly.

So, no additional data race tests needed in that case?

@paulhdk
Copy link
Copy Markdown
Author

paulhdk commented Mar 30, 2026

Just pushed another fix, @mjp41.

I believe the Ubuntu builds are failing because they run with SNMALLOC_USE_SELF_VENDORED_STL=ON.

Not sure about the Windows builds.

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.

new.cc does not have functional tests

2 participants