RustPython icon indicating copy to clipboard operation
RustPython copied to clipboard

Nest call function in threads cause Illegal instruction in Thread

Open xiaxinmeng opened this issue 3 years ago • 0 comments

In the following example, we create multiple thread that nestedly call themselves. Then it causes Illegal instruction of rustpython.

test.py:

class Broken():
  def __init__(self):
    break_it()

def break_it():
  Broken()

from threading import Thread
threads = [Thread(target=break_it) for x in range(100)]
for t in threads: t.start()

Behavior on rustpython(rustpython 0.1.2): Illegal instruction: 4

Expected behavior(behavior on CPython 3.9.1): RecursionError: maximum recursion depth exceeded while calling a Python object

Step to reproduce: type "cargo run --release test.py" on the console of Ubuntu 18.04 and MacOS Big Sur 11.7.1 rust version: rustc 1.65.0

xiaxinmeng avatar Dec 08 '22 06:12 xiaxinmeng