This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: state_reset not called on 'state' before sre_search invoked
Type: performance Stage:
Components: None Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: CWRU_Researcher1, amaury.forgeotdarc, loewis
Priority: normal Keywords:

Created on 2008-11-25 01:11 by CWRU_Researcher1, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg76377 - (view) Author: Brian Szuter (CWRU_Researcher1) Date: 2008-11-25 01:11
/home/rxc92/project/Python-2.5.2/Modules/_sre.c (pattern_search)
Line 2740

Elsewhere in the codebase, state_reset is called on the first parameter
of sre_search before sre_search is invoked.  The does not occur here.
msg77508 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-12-10 08:49
Can you provide a test case demonstrating a problem?
msg77580 - (view) Author: Brian Szuter (CWRU_Researcher1) Date: 2008-12-11 00:50
Examples:
/Python-2.5.2/Modules/_sre.c Lines 3289 - 3297 (scanner_search)
/Python-2.5.2/Modules/_sre.c Lines 2349 - 2357 (pattern_subx)
/Python-2.5.2/Modules/_sre.c Lines 2197 - 2205 (pattern_split)
/Python-2.5.2/Modules/_sre.c Lines 2067 - 2075 (pattern_findall)
msg77581 - (view) Author: Brian Szuter (CWRU_Researcher1) Date: 2008-12-11 00:53
This bug was found using a research tool that finds potential neglected
condition bugs by examining a code base, deducing rules from the code
base, and finding violations of those rules.  
I have not attempted to demonstrate a problem visible to users from this
bug, and so cannot provide a test case demonstrating a problem.
msg77599 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-12-11 09:03
There is no issue: in pattern_search, state_init is called before
sre_search is invoked. And state_init contains all the operations
performed by state_reset.

The invariant here is that each call to sre_search must be preceded by a
call to state_reset *or* state_init. I don't know whether your tool can
detect this.
History
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48666
2008-12-11 09:03:33amaury.forgeotdarcsetstatus: open -> closed
resolution: not a bug
messages: + msg77599
nosy: + amaury.forgeotdarc
2008-12-11 00:53:31CWRU_Researcher1setmessages: + msg77581
2008-12-11 00:50:52CWRU_Researcher1setversions: + Python 2.7, - Python 2.5.3
2008-12-11 00:50:35CWRU_Researcher1setmessages: + msg77580
versions: + Python 2.5.3, - Python 2.7
2008-12-10 08:49:46loewissetnosy: + loewis
messages: + msg77508
versions: + Python 2.7, - Python 2.5.3
2008-11-25 01:11:05CWRU_Researcher1create