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
$ docker run -v $PWD:/vol -it --rm ghcr.io/facebookincubator/cinder-runtime:cinder-3.8 -X jit -m compiler --static vol/cinder_typed_prim_bug.py
Traceback (most recent call last):
File "/cinder/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/cinder/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/cinder/lib/python3.8/compiler/__main__.py", line 122, in <module>
exec(codeobj, d, d)
File "vol/cinder_typed_prim_bug.py", line 15, in __main__
main()
File "vol/cinder_typed_prim_bug.py", line 10, in main
c += foo(.4, .97)
TypeError: unsupported operand type(s) for +=: 'float' and 'function'
The compiler is acting as if the written code were c += foo rather than c += foo(.4, .97).
The problem goes away by removing -X jit, --static, or use of the double primitives.
In a more complete program than this simple repro, I've seen it manifest more severely, namely a SIGSEGV. Fixing the primitive typing on c fixed that program as well. (I'm not sure how to have docker run show the trace, otherwise I'd share it.)
The explicit c: double should be required, we don't auto box or unbox within static code (only at function call boundaries between static and non-static code). But clearly there's a bug in the compiler on the way to delivering that error. Thanks for the report!
good (no options):
bad (
-X jit -m compile --static
):The compiler is acting as if the written code were
c += foo
rather thanc += foo(.4, .97)
.The problem goes away by removing
-X jit
,--static
, or use of thedouble
primitives.cinder_typed_prim_bug.py
seen in cinder-3.8.6c2de94
The text was updated successfully, but these errors were encountered: