#881581 python3-pyqt5: PyQt5 Leaks memory on dereference of QStyleOptionTab

Package:
python3-pyqt5
Source:
pyqt5
Description:
Python 3 bindings for Qt5
Submitter:
Jay Kamat
Date:
2017-11-18 20:09:03 UTC
Severity:
normal
#881581#5
Date:
2017-11-13 06:24:29 UTC
From:
To:
Dear Maintainer,


The version of PyQt5 in the Debian stretch archives seems to leak memory on
deference of a QStyleOptionTab.

I have created a simple python file to reproduce the issue:

		import resource
		from PyQt5.QtWidgets import QStyleOptionTab
		import tracemalloc

		before = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
		print(before)

		opt = QStyleOptionTab()

		for i in range(10000000):
			a = opt.rect

		after = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
		print(after)

		if after > before + 10000:
			print("you seem to be leaking memory?")
		else:
			print("you're probably fine...")

On a normal system, this snippet should print "you're probably fine...",
but on debian stable it prints "you seem to be leaking memory?".

This issue also affects fedora25.

Is it possible that a patch could be prepared for this, or is it too
late for that in stable now? I think this has been fixed in testing, but
I have not verified it.

Here is the original issue where I found and debugged the problem:
https://github.com/qutebrowser/qutebrowser/issues/3280

This currently affects:

- Debian Stable
- Ubuntu zesty
- Fedora 25

And curiously, the 5.7.1 PyQt5 on pypi does not suffer from this.

Please let me know if you need any additional information.

#881581#10
Date:
2017-11-18 20:05:39 UTC
From:
To:
Hi Jay,

It would be nice to know which upstream change fixes this problem.

I checked the diff between 5.7 and 5.7.1 tarballs and could not find
anything related to QStyleOptionTab or mentioning memory leaks.

Unfortunately I do not have time to dig deeper.