NordicSemiconductor / nRF-Sniffer-for-802.15.4

nRF-based 802.15.4 sniffer (firmware and software)
Other
221 stars 64 forks source link

start threads as daemons #46

Closed tomaszkob89 closed 3 years ago

tomaszkob89 commented 3 years ago

Sometimes not all threads, started by sniffer, are stopped after executing "stop_sig_handler" which leads to suspended scripts/tests (sniffer threads are still alive after main thread is closed)

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

e-rk commented 3 years ago

Thanks for the submission. I believe that setting the daemon flag is not a proper solution to what you are describing. All threads should exit cleanly when told to do so. Could you provide a stack trace of the thread that refuses to terminate?

tomaszkob89 commented 3 years ago

This issue is not reproducing 100%, I observed it few times while testing locally and one time while running CI suite on Jenkins. For now, I don't have a stack trace, but if my memory serves me right, the thread, that was still alive after .join() was "serial_writer" (but I may be wrong)

tomaszkob89 commented 3 years ago

better solution for my problem in PR: https://github.com/NordicSemiconductor/nRF-Sniffer-for-802.15.4/pull/48