On Wed, Sep 11, 2019 at 09:52:00AM -0400, Rich Felker wrote: > On Wed, Sep 11, 2019 at 01:38:38PM +0000, zhaohang (F) wrote: > > Thank you Rich for your patch. It helps me a lot. > > > > But I find that 'return 0' is used to let child thread exit. In that > > case, a bad thing will happen that the return address of child > > thread maybe undefined, if caller set prio of child unsuccessfully. > > The code in __clone is supposed to perform SYS_exit if the start > function returns; this actually matters for users of the public > clone() function, I think. I found the problem -- when clone.s is built as thumb, mov lr,pc is invalid for saving the return address (it omits the thumb-mode bit). I have a patch I'll push soon, attached. Thanks again for the report! Rich