[Asterisk-bsd] Stack size in pthreads
Wolfgang S. Rupprecht
asterisk-bsd@lists.digium.com
20 Jul 2004 09:15:14 -0700
kprokazov@svr.kiev.ua (Konstantin Prokazoff) writes:
> Welcome!
>
> Our patches are ready (.diff), which adds required code for *BSD and do
> nothing for linux.
> Still testing, amount of .diff = about 15 (all channels, applications
> and asterisk core).
> Now, we trying to resolve scheduling problems in *BSD (debug output
> about bad UDP packets).
> I can (will) post .diff's today, which are resolves stack size problem.
> Sorry, I can't test requirements in stack resizing on other *BSDs, can
> anyone check?
> Simplest code are (simple.c):
>
> #include <stdio.h>
> #include <pthread.h>
>
> int main() {
> pthread_attr_t attr;
> size_t stacksize;
> pthread_attr_init(&attr);
> pthread_attr_getstacksize(&attr, &stacksize);
> printf("Default stack size for thread: %u\n", stacksize);
> return 0;
> }
Stacksize on openbsd-current is 64k.
NB: size_t is an unsinged long on the amd64 (and intel clones). This
effects things link printf("%u", stacksize); from above.
I'm seeing asterisk-current dying after printing out the following.
$ asterisk -vvvd
...
== Registered file format g726-32, extension(s) g726-32
== Registered file format g726-24, extension(s) g726-24
== Registered file format g726-16, extension(s) g726-16
[format_ilbc.so] => (Raw iLBC data)
== Registered file format iLBC, extension(s) ilbc
[format_jpeg.so] => (JPEG (Joint Picture Experts Group) Image Format)
== Registered format 'jpg' (JPEG (Joint Picture Experts Group))
[cdr_csv.so] => (Comma Separated Values CDR Backend)
[codec_speex.so]$
I wonder if this is related to the new stack overflows.
-wolfgang
--
Wolfgang S. Rupprecht http://www.wsrcc.com/wolfgang/
openbsd amd64 http://www.wsrcc.com/wolfgang/ftp/asterisk-openbsd35.patch