Skip to content

bpo-38037: Fix reference counters in signal module#15753

Merged
vstinner merged 1 commit into
masterfrom
unknown repository
Sep 9, 2019
Merged

bpo-38037: Fix reference counters in signal module#15753
vstinner merged 1 commit into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Sep 9, 2019

Copy link
Copy Markdown

Only 3.8 and 3.9 branches are affected.

Use PyDict_SetItemString() in this PR.

https://bugs.python.org/issue38037

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@nanjekyejoannah: Would you mind to review it as well?

@nanjekyejoannah

Copy link
Copy Markdown
Contributor

LGTM.

@vstinner

vstinner commented Sep 9, 2019

Copy link
Copy Markdown
Member

I managed to reproduce https://bugs.python.org/issue38037#msg351196 crash using this change:

diff --git a/Objects/longobject.c b/Objects/longobject.c
index 4cf2b0726e..0ad2609882 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -16,10 +16,10 @@ class int "PyObject *" "&PyLong_Type"
 /*[clinic end generated code: output=da39a3ee5e6b4b0d input=ec0275e3422a36e3]*/
 
 #ifndef NSMALLPOSINTS
-#define NSMALLPOSINTS           257
+#define NSMALLPOSINTS           0
 #endif
 #ifndef NSMALLNEGINTS
-#define NSMALLNEGINTS           5
+#define NSMALLNEGINTS           0
 #endif
 
 _Py_IDENTIFIER(little);

Start Python, exit Python: Python does crash at exit.

I confirm that this change fix the crash.

@vstinner vstinner merged commit 77643c4 into python:master Sep 9, 2019
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @animalize for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 9, 2019
(cherry picked from commit 77643c4)

Co-authored-by: animalize <animalize@users.noreply.github.com>
@bedevere-bot

Copy link
Copy Markdown

GH-15779 is a backport of this pull request to the 3.8 branch.

@ghost ghost deleted the signal_ref branch September 9, 2019 14:23
miss-islington added a commit that referenced this pull request Sep 9, 2019
(cherry picked from commit 77643c4)

Co-authored-by: animalize <animalize@users.noreply.github.com>
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 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

Successfully merging this pull request may close these issues.

6 participants