pyston / pyston

(No longer maintained) A faster and highly-compatible implementation of the Python programming language.
https://www.pyston.org/
Other
2.5k stars 91 forks source link

Recursive call in 'traceback' module crashes pyston #291

Open xiaxinmeng opened 1 year ago

xiaxinmeng commented 1 year ago

If we call the function traceback.print_exc() to print exception information in a recursive function. Pyston crashes with a segmentation fault. See the following example.

test.py

import traceback

def foo():
    traceback.print_exc()
    foo() 
foo()

Behavior on Pyston ( [Pyston 2.3.5, GCC 9.4.0] on linux)

NoneType: None
NoneType: None
NoneType: None
NoneType: None
NoneType: None
NoneType: None
NoneType: None
Segmentation fault (core dumped)

Test Environment: Pyston: Python 3.8.12 (remotes/origin/release_2.3.5:4b858b5062, Sep 25 2022, 18:56:33) [Pyston 2.3.5, GCC 9.4.0] on linux Operating System: Ubuntu 18.04

kmod commented 1 year ago

Thanks for the report! It looks like this script also crashes cpython, but in a slightly different way so it's worth investigating.