gh-107888: Fix test_mmap.test_access_parameter() on macOS 14#109928
gh-107888: Fix test_mmap.test_access_parameter() on macOS 14#109928vstinner merged 1 commit intopython:mainfrom
Conversation
|
!buildbot ARM64 macOS |
|
cc @ned-deily |
ned-deily
left a comment
There was a problem hiding this comment.
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.
perhaps make this a self.skipTest message?
There was a problem hiding this comment.
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.
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 <vstinner@python.org>
|
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 <vstinner@python.org>
|
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 <vstinner@python.org>
|
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 <vstinner@python.org>
…ythonGH-109928) (cherry picked from commit 9dbfe2d) Co-authored-by: Victor Stinner <vstinner@python.org>
|
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 <vstinner@python.org>
|
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. |
Uh oh!
There was an error while loading. Please reload this page.