-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support for M1 Macs? #35
Comments
I think there might be a confusion here between FS block size and memory page size. |
Not to mention the difference between the physical page size and the page size of the process... :| Either way, if the exact new value of |
Thanks for the bug report! I have an M1 Mac, so I'll be able to experiment with this myself. |
Interestingly, I'm unable to re-create this failure on my system (2021 M1 Pro, OS version 12.6). Can you tell me more about the system where you see this fail? Also, can you copy/paste the output of this command?
|
Actually we are trying to set up the given package with the NIX package manager on an M1 mac and the build f this package fails when it runs the tests. I will try to provide some additional data to reproduce it. |
os.statvfs_result(f_bsize=1048576, f_frsize=4096, f_blocks=242837545, f_bfree=142983978, f_bavail=142983978, f_files=1425860975, f_ffree=1424391824, f_favail=1424391824, f_flag=0, f_namemax=255) |
I have two observations to make. First, the Open Group Specification (https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html) says clearly --
Therefore, if macOS sets the size of the shared memory segment to anything other than what the caller passes, it's violating the specification. Apparently that's happening, otherwise this test wouldn't fail. Second, I'm not sure how I settled on I have occasionally mined Python's source code for ideas on how to make code cross platform, and it wouldn't surprise me if I copied the I probably copied it from there. The documentation varies for OpenGroup
https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/ IBM
https://www.ibm.com/docs/en/zos/2.3.0?topic=functions-statvfs-get-file-system-information Linux
https://www.man7.org/linux/man-pages/man3/statvfs.3.html macOSThis doc is for iPhoneOS; I had a hard time finding anything else.
About Summary About
|
I also want to point out for anyone reading that despite the title of the ticket, |
@torokati44 @rhornig @tabgab the |
Thank you so much, @osvenskan! |
Yes, I have a new release ready to go, but I was hoping one of you could test it out first since I can't re-create the problem on my Mac. Have you had a chance to test it out? Here's the change that should fix the failing test. |
Yes, I think @rhornig will try it out sometime soon. |
|
My apologies for the late response. Sadly the change in c505aea did not fix all test failures (only 1 out of 3). I was able to set up the package on my machine and give a proper fix in the above pull request #41. The main issue was that |
A few refernces:
|
Make sure that you run the tests in arm64 (native) mode. In i386 mode, the operating system will report back a page size of 4096 and all tests will pass. |
@rhornig Thanks for the update. I finally got a chance to update my Python to arm64 native and I can re-create the problem. I have no doubt your PR fixes it, but I need to figure out how to make sure that change doesn't break on other platforms. Some I can test under AWS EC2 instances, but I lost the ability to test FreeBSD when I moved to an M1 Mac since VirtualBox can't emulate x86 on ARM (yet). |
Notes to myself: I ran the snippet below on several Linux ARM & x86 platforms, an M1 Mac (using ARM-compiled Python), and an x86 Mac (courtesy of a friend) --
On all platforms except the M1 Mac,
Only on M1 Mac w/ARM Python are the values different --
That suggests #41 is a good fix. I haven't been able to test xBSD yet, nor am I likely to be able to. |
Thanks to a tip from @bpollack I learned that vultr.com has FreeBSD VMs, and I'm happy to report that the test above reports 4096 for both values.
|
Confirmed that x86 Python on M1 Mac returns 4096/4096 using the command above. |
fix for #35: Failing memory test on aarch64 based macOS.
Reopening until I release a new version that contains the fix. |
This is fixed in version 1.1.1 which is now released. |
When trying to use this module on macOS on an ARM machine, this test fails on the following line:
posix_ipc/tests/test_memory.py
Line 315 in 88c384a
With this message:
AssertionError:16384 != 4096
This is more than likely due to these processors using a 16k page size rather than the more usual 4k. The Asahi Linux community has already written much about this.
The text was updated successfully, but these errors were encountered: