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

fix high-iteration stack overflow by flattening the list #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

warner
Copy link

@warner warner commented Jul 8, 2013

The core loop had too many generators: chaining them together results in high stack usage (and reduced speed) when called with a high number of iterations. At roughly 88000 iterations, python segfaults.

Removing those extra stack frames also appears to speed up the loop by about 5%

This fixes #2.

The core loop had too many generators: chaining them together results in high stack usage (and reduced speed) when called with a high number of iterations. At roughly 88000 iterations, python segfaults.

Removing those extra stack frames also appears to speed up the loop by about 5%

This fixes mitsuhiko#2.
@wvh
Copy link

wvh commented Sep 30, 2013

I also get a segfault starting at 74790 iterations while comparing against the openssl pbkdf2 function – I'm not actually planning on using such a high iteration count.

from pbkdf2 import pbkdf2_hex
pbkdf2_hex('hello', '', 74790, 48)

Segmentation fault

@kitschpatrol
Copy link

Would be great if this could be merged and pushed up to PIP. Fixes issues in some other projects.

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

Successfully merging this pull request may close these issues.

Segmentation Fault with high iterations
3 participants