Skip to content

Conversation

@matrixise
Copy link
Member

@matrixise matrixise commented Mar 17, 2019

@matrixise matrixise marked this pull request as ready for review March 18, 2019 00:22
@matrixise matrixise closed this Mar 18, 2019
@matrixise matrixise reopened this Mar 18, 2019

if (runtime->xidregistry.mutex != NULL) {
PyThread_free_lock(runtime->xidregistry.mutex);
runtime->xidregistry.mutex = NULL;
Copy link
Member

Choose a reason for hiding this comment

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

Please write a separated PR to this change. I don't know well this code, so I'm not sure how xidregistry is supposed to be used.

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.

Hum, I think that I will rewrite your PR because I'm in the middle of a big refactoring, and the correct fix for your bug requires more fixes.

But please write a separated PR for _PyRuntimeState_Fini.

done:
if (init_ctype_locale != NULL) {
setlocale(LC_CTYPE, init_ctype_locale);
PyMem_RawFree(init_ctype_locale);
Copy link
Member

Choose a reason for hiding this comment

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

Oops, I missed that in the big refactoring I did last ones. Nicely spotted ;-)

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a similar leak in _PyPreConfig_Read, btharper@81e617d I didn't see any more cases grepping for setlocale calls


err = config_read_write(config, args, preconfig);
if (_Py_INIT_FAILED(err)) {
_PyRuntimeState_Fini(&_PyRuntime);
Copy link
Member

Choose a reason for hiding this comment

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

That's not the right place to cleanup things. I redesigned deeply Py_Main() to replace exit() call in mutliple layers of function calls, far from Py_Main(), with _PyInitError which allows to give back the control flow to Py_Main(). I did that to be able to cleanup Python properly.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@matrixise
Copy link
Member Author

This PR is superseded by #12400. @vstinner thank your review.

@matrixise matrixise closed this Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants