Re: pthread_main_np(3) randomly fails

2023-12-08 Thread Miod Vallat
> Should the tib_tid also be initialized? I don't think so, it is initialized outside of the TIB_INIT macro. See e.g. setup_static_tib().

Re: pthread_main_np(3) randomly fails

2023-12-08 Thread Theo Buehler
On Fri, Dec 08, 2023 at 03:25:21PM +, Miod Vallat wrote: > How about that diff. Should the tib_tid also be initialized? > > Index: include/tib.h > === > RCS file: /OpenBSD/src/include/tib.h,v > retrieving revision 1.9 > diff -u

Re: pthread_main_np(3) randomly fails

2023-12-08 Thread Kurt Miller
On Dec 8, 2023, at 10:25 AM, Miod Vallat wrote: > > How about that diff. > Tested on amd64 and it does indeed fix the problem. This is clearly the cause. okay kurt@ > Index: include/tib.h > === > RCS file:

Re: pthread_main_np(3) randomly fails

2023-12-08 Thread Miod Vallat
How about that diff. Index: include/tib.h === RCS file: /OpenBSD/src/include/tib.h,v retrieving revision 1.9 diff -u -p -r1.9 tib.h --- include/tib.h 27 Dec 2022 07:44:56 - 1.9 +++ include/tib.h 8 Dec 2023

pthread_main_np(3) randomly fails

2023-12-08 Thread Kurt Miller
While hunting for why the jdk's stack overflow execptions were randomly not working, I determined the root cause was that pthread_main_np(3) randomly fails to work properly. Reproduced on sparc64, amd64, and aarch64. On i386 the standalone test program doesn't reproduce the problem. However, I