[ruby-core:123768] [Ruby Bug#21679] Segfault when ruby calls pthread_detach in rb_getnameinfo
Issue #21679 has been reported by luke-gru (Luke Gruber). ---------------------------------------- Bug #21679: Segfault when ruby calls pthread_detach in rb_getnameinfo https://bugs.ruby-lang.org/issues/21679 * Author: luke-gru (Luke Gruber) * Status: Open * ruby -v: 3.4.7 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- We're seeing an issue on our servers running ruby 3.4.7 where we get a SEGV after ruby calls `pthread_detach` on a short-lived pthread that calls `getaddrinfo`. I believe it's related to this glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19951. Our servers are using glibc version 2.39, which is from January 2024. This bug hasn't been fixed in glibc yet but I haven't been able to reproduce it on my Linux desktop. Regardless, there's a simple workaround for it that avoids calling `pthread_detach` on the thread. My PR is here: https://github.com/ruby/ruby/pull/15142. Thanks, Luke -- https://bugs.ruby-lang.org/
Issue #21679 has been updated by luke-gru (Luke Gruber). I believe we were getting segfaults because this commit is also not on the 3_4 branch: https://github.com/ruby/ruby/pull/14277/commits/c42ecaeb0489a7e9fc8b245982ee.... Our DNS lookups were so fast and racing with the shutdown of the thread, and glibc is buggy. I believe this commit should also be backported. ---------------------------------------- Bug #21679: Segfault when ruby calls pthread_detach in rb_getnameinfo https://bugs.ruby-lang.org/issues/21679#change-115195 * Author: luke-gru (Luke Gruber) * Status: Closed * ruby -v: 4.0.0dev * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED ---------------------------------------- We're seeing an issue on our servers running ruby 3.4.7 where we get a SEGV after ruby calls `pthread_detach` on a short-lived pthread that calls `getaddrinfo`. I believe it's related to this glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19951. Our servers are using glibc version 2.39, which is from January 2024. This bug hasn't been fixed in glibc yet but I haven't been able to reproduce it on my Linux desktop. Regardless, there's a simple workaround for it that avoids calling `pthread_detach` on the thread. My PR is here: https://github.com/ruby/ruby/pull/15142. Thanks, Luke -- https://bugs.ruby-lang.org/
Issue #21679 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED to 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE ruby_3_4 commit:7482835d0b5c9f55662fb7c6586f456354e2b66e. ---------------------------------------- Bug #21679: Segfault when ruby calls pthread_detach in rb_getnameinfo https://bugs.ruby-lang.org/issues/21679#change-115495 * Author: luke-gru (Luke Gruber) * Status: Closed * ruby -v: 4.0.0dev * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE ---------------------------------------- We're seeing an issue on our servers running ruby 3.4.7 where we get a SEGV after ruby calls `pthread_detach` on a short-lived pthread that calls `getaddrinfo`. I believe it's related to this glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19951. Our servers are using glibc version 2.39, which is from January 2024. This bug hasn't been fixed in glibc yet but I haven't been able to reproduce it on my Linux desktop. Regardless, there's a simple workaround for it that avoids calling `pthread_detach` on the thread. My PR is here: https://github.com/ruby/ruby/pull/15142. Thanks, Luke -- https://bugs.ruby-lang.org/
participants (2)
-
k0kubun (Takashi Kokubun) -
luke-gru (Luke Gruber)