-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
ndbm can't iterate through values on OS X #74573
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
Comments
On Mac OS 10.12.4, a large shelve, backed by ndbm, can be created. But when I attempt to iterate through the values of the shelve it raises this exception: File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/dedupe/api.py", line 281, in _blockData I've confirmed that this works with Python 3.6.1. All the Python versions were installed from homebrew. I cannot reproduce on linux on windows machines. I've attached a zip file of the ndbm files that python created. |
The ndbm db's two files (in the attachment) have the following size tmp___otctx 0 bytes |
Do you mean that on OSX, you code works with 3.6.1 and fails with 3.5.3? |
Very sorry for the ambiguity. The bug appears for both python 3.5 and python 3.6.1 on OS X. I have not tried other versions of python on OS X. |
Can you provide a complete example of how to reproduce the behavior you are seeing? Ideally, it would include producing the shelve object. Also, please provide the output of this command: otool -L $(python3.6 -c 'import _dbm;print(dbm.__file_)') |
I have been trying to make a small reproducible example, but haven't been able to isolate it. Running this script [1] csv_example on mac os x under either py27 or py3 does seem *often* cause this problem [2], [3]: [1] https://github.com/dedupeio/dedupe-examples/blob/master/csv_example/csv_example.py |
It would be helpful if you could provide the output of this command: otool -L $(python3.6 -c 'import _dbm;print(dbm.__file_)') if necessary, substituting whatever command name(s) you are using to invoke python when failing. |
From one user who had problems under both 3.5 and 3.6 otool -L $(python3.5 -c 'import _dbm;print(dbm.__file_)') /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload/_dbm.cpython-35m-darwin.so: otool -L $(python3.6 -c 'import _dbm;print(dbm.__file_)') /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_ /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version |
A different user: otool -L $(python3.6 -c 'import _dbm;print(_dbm.file)') |
See also bpo-33074 |
I've attached a C program that demonstrates the problem, and have filed an issue with Apple about this: FB8919203 It is not clear to me what we can do about this, other than not building the ndbm binding on macOS. The manpages for the ndbm APIs do not mention limitations on item sizes, and the dbopen manpage mention that there a no limitations on item sizes). |
…macOS The system ndbm implementation on macOS has an undocumented limitation on the size of values and can silently corrupt database files when those are exceeded.
The best we can do is document the issue. |
…113354) * gh-74573: document that ndbm can silently corrupt databases on macOS The system ndbm implementation on macOS has an undocumented limitation on the size of values and can silently corrupt database files when those are exceeded. Co-authored-by: Erlend E. Aasland <[email protected]>
…macOS (pythonGH-113354) * pythongh-74573: document that ndbm can silently corrupt databases on macOS The system ndbm implementation on macOS has an undocumented limitation on the size of values and can silently corrupt database files when those are exceeded. (cherry picked from commit 593b4d8) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]>
…macOS (pythonGH-113354) * pythongh-74573: document that ndbm can silently corrupt databases on macOS The system ndbm implementation on macOS has an undocumented limitation on the size of values and can silently corrupt database files when those are exceeded. (cherry picked from commit 593b4d8) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]>
… macOS (GH-113354) (#113431) gh-74573: document that ndbm can silently corrupt databases on macOS (GH-113354) * gh-74573: document that ndbm can silently corrupt databases on macOS The system ndbm implementation on macOS has an undocumented limitation on the size of values and can silently corrupt database files when those are exceeded. (cherry picked from commit 593b4d8) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]>
… macOS (GH-113354) (#113432) gh-74573: document that ndbm can silently corrupt databases on macOS (GH-113354) * gh-74573: document that ndbm can silently corrupt databases on macOS The system ndbm implementation on macOS has an undocumented limitation on the size of values and can silently corrupt database files when those are exceeded. (cherry picked from commit 593b4d8) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]>
The just merged PRs document the problem in main, 3.12 and 3.11. As we cannot fix Apple's code that's the best we can do. |
…macOS (python#113354) * pythongh-74573: document that ndbm can silently corrupt databases on macOS The system ndbm implementation on macOS has an undocumented limitation on the size of values and can silently corrupt database files when those are exceeded. Co-authored-by: Erlend E. Aasland <[email protected]>
…macOS (python#113354) * pythongh-74573: document that ndbm can silently corrupt databases on macOS The system ndbm implementation on macOS has an undocumented limitation on the size of values and can silently corrupt database files when those are exceeded. Co-authored-by: Erlend E. Aasland <[email protected]>
…macOS (python#113354) * pythongh-74573: document that ndbm can silently corrupt databases on macOS The system ndbm implementation on macOS has an undocumented limitation on the size of values and can silently corrupt database files when those are exceeded. Co-authored-by: Erlend E. Aasland <[email protected]>
…macOS (python#113354) * pythongh-74573: document that ndbm can silently corrupt databases on macOS The system ndbm implementation on macOS has an undocumented limitation on the size of values and can silently corrupt database files when those are exceeded. Co-authored-by: Erlend E. Aasland <[email protected]>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: