Re: [RFC PATCH glibc v2 26/34] hurd: Remove __hurd_local_reply_port

2023-04-15 Thread Samuel Thibault
Sergey Bugaev, le sam. 15 avril 2023 10:34:46 +0300, a ecrit: > If you really want to deallocate and reset the current reply port, you > need to do the dance like sigreturn does: > > mach_port_t reply_port = THREAD_GETMEM (THREAD_SELF, reply_port); > THREAD_SETMEM (THREAD_SELF, MACH_PORT_DEAD); >

Re: [RFC PATCH glibc v2 26/34] hurd: Remove __hurd_local_reply_port

2023-04-15 Thread Sergey Bugaev
On Sat, Apr 15, 2023 at 9:45 AM Samuel Thibault wrote: > Sergey Bugaev, le ven. 14 avril 2023 23:29:51 +0300, a ecrit: > > By the way: that __mig_dealloc_reply_port () inside > > _dl_sysdep_start_cleanup () is not doing what the author of that code > > wanted it to do. It deallocates the current r

Re: [RFC PATCH glibc v2 26/34] hurd: Remove __hurd_local_reply_port

2023-04-14 Thread Samuel Thibault
Hello, Sergey Bugaev, le ven. 14 avril 2023 23:29:51 +0300, a ecrit: > On Fri, Apr 14, 2023 at 8:33 PM Samuel Thibault > wrote: > > Applied with fixing the __mig_dealloc_reply_port(NULL) cases, thanks! > > By the way: that __mig_dealloc_reply_port () inside > _dl_sysdep_start_cleanup () is not

Re: [RFC PATCH glibc v2 26/34] hurd: Remove __hurd_local_reply_port

2023-04-14 Thread Sergey Bugaev
On Fri, Apr 14, 2023 at 8:33 PM Samuel Thibault wrote: > Applied with fixing the __mig_dealloc_reply_port(NULL) cases, thanks! By the way: that __mig_dealloc_reply_port () inside _dl_sysdep_start_cleanup () is not doing what the author of that code wanted it to do. It deallocates the current repl

Re: [RFC PATCH glibc v2 26/34] hurd: Remove __hurd_local_reply_port

2023-04-14 Thread Samuel Thibault
Applied with fixing the __mig_dealloc_reply_port(NULL) cases, thanks! Sergey Bugaev, le jeu. 13 avril 2023 14:58:12 +0300, a ecrit: > Now that the signal code no longer accesses it, the only real user of it > was mig-reply.c, so move the logic for managing the port there. > > If we're in SHARED a

Re: [RFC PATCH glibc v2 26/34] hurd: Remove __hurd_local_reply_port

2023-04-13 Thread Samuel Thibault
Hello, Sergey Bugaev, le jeu. 13 avril 2023 16:20:50 +0300, a ecrit: > On Thu, Apr 13, 2023 at 4:12 PM Samuel Thibault > wrote: > at ../sysdeps/mach/hurd/dl-sysdep.c:241 > > 241 __mig_dealloc_reply_port (MACH_PORT_NULL); > > Uhh, who deallocs a reply port like that :| You can't pass r

Re: [RFC PATCH glibc v2 26/34] hurd: Remove __hurd_local_reply_port

2023-04-13 Thread Sergey Bugaev
On Thu, Apr 13, 2023 at 4:12 PM Samuel Thibault wrote: at ../sysdeps/mach/hurd/dl-sysdep.c:241 > 241 __mig_dealloc_reply_port (MACH_PORT_NULL); Uhh, who deallocs a reply port like that :| You can't pass random crap into __mig_dealloc_reply_port and rely on its particular implementation,

Re: [RFC PATCH glibc v2 26/34] hurd: Remove __hurd_local_reply_port

2023-04-13 Thread Samuel Thibault
Sergey Bugaev, le jeu. 13 avril 2023 14:58:12 +0300, a ecrit: > NOTE: Completely untested! Do your own testing! You have been warned! Doesn't work :) (gdb) bt #0 0x08000db3 in abort () at ../sysdeps/mach/hurd/dl-sysdep.c:753 #1 0x0802328a in __mig_dealloc_reply_port (arg=) at ../sysdeps/ma

[RFC PATCH glibc v2 26/34] hurd: Remove __hurd_local_reply_port

2023-04-13 Thread Sergey Bugaev
Now that the signal code no longer accesses it, the only real user of it was mig-reply.c, so move the logic for managing the port there. If we're in SHARED and outside of rtld, we know that __LIBC_NO_TLS () always evaluates to 0, and a TLS reply port will always be used, not __hurd_reply_port0. St