[eio] getaddrinfo / pthread stacksize?
ry at tinyclouds.org
Tue Apr 21 23:02:31 CEST 2009
As you suggested I'm using getaddrinfo with libeio for dns lookups.
I'm calling it through eio_custom but getting a SIGSEGV. The problem
appears to be related to the stacksize. When I remove the line
pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN < sizeof (long) * 4096
? sizeof (long) * 4096 : PTHREAD_STACK_MIN);
in xthread.h it works properly. I run Linux 2.6.24 and gcc version 4.2.4.
My eio_custom call is not fancy. Pasted below for reference.
Resolve (eio_req *req)
Socket *socket = static_cast<Socket*> (req->data);
struct addrinfo *address = NULL;
printf("trying to resolve %s:%s \n", socket->host_, socket->port_);
req->result = getaddrinfo(socket->host_, socket->port_, &tcp_hints, &address);
req->ptr2 = address;
socket->host_ = NULL;
socket->port_ = NULL;
eio_req *req = eio_custom (Resolve, EIO_PRI_DEFAULT,
More information about the libev