Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2a4a62ba
Commit
2a4a62ba
authored
Jun 04, 2018
by
Steve Dower
Committed by
GitHub
Jun 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-33720: Reduces maximum marshal recursion depth on release builds. (GH-7401)
parent
b609e687
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
Lib/test/test_marshal.py
Lib/test/test_marshal.py
+4
-1
Misc/NEWS.d/next/Windows/2018-06-04-09-20-53.bpo-33720.VKDXHK.rst
...S.d/next/Windows/2018-06-04-09-20-53.bpo-33720.VKDXHK.rst
+1
-0
Python/marshal.c
Python/marshal.c
+7
-1
No files found.
Lib/test/test_marshal.py
View file @
2a4a62ba
...
...
@@ -222,7 +222,10 @@ class BugsTestCase(unittest.TestCase):
# Create a deeply nested structure.
head
=
last
=
[]
# The max stack depth should match the value in Python/marshal.c.
if
os
.
name
==
'nt'
and
hasattr
(
sys
,
'gettotalrefcount'
):
# BUG: https://bugs.python.org/issue33720
# Windows always limits the maximum depth on release and debug builds
#if os.name == 'nt' and hasattr(sys, 'gettotalrefcount'):
if
os
.
name
==
'nt'
:
MAX_MARSHAL_STACK_DEPTH
=
1000
else
:
MAX_MARSHAL_STACK_DEPTH
=
2000
...
...
Misc/NEWS.d/next/Windows/2018-06-04-09-20-53.bpo-33720.VKDXHK.rst
0 → 100644
View file @
2a4a62ba
Reduces maximum marshal recursion depth on release builds.
Python/marshal.c
View file @
2a4a62ba
...
...
@@ -25,8 +25,14 @@ module marshal
* and risks coring the interpreter. When the object stack gets this deep,
* raise an exception instead of continuing.
* On Windows debug builds, reduce this value.
*
* BUG: https://bugs.python.org/issue33720
* On Windows PGO builds, the r_object function overallocates its stack and
* can cause a stack overflow. We reduce the maximum depth for all Windows
* releases to protect against this.
* #if defined(MS_WINDOWS) && defined(_DEBUG)
*/
#if defined(MS_WINDOWS)
&& defined(_DEBUG)
#if defined(MS_WINDOWS)
#define MAX_MARSHAL_STACK_DEPTH 1000
#else
#define MAX_MARSHAL_STACK_DEPTH 2000
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment