8000 _thread.start_new_thread fails to return to main, on start if arg list is missing · Issue #158 · pycom/pycom-micropython-sigfox · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

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

Closed
gregcope opened this issue Apr 18, 2018 · 3 comments

Comments

@gregcope
Copy link

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.

@gregcope
Copy link
Author

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) {

@Sympatron
Copy link

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?

@gregcope
Copy link
Author
gregcope commented May 4, 2018

Will need to check versions...

@gregcope gregcope closed this as completed Nov 5, 2018
peter-pycom pushed a commit that referenced this issue Jul 9, 2020
[pybytes] updated to v1.5.2 (pymesh BR fix)
X-Ryl669 pushed a commit to X-Ryl669/pycom-micropython-sigfox that referenced this issue May 12, 2023
[pybytes] updated to v1.5.2 (pymesh BR fix)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0