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

stack exhaustion in 3.6.7 #79723

Closed
httpsgithubcomxcainiao mannequin opened this issue Dec 20, 2018 · 3 comments
Closed

stack exhaustion in 3.6.7 #79723

httpsgithubcomxcainiao mannequin opened this issue Dec 20, 2018 · 3 comments
Labels
topic-2to3 type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@httpsgithubcomxcainiao
Copy link
Mannequin

httpsgithubcomxcainiao mannequin commented Dec 20, 2018

BPO 35542
Nosy @tirkarthi, @https://github.com/xcainiao

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:

assignee = None
closed_at = <Date 2018-12-20.07:25:10.658>
created_at = <Date 2018-12-20.06:53:17.229>
labels = ['invalid', 'expert-2to3', 'type-crash']
title = 'stack exhaustion in 3.6.7'
updated_at = <Date 2018-12-20.07:25:10.656>
user = 'https://github.com/httpsgithubcomxcainiao'

bugs.python.org fields:

activity = <Date 2018-12-20.07:25:10.656>
actor = 'shuoz'
assignee = 'none'
closed = True
closed_date = <Date 2018-12-20.07:25:10.658>
closer = 'shuoz'
components = ['2to3 (2.x to 3.x conversion tool)']
creation = <Date 2018-12-20.06:53:17.229>
creator = 'shuoz'
dependencies = []
files = []
hgrepos = []
issue_num = 35542
keywords = []
message_count = 3.0
messages = ['332183', '332184', '332188']
nosy_count = 2.0
nosy_names = ['xtreak', 'shuoz']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue35542'
versions = ['Python 3.6']

@httpsgithubcomxcainiao
Copy link
Mannequin Author

httpsgithubcomxcainiao mannequin commented Dec 20, 2018

stack exhaustion in 3.6.7.

in python 3.6.7 set recursive depth 20000 will exhaustion stack and get Segmentation fault. But this dont happen in python 2.7

import sys
sys.setrecursionlimit(20000)
def f():
    f()
f()

@httpsgithubcomxcainiao httpsgithubcomxcainiao mannequin added type-security A security issue topic-2to3 labels Dec 20, 2018
@tirkarthi
Copy link
Member

Related older issue : bpo-1110055

https://docs.python.org/3/library/sys.html#sys.setrecursionlimit

The highest possible limit is platform-dependent. A user may need to set the limit higher when they have a program that requires deep recursion and a platform that supports a higher limit. This should be done with care, because a too-high limit can lead to a crash.

I think this is a known case where the stack limit is hit depending on the operating system before RecursionError can be raised when a higher recursion limit is set. On my machine (Mac 10.10.4) this segfaults on 2.7 but raises RecurstionError on Python 3.7.1. Increasing the limit to 200000 causes segfault on 3.7.1.

@httpsgithubcomxcainiao
Copy link
Mannequin Author

httpsgithubcomxcainiao mannequin commented Dec 20, 2018

thank you for your reply.

@httpsgithubcomxcainiao httpsgithubcomxcainiao mannequin closed this as completed Dec 20, 2018
@httpsgithubcomxcainiao httpsgithubcomxcainiao mannequin added invalid type-crash A hard crash of the interpreter, possibly with a core dump and removed type-security A security issue labels Dec 20, 2018
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-2to3 type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

1 participant