fix bug about deallocating None#33723
Merged
wanghuancoder merged 3 commits intoPaddlePaddle:developfrom Jun 23, 2021
wanghuancoder:fix_pythoncapi_none
Merged
fix bug about deallocating None#33723wanghuancoder merged 3 commits intoPaddlePaddle:developfrom wanghuancoder:fix_pythoncapi_none
wanghuancoder merged 3 commits intoPaddlePaddle:developfrom
wanghuancoder:fix_pythoncapi_none
Conversation
|
Thanks for your contribution! |
zhiqiu
approved these changes
Jun 23, 2021
Comment on lines
+491
to
+497
| return_str = "Py_INCREF(Py_None);\n return Py_None;"; | ||
| } else if (outs_num == 1) { | ||
| return_str = "MakeReturnPyObject(" + return_str + ")"; | ||
| return_str = "return MakeReturnPyObject(" + return_str + ");"; | ||
| } else { | ||
| return_str = "MakeReturnPyObject(" + | ||
| return_str = "return MakeReturnPyObject(" + | ||
| paddle::string::Sprintf(RETURN_TUPLE_TEMPLATE, return_str) + | ||
| ")"; | ||
| ");"; |
Contributor
There was a problem hiding this comment.
Better use some string templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
Others
Describe
PR #32524 merge后导致分布式CE崩溃。并报如下错误:
Fatal Python error: deallocating None经分析,应该在
return Py_None;前加Py_INCREF(Py_None);。否则导致Py_None的引用计数错误。