On Fri, Apr 14, 2023 at 8:33 PM Samuel Thibault <samuel.thiba...@gnu.org> 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 reply port, but while doing that, it creates a fresh one in its place. So we just waste an RPC (and a syscall). We should just not do that. It would be nice to not deallocate __mach_{task,host}_self_ too, and instead migrate them into the new libc.so slots. Again, we'd save some RPCs and syscalls without really losing anything. Besides, are we 100% sure that after initially entering libc.so, ld.so will never do any Mach things (RPCs) anymore? We override __open & friends, but it might still be using some smaller Mach things, no? If yes, imagine what would happen when it keeps using its __mach_{task,host}_self_, which it has deallocated, but not even reset to MACH_PORT_NULL. Sergey