libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-28 Thread Anthony Merlino
Hi all, I just found an issue with using libcxx std::thread library on NuttX. The std::thread implementation uses pthread_key_create and pthread_setspecific in order to setup a destructor that should be called to cleanup the memory. Of course, it became pretty obvious what was wrong once I read th

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-28 Thread Gregory Nutt
Hi, Anthony, I just found an issue with using libcxx std::thread library on NuttX. The std::thread implementation uses pthread_key_create and pthread_setspecific in order to setup a destructor that should be called to cleanup the memory. Of course, it became pretty obvious what was wrong once I

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-28 Thread Anthony Merlino
Greg, Would userpace_s need to have an additional function pointer for pthread_cleanup? Similar to pthread_startup? Is the up_pthread_start/pthread_startup functions a good example to follow for how to call in user mode? Anthony On Sun, Jun 28, 2020 at 1:39 PM Gregory Nutt wrote: > Hi, Antho

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-28 Thread Gregory Nutt
Would userpace_s need to have an additional function pointer for pthread_cleanup? Similar to pthread_startup? Is the up_pthread_start/pthread_startup functions a good example to follow for how to call in user mode? If you look at Issue 1263, that is not what I am proposing: https://github.c

Re: libcxx std::thread leaks 48 bytes due to missing implementation of pthread destructor

2020-06-28 Thread Gregory Nutt
... one objective that I have is to move all of the pthread logic out of the kernel and into libs/libs/pthread.  The pthreads interfaces are not part of the kernel in other Unix-like implementations. The kernel does provide certain necessary hooks, but the majority of the implementation of t

Re: bug report

2020-06-28 Thread Brennan Ashton
Kwonsk, Thanks for reporting this, it looks like you are correct and I have opened a PR against this here https://github.com/apache/incubator-nuttx/pull/1316 If you are able to test it that would be great. We can also make sure this gets into the 9.1 release. --Brennan On Wed, Jun 24, 2020, 1:02