Navigation Menu

Skip to content
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

state_reset not called on 'state' before sre_search invoked #48666

Closed
CWRUResearcher1 mannequin opened this issue Nov 25, 2008 · 5 comments
Closed

state_reset not called on 'state' before sre_search invoked #48666

CWRUResearcher1 mannequin opened this issue Nov 25, 2008 · 5 comments
Labels
performance Performance or resource usage

Comments

@CWRUResearcher1
Copy link
Mannequin

CWRUResearcher1 mannequin commented Nov 25, 2008

BPO 4416
Nosy @loewis, @amauryfa

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-12-11.09:03:33.969>
created_at = <Date 2008-11-25.01:11:05.577>
labels = ['invalid', 'performance']
title = "state_reset not called on 'state' before sre_search invoked"
updated_at = <Date 2008-12-11.09:03:33.932>
user = 'https://bugs.python.org/CWRUResearcher1'

bugs.python.org fields:

activity = <Date 2008-12-11.09:03:33.932>
actor = 'amaury.forgeotdarc'
assignee = 'none'
closed = True
closed_date = <Date 2008-12-11.09:03:33.969>
closer = 'amaury.forgeotdarc'
components = ['None']
creation = <Date 2008-11-25.01:11:05.577>
creator = 'CWRU_Researcher1'
dependencies = []
files = []
hgrepos = []
issue_num = 4416
keywords = []
message_count = 5.0
messages = ['76377', '77508', '77580', '77581', '77599']
nosy_count = 3.0
nosy_names = ['loewis', 'amaury.forgeotdarc', 'CWRU_Researcher1']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'performance'
url = 'https://bugs.python.org/issue4416'
versions = ['Python 2.7']

@CWRUResearcher1
Copy link
Mannequin Author

CWRUResearcher1 mannequin commented Nov 25, 2008

/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.

@CWRUResearcher1 CWRUResearcher1 mannequin added the performance Performance or resource usage label Nov 25, 2008
@loewis
Copy link
Mannequin

loewis mannequin commented Dec 10, 2008

Can you provide a test case demonstrating a problem?

@CWRUResearcher1
Copy link
Mannequin Author

CWRUResearcher1 mannequin commented Dec 11, 2008

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)

@CWRUResearcher1
Copy link
Mannequin Author

CWRUResearcher1 mannequin commented Dec 11, 2008

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.

@amauryfa
Copy link
Member

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

1 participant