From 6374b73ce66bb30f2f74ba7b71082fc71b7d3d83 Mon Sep 17 00:00:00 2001 From: Peter Hawkins Date: Thu, 8 Jun 2023 13:21:43 -0700 Subject: [PATCH] [XLA:Python] Fix crash when accessing locals of JAX-generated Python tracebacks. Use a dummy PyCodeObject in our dummy PyFrameObjects. Using a real PyCodeObject with a fake PyFrameObject confuses CPython 3.11+ when it attempts to compute the locals of a frame, since the frame lacks certain details such as closure information. This unfortunately means we will not get source column information under Python 3.11 any more, but that is probably better than crashing. Fixes https://github.com/google/jax/issues/16027 PiperOrigin-RevId: 538873850 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 859416428..21bd2ad83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ Remember to align the itemized text with the first line of an item within a list * Bug fixes * Fixes incorrect source line information in JAX-generated Python tracebacks under Python 3.11. + * Fixes crash when printing local variables of frames in JAX-generated Python + tracebacks (#16027). ## jax 0.4.11 (May 31, 2023)