On Fri, Aug 11, 2023 at 11:51 AM Chandrasekhar R <craman2...@gmail.com> wrote: > > I am planning on using a pam module written in Go (specifically > https://github.com/uber/pam-ussh) . When I run a script which calls sudo > continuously with an echo command, I am noticing zombie/defunct processes > starting to pop up. > > On doing strace, I noticed that the SIGCHLD gets delivered to one of the > threads created when Go gets initialized (i.e. the shared object gets loaded). > > I tried to add one level of indirection by having a separate C code which > creates a new thread, sets the signal mask to block SIGCHLD and then use > dlopen to open the shared object created using cgo. I am still facing the > same issue, is there any pointer on how to fix this issue? I think this would > be a wide issue across all PAM modules written using cgo.
As far as I know the specific thread that receives a SIGCHLD signal is fairly random. What matters is not the thread that receives the signal, but the signal handler that is installed. Signal handlers are process-wide. What signal handler is running when you get a SIGCHLD? What signal handler do you expect to run? Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVEwqeoRZ9LLvErxC0rkFcRa9UUYbHSFawDoc%3DuhmTsRA%40mail.gmail.com.