[Bug network/10652] getaddrinfo causes segfault if multithreaded and linked statically

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug network/10652] getaddrinfo causes segfault if multithreaded and linked statically

Sourceware - glibc-bugs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=10652

Alexey Izbyshev <izbyshev at ispras dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |izbyshev at ispras dot ru

--- Comment #29 from Alexey Izbyshev <izbyshev at ispras dot ru> ---
Still occurs with 2.31 in the same place as in the previous comment. Note that
heavy multithreading is not required, the following crashes too:

#include <netdb.h>
#include <pthread.h>

void *run(void *arg) {
  gethostbyname("localhost");
  return NULL;
}

int main() {
    gethostbyname("localhost");
    pthread_t t;
    pthread_create(&t, NULL, run, NULL);
    pthread_join(t, NULL);
    return 0;
}

The crash goes away if any of gethostbyname() calls is removed.

--
You are receiving this mail because:
You are on the CC list for the bug.