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

2021-12-06 Thread Robert Elz
Date:Mon, 6 Dec 2021 17:05:38 +0100 From:Anthony Mallet Message-ID: <25006.13522.25953.845...@gargle.gargle.howl> | (BTW, in case someone did not notice, there is lib/56531) Yes, I saw it go past, that was the "proposed correction" I referred to, though, while that

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

2021-12-06 Thread Anthony Mallet
On Monday 6 Dec 2021, at 21:40, Robert Elz wrote: > I know this thread is largely dead by now I still read it with interest :) (BTW, in case someone did not notice, there is lib/56531)

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

2021-12-06 Thread Robert Elz
Date:Mon, 29 Nov 2021 17:18:07 +0100 From:Joerg Sonnenberger Message-ID: | On Mon, Nov 29, 2021 at 08:38:35PM +0700, Robert Elz wrote: | > DNS queries (via UDP) are limited to max 512, as that is what the | > protocol always required, so can be handled by every

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

2021-12-04 Thread Havard Eidnes
>> > |> DNS queries (via UDP) are limited to max 512, as that is what the >> > |> protocol always required, so can be handled by everything (or should >> > be). >> >> That disregards EDNS0, which in the DNS "in general" is pretty >> much universally supported these days. After all, it's nearly

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

2021-12-04 Thread Martin Husemann
On Sat, Dec 04, 2021 at 11:20:26AM +0100, Havard Eidnes wrote: > > Joerg Sonnenberger wrote in > > : > > |On Mon, Nov 29, 2021 at 08:38:35PM +0700, Robert Elz wrote: > > |> DNS queries (via UDP) are limited to max 512, as that is what the > > |> protocol always required, so can be handled by ev

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

2021-12-04 Thread Havard Eidnes
> Joerg Sonnenberger wrote in > : > |On Mon, Nov 29, 2021 at 08:38:35PM +0700, Robert Elz wrote: > |> DNS queries (via UDP) are limited to max 512, as that is what the > |> protocol always required, so can be handled by everything (or should be). That disregards EDNS0, which in the DNS "in gen

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

2021-11-30 Thread Paul Ripke
On Mon, Nov 29, 2021 at 07:49:26PM -0500, Matthew Mondor wrote: > On Mon, 29 Nov 2021 00:05:18 +0100 > Anthony Mallet wrote: > > > > Why should there be any particular minimum? It seems to me it > > > depends on what the thread is doing (though one page, whatever that > > > is on the hardware an

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

2021-11-29 Thread Matthew Mondor
On Mon, 29 Nov 2021 00:05:18 +0100 Anthony Mallet wrote: > > Why should there be any particular minimum? It seems to me it > > depends on what the thread is doing (though one page, whatever that > > is on the hardware and release in question, is probably a pretty > > hard minimum). > > That's

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

2021-11-29 Thread Steffen Nurpmeso
Mouse wrote in <202111292115.qaa06...@stone.rodents-montreal.org>: |> * The maximum is 65000. | |It probably is actually 65535, or 65495, or some such; if there is a |limit that is actually 65000, it strikes me as unlikely to be anything |but someone imposing an artificial round-human

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

2021-11-29 Thread Mouse
> * The maximum is 65000. It probably is actually 65535, or 65495, or some such; if there is a limit that is actually 65000, it strikes me as unlikely to be anything but someone imposing an artificial round-human-number limit. /~\ The ASCII Mouse \ / Ribbon Cam

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

2021-11-29 Thread Steffen Nurpmeso
Joerg Sonnenberger wrote in : |On Mon, Nov 29, 2021 at 06:31:30PM +0100, Steffen Nurpmeso wrote: |> Joerg Sonnenberger wrote in |> : |>|On Mon, Nov 29, 2021 at 08:38:35PM +0700, Robert Elz wrote: |>|> DNS queries (via UDP) are limited to max 512, as that is what the |>|> protocol always req

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

2021-11-29 Thread Joerg Sonnenberger
On Mon, Nov 29, 2021 at 06:31:30PM +0100, Steffen Nurpmeso wrote: > Joerg Sonnenberger wrote in > : > |On Mon, Nov 29, 2021 at 08:38:35PM +0700, Robert Elz wrote: > |> DNS queries (via UDP) are limited to max 512, as that is what the > |> protocol always required, so can be handled by everythin

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

2021-11-29 Thread Steffen Nurpmeso
Joerg Sonnenberger wrote in : |On Mon, Nov 29, 2021 at 08:38:35PM +0700, Robert Elz wrote: |> DNS queries (via UDP) are limited to max 512, as that is what the |> protocol always required, so can be handled by everything (or should be). | |Strictly speaking, it is the minimum MTU every IPv4 i

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

2021-11-29 Thread Steffen Nurpmeso
Steffen Nurpmeso wrote in <20211129173130.b55ba%stef...@sdaoden.eu>: |Joerg Sonnenberger wrote in | : ||On Mon, Nov 29, 2021 at 08:38:35PM +0700, Robert Elz wrote: ||> DNS queries (via UDP) are limited to max 512, as that is what the ||> protocol always required, so can be handled by everythi

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

2021-11-29 Thread Joerg Sonnenberger
On Mon, Nov 29, 2021 at 08:38:35PM +0700, Robert Elz wrote: > DNS queries (via UDP) are limited to max 512, as that is what the > protocol always required, so can be handled by everything (or should be). Strictly speaking, it is the minimum MTU every IPv4 implementation is supposed to allow. IPv6

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

2021-11-29 Thread Anthony Mallet
On Monday 29 Nov 2021, at 20:38, Robert Elz wrote: > | In addition, I just noticed that res_nquery(3) in > | libc/resolv/res_query.c uses a similar buffer but of size > | min(PACKETSZ, 1024). PACKETSZ seems to be 512 bytes only. > > That is as it shoukd be. > PR tge huge stack array if yiu wa

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

2021-11-29 Thread Robert Elz
Date:Mon, 29 Nov 2021 12:25:24 +0100 From:Anthony Mallet Message-ID: <24996.47268.358308.412...@gargle.gargle.howl> | In addition, I just noticed that res_nquery(3) in | libc/resolv/res_query.c uses a similar buffer but of size | min(PACKETSZ, 1024). PACKETSZ se

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

2021-11-29 Thread Anthony Mallet
On Monday 29 Nov 2021, at 00:05, Anthony Mallet wrote: > 64k is not small, so I still believe it should be on the heap. In addition, I just noticed that res_nquery(3) in libc/resolv/res_query.c uses a similar buffer but of size min(PACKETSZ, 1024). PACKETSZ seems to be 512 bytes only. So it seems

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 .

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

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