Open
Description
Bug report
Bug description:
>>> def F(a,b):
... x=a*b
... frame = inspect.currentframe()
... print(frame.__sizeof__())
... return x
...
>>> F(1,2)
184
>>> F.__code__ = F.__code__.replace(co_stacksize=1000)
>>> F(1,2)
8152
>>> F.__code__ = F.__code__.replace(co_stacksize=2147483646)
>>> F(1,2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: ../Modules/gcmodule.c:2313: bad argument to internal function
It happens due to overflow in frame_sizeof
CPython versions tested on:
3.11
Operating systems tested on:
Linux