GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — gh-67877: Fix memory leaks in terminated RE matching by serhiy-storchaka · Pull Request #126840 · python/cpython Conversation
|
|
See also #126843. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Looks good to me. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| do { \ | ||
| _MAYBE_CHECK_SIGNALS; \ | ||
| if (state->fail_after_count >= 0) { \ | ||
| if (state->fail_after_count-- == 0) { \ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Setting state->fail_after_count does not affect subsequent calls of the Pattern methods, but it still affects the finditer() iterator which reuses state between iterations.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I deleted my previous reply.
Maybe setting state->fail_after_count = -1 doesn't make sense, it's better to make the finditer() iterator stop the subsequent matchings.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I remember another thing, if this patch is going to be backported, you may remove the changes related to this: - PyObject* pattern; + PatternObject* pattern; The patch will be smaller and clearer. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…126840) If SRE(match) function terminates abruptly, either because of a signal or because memory allocation fails, allocated SRE_REPEAT blocks might be never released. Co-authored-by: <[email protected]> (cherry picked from commit 7538e7f)
|
GH-126960 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…thonGH-126840) If SRE(match) function terminates abruptly, either because of a signal or because memory allocation fails, allocated SRE_REPEAT blocks might be never released. (cherry picked from commit 7538e7f) Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: <[email protected]>
|
GH-126961 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It is easier to not do. I can introduce new bugs when trying to remove these changes in backports. Initially it was needed to pass the second argument to state_fini, after reverting that change it is just a clean up, but it can still be helpful if in future we will need to pass the second argument to state_fini. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… (GH-126960) If SRE(match) function terminates abruptly, either because of a signal or because memory allocation fails, allocated SRE_REPEAT blocks might be never released. Co-authored-by: <[email protected]> (cherry picked from commit 7538e7f)
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…126840) If SRE(match) function terminates abruptly, either because of a signal or because memory allocation fails, allocated SRE_REPEAT blocks might be never released. Co-authored-by: <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.