Skip to content
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

Crashes in Debug mode #51

Closed
Joshix-1 opened this issue Jan 2, 2025 · 3 comments
Closed

Crashes in Debug mode #51

Joshix-1 opened this issue Jan 2, 2025 · 3 comments

Comments

@Joshix-1
Copy link

Joshix-1 commented Jan 2, 2025

$ python -Xdev -c "import blake3"
Debug memory block at address p=0x5578bf541160: API 'm'
    1420 bytes originally requested
    The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected.
    The 8 pad bytes at tail=0x5578bf5416ec are FORBIDDENBYTE, as expected.
    Data at p: 62 6c 61 6b 65 33 28 64 ... 62 20 64 6f 63 73 2e 00

Enable tracemalloc to get the memory block allocation traceback

Fatal Python error: _PyMem_DebugRawFree: bad ID: Allocated using API 'm', verified using API 'o'
Python runtime state: initialized

Current thread 0x00007f9032ba0b80 (most recent call first):
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1320 in create_module
  File "<frozen importlib._bootstrap>", line 813 in module_from_spec
  File "<frozen importlib._bootstrap>", line 921 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/tmp/tmp.KCZU304ajx/venv/lib/python3.13/site-packages/blake3/__init__.py", line 1 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1026 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "<string>", line 1 in <module>

Aborted (core dumped)
$ pip show blake3
Name: blake3
Version: 1.0.0
Summary: Python bindings for the Rust blake3 crate
Home-page: https://github.com/oconnor663/blake3-py
...
$ python --version && uname -mos
Python 3.13.1
Linux x86_64 GNU/Linux

I cannot reproduce it when I install it from source using pip install ..

@ddelange
Copy link
Collaborator

ddelange commented Jan 2, 2025

might it be this soundness bug PyO3/pyo3#4757 that we fixed (but not yet released) in #47?

@ddelange
Copy link
Collaborator

ddelange commented Jan 3, 2025

@Joshix-1 I just released 1.0.1 ^

can you try that?

python -Xdev -c "import blake3" works for me on both 1.0.0 and 1.0.1 (I'm on macos-15)

@Joshix-1
Copy link
Author

Joshix-1 commented Jan 3, 2025

Works, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants