-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-107888: Fix test_mmap.test_access_parameter() on macOS 14 #109928
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
Conversation
vstinner
commented
Sep 26, 2023
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: test_mmap.test_access_parameter failing on macOS Sonoma 14.0 beta on Apple Silicon #107888
!buildbot ARM64 macOS |
cc @ned-deily |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM, with a blurb should be good to go. This probably should be backported to security releases as well to avoid CI/buildbot failures.
try: | ||
m = mmap.mmap(f.fileno(), mapsize, prot=prot) | ||
except PermissionError: | ||
# on macOS 14, PROT_READ | PROT_WRITE is not allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps make this a self.skipTest message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps make this a self.skipTest message?
That's probably a good idea although there are plenty of other places in test_mmap
that simply do a pass
for similar types of failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_access_parameter() is a long function: 124 lines, it contains many tests. If someone wants to use skipTest() as some places, the function should be splitted into sub-functions. Otherwise, there is a risk that newly added code below will be skipped by mistake.
Today I lost 10 min trying to understand why the flush() call that I added at the end doesn't work as expected...
def display_header(use_resources: tuple[str, ...]):
... # <=== a lot more code obviously
# This makes it easier to remember what to set in your local
# environment when trying to reproduce a sanitizer failure.
asan = support.check_sanitizer(address=True)
msan = support.check_sanitizer(memory=True)
ubsan = support.check_sanitizer(ub=True)
sanitizers = []
if asan:
sanitizers.append("address")
if msan:
sanitizers.append("memory")
if ubsan:
sanitizers.append("undefined behavior")
if not sanitizers:
return
print(f"== sanitizers: {', '.join(sanitizers)}")
for sanitizer, env_var in (
(asan, "ASAN_OPTIONS"),
(msan, "MSAN_OPTIONS"),
(ubsan, "UBSAN_OPTIONS"),
):
options= os.environ.get(env_var)
if sanitizer and options is not None:
print(f"== {env_var}={options!r}")
sys.stdout.flush() # <====== ADDED CODE ======
test_gh105829_should_not_deadlock_if_wakeup_pipe_full() of test_concurrent_futures.test_deadlock decided to hang: issue gh-109917. This failure is unrelated to test_mmap (unrelated to this change). |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
…ythonGH-109928) (cherry picked from commit 9dbfe2d) Co-authored-by: Victor Stinner <[email protected]>
GH-109929 is a backport of this pull request to the 3.12 branch. |
…ythonGH-109928) (cherry picked from commit 9dbfe2d) Co-authored-by: Victor Stinner <[email protected]>
GH-109930 is a backport of this pull request to the 3.11 branch. |
I'm not curious if this bug only occurs on macOS or not. I'm asking since I couldn't reproduce it on Linux. |
Thanks for quick reviews @ned-deily and @gpshead! |
As I hinted at in the review, this might be worthy of a blurb as others will probably run into it. What do you think? |
Oh. These days I'm fixing so many test failures that I stopped documenting most of them. I'm busy fixing more test failures. If you want, please go ahead and document the fix. |
…ythonGH-109928) (cherry picked from commit 9dbfe2d) Co-authored-by: Victor Stinner <[email protected]>
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
…ythonGH-109928) (cherry picked from commit 9dbfe2d) Co-authored-by: Victor Stinner <[email protected]>
…ythonGH-109928) (cherry picked from commit 9dbfe2d) Co-authored-by: Victor Stinner <[email protected]>
GH-114183 is a backport of this pull request to the 3.8 branch. |
…ythonGH-109928) (cherry picked from commit 9dbfe2d) Co-authored-by: Victor Stinner <[email protected]>
GH-114184 is a backport of this pull request to the 3.9 branch. |
GH-114185 is a backport of this pull request to the 3.10 branch. |
…H-109928) (GH-114183) (cherry picked from commit 9dbfe2d) Co-authored-by: Victor Stinner <[email protected]>
…H-109928) (GH-114185) (cherry picked from commit 9dbfe2d) Co-authored-by: Victor Stinner <[email protected]>
…H-109928) (GH-114184) (cherry picked from commit 9dbfe2d) Co-authored-by: Victor Stinner <[email protected]>