stack overflow in getaddrinfo(3) with a small-sized stack in pthreads

2021-11-28 Thread Anthony Mallet
Hi, I have a multi-threaded program that segfault in getaddrinfo(3). To make a long story short, this is the backtrace from gdb: Thread 3 "" received signal SIGSEGV, Segmentation fault. [Switching to LWP 14939 of process 14113] 0x7f7ff5d3af50 in res_queryN ( name=name@entry=0x7f7ff7e55cb0

Re: stack overflow in getaddrinfo(3) with a small-sized stack in pthreads

2021-11-28 Thread Mouse
> #define MAXPACKET(64*1024) > I think it's related to a DNS query, so it might be the max size of a > UDP packet? (then why not 65kB?) Because the max UDP packet size is 64k (well, 64k-1 - the length field is 16 bits long). The only places I see 65k are from people who confuse sto

Re: stack overflow in getaddrinfo(3) with a small-sized stack in pthreads

2021-11-28 Thread Anthony Mallet
On Sunday 28 Nov 2021, at 17:30, Mouse wrote: > > I think it's related to a DNS query, so it might be the max size of a > > UDP packet? (then why not 65kB?) > > Because the max UDP packet size is 64k (well, 64k-1 - the length field > is 16 bits long). Yes, of course. I was temporarily confused .