Description
Summary
When using firmware built from the master branch calling _thread.start_new_thread
freezes the whole machine. v1.22.0-preview and earlier works as expected.
Using Raspberry Pi Pico W.
I went back to find the commit where it breaks, and i found the breaking point: bcbdee2
Scenario
Im using a Raspberry Pi Pico W with firmware built from the repository (make etc.) In my application, right at the start of boot.py I started a process on the second thread that constantly measured the orientation, then continued as normal, but yesterday the whole program started freezing.
After some testing I found out that calling _thread.start_new_thread(test_function, ())
freezes the machine, it cannot be stopped with ctrl-c or any other method.
I tested with this file, then importing and running test()
import _thread
def test1():
for i in range(4):
print(f"test1-{i}")
def test2():
for i in range(4):
print(f"test2-{i}")
def test():
print("Main thread:")
test1()
print("In second thread:")
_thread.start_new_thread(test2, ())
print("Main thread again:")
test1()
With 2d363a2 and earlier I get the expected:
Main thread:
test1-0
test1-1
test1-2
test1-3
In second thread:
Main thread again:
test2-0
test1-0
test2-1
test1-1
test2-2
test1-2
test2-3
test1-3
But after bcbdee2 I get:
then freezes completely. Power cycling does make the device responsive again.
Sorry about the format, first time creating an issue.