You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Possible integer overflow when call PyDTrace_GC_DONE() #76986
PyDTrace_GC_DONE() accepts the argument of type int. But it is called with the sum of collected and uncollectable objects which has type Py_ssize_t and can be larger that maximal int.
This produces a compiler warning on Windows:
..\Modules\gcmodule.c(978): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\buildarea\3.x.bolen-windows10\build\PCbuild\pythoncore.vcxproj]
Activity
serhiy-storchaka commentedon Feb 9, 2018
PyDTrace_GC_DONE() accepts the argument of type int. But it is called with the sum of collected and uncollectable objects which has type Py_ssize_t and can be larger that maximal int.
This produces a compiler warning on Windows:
..\Modules\gcmodule.c(978): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\buildarea\3.x.bolen-windows10\build\PCbuild\pythoncore.vcxproj]
and looks as not false alarm.
serhiy-storchaka commentedon Mar 15, 2018
DTrace support was implemented in bpo-21590 (changeset a785c87).
vstinner commentedon Mar 6, 2019
The warning in the C code has been fixed by:
New changeset edad38e by Victor Stinner (Jeremy Kloth) in branch 'master':
bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)
edad38e
The remaining question is if Include/pydtrace.d must be updated or not:
#11010 (comment)
vstinner commentedon Mar 6, 2019
I don't think that Python 3.7 should be modified. I prefer to avoid any risk and only modify Python 3.8.