Samsung / libtuv

Asynchronous I/O for IoT.js and embedded system
Apache License 2.0
128 stars 76 forks source link

Assertion in uv__handle_stop #143

Closed lightbulbkhuang closed 3 years ago

lightbulbkhuang commented 3 years ago

Hello,

I found an assertion failure when trying to stop UV handle by using uv__handle_stop in src/uv-common.h

The running flow is:

  1. Because handle->flags is set to UV_CLOSING at uv_close function in src/unix/core.c.
  2. The statement assert(((h)->flags & UV__HANDLE_CLOSING) == 0); will failed when invoking uv__handle_stop later.

It seems the assertion should not be used here. Maybe I have some misunderstanding of the code, would you help check it? Thank you very much.