[issue37887] some leak in the compiler_assert function

2019-08-20 Thread hai shi


hai shi  added the comment:

Ok, got it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37887] some leak in the compiler_assert function

2019-08-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your patch hai shi. But note that assertion_error is a static 
variable. It is initialized only once. Your change makes it holding a borrowed 
reference after first call of compiler_assert(). This does not look reliable.

In any case assertion_error will gone after resolving issue34880, so I am 
closing this issue in favor of that.

If not issue34880, it would be better to use a private API for _Py_IDENTIFIER 
here.

--
nosy: +serhiy.storchaka
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37887] some leak in the compiler_assert function

2019-08-19 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Hi hai shi,

As you can see in other pars of the code base objects returned from 
PyUnicode_InternFromString that have static storage class do not need to be 
deallocated in case there is a failure, so this is not considered a leak as 
there will be only one owned object across all calls. The Python object is 
reused every time the function is call (so in successive calls the object can 
be reused and therefore assertion_error!= NULL).

--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37887] some leak in the compiler_assert function

2019-08-19 Thread hai shi


New submission from hai shi :

Some reference leak in compiler_assert function, due to not using  
Py_DECREF(assertion_error) before return. And having a question about code 
order in compiler_assert function.

--
components: Interpreter Core
files: compiler_assert.patch
keywords: patch
messages: 349959
nosy: pitrou, shihai1991, vstinner
priority: normal
severity: normal
status: open
title: some leak in the compiler_assert function
type: resource usage
versions: Python 3.9
Added file: https://bugs.python.org/file48550/compiler_assert.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com