Bug 1540316
Summary: | python2: Source code implies 16-byte alignment for PyObject_GC_New allocator, provides only 8 | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Florian Weimer <fweimer> |
Component: | python2 | Assignee: | Petr Viktorin (pviktori) <pviktori> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | bkabrda, cstratak, dmalcolm, mcyprian, mhroncok, pviktori, rkuska, tomspur, torsava |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-02-15 15:03:58 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1537244, 1537255 |
Description
Florian Weimer
2018-01-30 18:41:06 UTC
Raised on python-dev: https://mail.python.org/pipermail/python-dev/2018-January/152000.html This has been around since 3.4: https://github.com/python/cpython/commit/e348c8d154cf6342c79d627ebfe89dfe9de23817 I wonder how dangerous would it be to backport it. Will try to in a scratch build anyway. https://koji.fedoraproject.org/koji/taskinfo?taskID=24578130 with the above patch applied. (In reply to Miro Hrončok from comment #2) > This has been around since 3.4: > > https://github.com/python/cpython/commit/ > e348c8d154cf6342c79d627ebfe89dfe9de23817 > > I wonder how dangerous would it be to backport it. Will try to in a scratch > build anyway. The patch is definitely a bit on the scary side. You could perhaps add additional padding to PyGC_Head to keep its size unchanged. But I looked on codesearch.debian.net and couldn't find any external extensions using GC tracking, but perhaps I didn't search thoroughly enough. $ abipkgdiff --debug-info-pkg1 ./python2-debuginfo-2.7.14-8.fc28.x86_64.rpm --debug-info-pkg2 ./python2-debuginfo-2.7.14-9.fc28.x86_64.rpm --devel-pkg1 ./python2-devel-2.7.14-8.fc28.x86_64.rpm --devel-pkg2 ./python2-devel-2.7.14-9.fc28.x86_64.rpm ./python2-libs-2.7.14-8.fc28.x86_64.rpm ./python2-libs-2.7.14-9.fc28.x86_64.rpm ================ changes of 'libpython2.7.so.1.0'=============== Functions changes summary: 0 Removed, 1 Changed, 0 Added function Variables changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added variable 1 function with some indirect sub-type change: [C]'function void _PyGC_Dump(PyGC_Head*)' at gcmodule.c:1523:1 has some indirect sub-type changes: parameter 1 of type 'PyGC_Head*' has sub-type changes: in pointed to type 'typedef PyGC_Head' at objimpl.h:259:1: underlying type 'union _gc_head' at objimpl.h:252:1 changed: type size changed from 256 to 192 bits 1 data member changes (1 filtered): type of 'long double _gc_head::dummy' changed: type name changed from 'long double' to 'double' type size changed from 128 to 64 bits ================ end of changes of 'libpython2.7.so.1.0'=============== (In reply to Florian Weimer from comment #4) > (In reply to Miro Hrončok from comment #2) > > This has been around since 3.4: > > > > https://github.com/python/cpython/commit/ > > e348c8d154cf6342c79d627ebfe89dfe9de23817 > > > > I wonder how dangerous would it be to backport it. Will try to in a scratch > > build anyway. > > The patch is definitely a bit on the scary side. You could perhaps add > additional padding to PyGC_Head to keep its size unchanged. See: https://mail.python.org/pipermail/python-dev/2018-January/152011.html Thank you! Scratch build in progress: https://koji.fedoraproject.org/koji/taskinfo?taskID=24592559 Built. Thanks again for the patch, Florian! It saved us a lot of head-scratching. If you want I can take care of pushing the patch upstream. Two things I'd need to do that properly, though: - could you sign PSF's old-school contributor agreement (which confirms your contributions are open-source): https://www.python.org/psf/contrib/contrib-form/ - and fill in your GitHub username on bugs.python.org -- that's used in some automated checks. (In reply to Petr Viktorin from comment #8) > Built. > Thanks again for the patch, Florian! It saved us a lot of head-scratching. Do you know if this is the direction upstream wants to follow? The discussion was more favorable to changing the allocator parameters. Not sure. I'll let you know if upstream wants to use your patch. |