Skip to content

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

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

Merged
merged 1 commit into from Sep 9, 2019
Merged

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

merged 1 commit into from Sep 9, 2019

Conversation

ghost
Copy link

@ghost ghost commented Sep 9, 2019

Only 3.8 and 3.9 branches are affected.

Use PyDict_SetItemString() in this PR.

https://bugs.python.org/issue38037

Copy link
Member

@vstinner vstinner left a comment

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
Contributor

LGTM.

@vstinner
Copy link
Member

vstinner commented Sep 9, 2019

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
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
@bedevere-bot
Copy link

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 <[email protected]>
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