Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_thread.start_new_thread fails to return to main, on start if arg list is missing #158

gregcope opened this issue Apr 18, 2018 · 3 comments


None yet
2 participants
Copy link

commented Apr 18, 2018

MicroPython v1.8.6-849-83e2f7f on 2018-03-19; GPy with ESP32

  • Exact steps to cause this issue
    Call _thread.start_new_thread with a function that takes no arguments, without supplying an empty list thus;

self.gps_thread = _thread.start_new_thread(self.feedMicroGPS)

It works if I do this;

self.gps_thread = _thread.start_new_thread(self.feedMicroGPS,())

  • What you expected
    Calling a _thread.start_new_thread with a function, which takes no args, should return with new thread ID if called without any args - ie empty list should not be required.

  • What happened instead
    thread starts, but never returns. Main hangs.

If it needs/expects an empty list it should throw an exception or accept no args and return. Not hang main.


This comment has been minimized.

Copy link

commented Apr 18, 2018

Is this the function that needs a tweak;

STATIC mp_obj_t mod_thread_start_new_thread(size_t n_args, const mp_obj_t *args) {


This comment has been minimized.

Copy link

commented May 3, 2018

When I try to call start_new_stread() with just one argument I get the following exception:

TypeError: function missing 1 required positional arguments

Which makes sence since the following line states that at least 2 arguments are expected:

STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_thread_start_new_thread_obj, 2, 3, mod_thread_start_new_thread);

Are you sure you use the latest version?


This comment has been minimized.

Copy link

commented May 4, 2018

Will need to check versions...

@gregcope gregcope closed this Nov 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.