Posted: Tue Jul 20, 2004 2:55 pm Post subject: [Asterisk-bsd] Stack size in pthreads
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;
}
BR,
Oryx.
----- Original Message -----
From: "Olle E. Johansson" <oej@edvina.net>
To: <asterisk-bsd@lists.digium.com>
Sent: Tuesday, July 20, 2004 5:36 PM
Subject: [Asterisk-bsd] Stack size in pthreads
Posted: Tue Jul 20, 2004 3:06 pm Post subject: [Asterisk-bsd] Stack size in pthreads
Welcome everybody!
Stil working under bugtracks 2068, 2089.
With normal stack allocation, there are many different problems with RTP
(UDP). In my case VoicemailMain can't playback digits. ;)
BR,
Oryx
----- Original Message -----
From: "Olle E. Johansson" <oej@edvina.net>
To: <asterisk-bsd@lists.digium.com>
Sent: Tuesday, July 20, 2004 5:36 PM
Subject: [Asterisk-bsd] Stack size in pthreads
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.
Posted: Tue Jul 20, 2004 4:18 pm Post subject: [Asterisk-bsd] Stack size in pthreads
I can test on OpenBSD.
Rich
Quote:
-----Original Message-----
From: asterisk-bsd-admin@lists.digium.com
[mailto:asterisk-bsd-admin@lists.digium.com] On Behalf Of
Konstantin Prokazoff
Sent: Tuesday, July 20, 2004 10:06 AM
To: asterisk-bsd@lists.digium.com
Subject: Re: [Asterisk-bsd] Stack size in pthreads
Welcome everybody!
Stil working under bugtracks 2068, 2089.
With normal stack allocation, there are many different
problems with RTP (UDP). In my case VoicemailMain can't
playback digits. ;)
BR,
Oryx
----- Original Message -----
From: "Olle E. Johansson" <oej@edvina.net>
To: <asterisk-bsd@lists.digium.com>
Sent: Tuesday, July 20, 2004 5:36 PM
Subject: [Asterisk-bsd] Stack size in pthreads
> http://bugs.digium.com/bug_view_page.php?bug_id=0002067
>
> Seems like the default stack size for a native thread in FreeBSD is
> 64k, which is not enough for Asterisk. We need to make it higher.
>
> Questions:
> * In how many places of the source do we need to set the
thread stacksize?
>
> * Is this needed for other BSD:s as well? What about Mac OS/X?
>
> Again, this is beyond my knowledge of programming, so we
need help in
> coming through here. Raising the stack size made my crashes
disappear.
>
> Join me in the bug tracker, now :-)
>
> And thank you Oryx, for a great job in providing us with fixes and
information.
>
> /O
> _______________________________________________
> Asterisk-BSD mailing list
> Asterisk-BSD@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-bsd
>
Stil working under bugtracks 2068, 2089.
With normal stack allocation, there are many different problems with RTP
(UDP). In my case VoicemailMain can't playback digits. ;)
This seems to be a reoccurring problem with asterisk. Just ignore the
hundreds of EAGAIN errors asterisk gets. You can grab the parts you
want from my patches for openbsd. (Just repeatedly search for
EAGAIN.)
Posted: Tue Jul 20, 2004 5:37 pm Post subject: [Asterisk-bsd] Stack size in pthreads
Welcome!
EAGAIN error in *BSD distribution (I think) reliable to:
1. Invalid timestamp calc./scheduling time/different sheduling in *BSD.
2. Packets aren't loss. They are passthrough by cache in *BSD.
Why it works under linux platforms, and takes too much attention in *BSD?
Still working.
;)
BR,
Oryx.
----- Original Message -----
From: "Wolfgang S. Rupprecht" <list+asterisk-bsd@lists.wsrcc.com>
To: <asterisk-bsd@lists.digium.com>
Sent: Tuesday, July 20, 2004 7:20 PM
Subject: Re: [Asterisk-bsd] Stack size in pthreads
Quote:
kprokazov@svr.kiev.ua (Konstantin Prokazoff) writes:
> Welcome everybody!
>
> Stil working under bugtracks 2068, 2089.
> With normal stack allocation, there are many different problems with
RTP
Quote:
> (UDP). In my case VoicemailMain can't playback digits. ;)
This seems to be a reoccurring problem with asterisk. Just ignore the
hundreds of EAGAIN errors asterisk gets. You can grab the parts you
want from my patches for openbsd. (Just repeatedly search for
EAGAIN.)
EAGAIN error in *BSD distribution (I think) reliable to:
1. Invalid timestamp calc./scheduling time/different sheduling in *BSD.
2. Packets aren't loss. They are passthrough by cache in *BSD.
Why it works under linux platforms, and takes too much attention in *BSD?
Still working.
The EAGAIN shouldn't really be generated by the BSD kernel either. It
is only something that the kernel passes up the user as a last resort
when it can't sleep waiting for more data (because the user won't
allow it), and it has no data to pass to the user.
There was some confusion about linux udp checksum code where linux
also makes use of the EAGAIN bail-out to return to userland when it
has no packets for the user and the user has requested that system
calls don't sleep. Someone thought that they could test for UDP
checksum errors that way.
Posted: Wed Jul 21, 2004 9:09 am Post subject: [Asterisk-bsd] Stack size in pthreads
Yes, on linux default stack size is about 2M (LinuxThreads-0.9), in win32 it
takes 1M. On FreeBSD 64k. ;)
----- Original Message -----
From: "Chris Stenton" <jacs@gnome.co.uk>
To: <asterisk-bsd@lists.digium.com>
Sent: Wednesday, July 21, 2004 11:42 AM
Subject: Re: [Asterisk-bsd] Stack size in pthreads
Quote:
Thats why on Solaris they made the default pthread stack size 1 megabyte
to be on the safe side!
Chris
On Tue, 2004-07-20 at 15:36, Olle E. Johansson wrote:
> http://bugs.digium.com/bug_view_page.php?bug_id=0002067
>
> Seems like the default stack size for a native thread in FreeBSD is 64k,
> which is not enough for Asterisk. We need to make it higher.
>
> Questions:
> * In how many places of the source do we need to set the thread
stacksize?
Quote:
>
> * Is this needed for other BSD:s as well? What about Mac OS/X?
>
> Again, this is beyond my knowledge of programming, so we need help in
> coming through here. Raising the stack size made my crashes disappear.
>
> Join me in the bug tracker, now :-)
>
> And thank you Oryx, for a great job in providing us with fixes and
information.
Posted: Wed Jul 21, 2004 2:55 pm Post subject: [Asterisk-bsd] Stack size in pthreads
Oryx deserves credit for the patches, I'm just helping him get them
integrated!
Cheers,
Rich
Quote:
-----Original Message-----
From: asterisk-bsd-admin@lists.digium.com
[mailto:asterisk-bsd-admin@lists.digium.com] On Behalf Of
Olle E. Johansson
Sent: Wednesday, July 21, 2004 4:14 AM
To: asterisk-bsd@lists.digium.com
Subject: Re: [Asterisk-bsd] Stack size in pthreads
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum