Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15632] regrtest.py: spurious leaks with -R option

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Aug 12, 2012, 12:31 PM

Post #1 of 5 (109 views)
Permalink
[issue15632] regrtest.py: spurious leaks with -R option

New submission from Stefan Krah:

With the -R option, test_buffer.py needs an additional warm-up for
the unicode_latin1 cache. Patch attached.

----------
components: Tests
files: warm_latin1_cache.diff
keywords: patch
messages: 168063
nosy: skrah
priority: normal
severity: normal
stage: patch review
status: open
title: regrtest.py: spurious leaks with -R option
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file26777/warm_latin1_cache.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15632>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 12, 2012, 2:23 PM

Post #2 of 5 (105 views)
Permalink
[issue15632] regrtest.py: spurious leaks with -R option [In reply to]

Meador Inge added the comment:

I know the title says spurious, but is there a way to reproduce this at all? Can I run a certain suite N times or something? How did you find the problem?

----------
nosy: +meador.inge

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15632>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 12, 2012, 3:36 PM

Post #3 of 5 (105 views)
Permalink
[issue15632] regrtest.py: spurious leaks with -R option [In reply to]

Stefan Krah added the comment:

I'm attaching a test case. You're right, in test_buffer it's
hard to reproduce but I've encountered the "leak" several times
in the past months.

Today I realized that the "leak" always occurred with format code
'c'. There's this passage in test_buffer:

x = randrange(*fmtdict[mode][char])
if char == 'c':
x = bytes(chr(x), 'latin1')


After some head scratching I looked into regrtest.py and found
the warm_char_cache() function. The whole thing makes sense: In
each repetition of the refleak mode new characters can be added
to the unicode_latin1 cache.


So, you should be able to reproduce the issue:

$ ./python -m test -uall -R 2:2 test_pseudo_leak
[1/1] test_pseudo_leak
beginning 4 repetitions
1234
....
test_pseudo_leak leaked [8, 8] references, sum=16
1 test failed:
test_pseudo_leak
[151225 refs]

----------
Added file: http://bugs.python.org/file26778/test_pseudo_leak.py

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15632>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 14, 2012, 2:19 AM

Post #4 of 5 (105 views)
Permalink
[issue15632] regrtest.py: spurious leaks with -R option [In reply to]

Stefan Krah added the comment:

Should we go all the way and also explicitly fill the small int cache?

Integers 0-255 should be initialized already, but I'm not sure
about [-5..-1] and 256. I haven't been able to create a test case
for integers though.

----------
Added file: http://bugs.python.org/file26798/issue15632.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15632>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 17, 2012, 2:14 PM

Post #5 of 5 (100 views)
Permalink
[issue15632] regrtest.py: spurious leaks with -R option [In reply to]

Roundup Robot added the comment:

New changeset dc18d73e67a5 by Stefan Krah in branch 'default':
Closes #15632: regrtest.py: fix spurious refleaks due to various caches
http://hg.python.org/cpython/rev/dc18d73e67a5

----------
nosy: +python-dev
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15632>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.