Skip to content
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

gh-112536: Define MI_TSAN to 1 for --with-mimalloc and --with-thread-sanitizer #116558

Merged
merged 5 commits into from
Mar 11, 2024

Conversation

corona10
Copy link
Member

@corona10 corona10 commented Mar 10, 2024

@corona10
Copy link
Member Author

Suggested from: #112648 (comment)

@erlend-aasland erlend-aasland changed the title gh-112536: Define MI_TSAN to 1 for --with-mimalloc and --with-thread-… gh-112536: Define MI_TSAN to 1 for --with-mimalloc and --with-thread-sanitizer Mar 10, 2024
erlend-aasland
erlend-aasland previously approved these changes Mar 10, 2024
configure.ac Outdated Show resolved Hide resolved
configure.ac Outdated
@@ -4750,6 +4750,12 @@ elif test "$disable_gil" = "yes"; then
AC_MSG_ERROR([--disable-gil requires mimalloc memory allocator (--with-mimalloc).])
fi

if test "$with_mimalloc" = yes; then
if test "$with_tsan" = yes; then
AC_DEFINE([MI_TSAN], [1], [Define MI_TSAN for mimalloc thread sanitizer support])
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should do this in pycore_mimalloc.h instead. We already do that for MI_DEBUG and some other defines.

Something like:

#ifdef _Py_THREAD_SANITIZER
#  define MI_TSAN 1
#endif

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, yes that looks like a better solution.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done :)

@erlend-aasland erlend-aasland dismissed their stale review March 10, 2024 22:04

Consider Sam's solution instead

@corona10 corona10 merged commit 6c4fc20 into python:main Mar 11, 2024
34 checks passed
@corona10 corona10 deleted the gh-112536-MI_TSAN branch March 11, 2024 13:25
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants