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
bpo-36648: fix mmap issue for VxWorks #12394
Conversation
The mmap module set MAP_SHARED flag when map anonymous memory, however VxWorks only support MAP_PRIVATE when map anonymous memory, this commit clear MAP_SHARED and set MAP_PRIVATE.
|
Please open a separated bpo issue to explain what is the current behavior, what is the expected behavior, etc. Maybe mmap.mmap should raise a NotImplementedError if requested flags are no supported? |
|
Is there a platform notes or something that discusses these limits? Or should a change be made to the main documents, saying that shared doesn't work on VxWorks? (Or more generally, not all flags are meaningful on all platforms, with this as an explicit example.) Other than that, I would say it is good. |
|
Thanks for your comment, However, anonymous mappings is not part of the POSIX standard, python user just need to specified -1 as fd value when do anonymous map, for example: m = mmap.mmap(-1, 100) then python adapter module (the file that I changed) try to specify MAP_SHARED or MAP_PRIVATE based on operate system requirement, Linux require MAP_SHARED, VxWorks require MAP_PRIVATE, this different is hidden by this module, and python user won't be affected. This change doesn't change the behavior of other platforms, also belong to adapt python to VxWorks, so I think we don't need a new bpo. VxWorks will run pass all of test_mmap.py case related with anonymous map, so we don't need to document for python user, and I also check the mmap.rst, there isn't document to introduce how operation support them, so I think we don't need to document it. |
|
@LihuaZhao can you please open a new issue on bugs.python.org as I requested in a previous comment? |
|
I have created new bpo: https://bugs.python.org/issue36648, I am not sure whether I could go on use this PR, I just update this PR title and link this PR to the new created bpo. The changes is transparent for PYthon user, only change the flag from MAP_SHARED to MAP_PRIVATE when do anonymous mappings on VxWorks. And this behavior is not part of the POSIX standard, depended OS specified implementation, For PYthon user, it won't feel different, so I think we don't need to document. Thanks. |


The mmap module set MAP_SHARED flag when map anonymous memory, however VxWorks only support MAP_PRIVATE when map anonymous memory, this commit clear MAP_SHARED and set MAP_PRIVATE, after doing this, all of anonymous memory related test run pass on VxWorks.
https://bugs.python.org/issue36648