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

Seeding many generators causes fastrand to crash #13

Closed
cloudbopper opened this issue May 1, 2020 · 2 comments
Closed

Seeding many generators causes fastrand to crash #13

cloudbopper opened this issue May 1, 2020 · 2 comments

Comments

@cloudbopper
Copy link

To reproduce:

python -m timeit -s 'import fastrand' 'fastrand.pcg32_seed(13)'

Fatal Python error: deallocating None

Current thread 0x00000001183f3dc0 (most recent call first):
  File "<timeit-src>", line 6 in inner
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/timeit.py", line 176 in timeit
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/timeit.py", line 222 in autorange
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/timeit.py", line 324 in main
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/timeit.py", line 374 in <module>
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85 in _run_code
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193 in _run_module_as_main
zsh: abort      python -m timeit -s 'import fastrand' 'fastrand.pcg32_seed(13)'

Or from within python:

import fastrand; rngs = [fastrand.pcg32_seed(i) for i in range(100000)]

Fatal Python error: deallocating None

Current thread 0x0000000116acadc0 (most recent call first):
  File "<stdin>", line 1 in <module>
zsh: abort      python

Verified that it happens on multiple OSes (MacOS, ScientificLinux).

@lemire
Copy link
Owner

lemire commented May 1, 2020

Verified. It is a real bug. I don't know how to fix it.

@lemire
Copy link
Owner

lemire commented May 1, 2020

I see how to fix it now.

@lemire lemire closed this as completed in 959734c May 1, 2020
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