No subject


Sun Feb 20 09:24:37 PST 2011


aspect that the program crashes the 2nd time that cothread_create is called.

When cothread_chunk_new is called (when the chunk is first initialized)
the value of getting the stack pointer via (char __csf; char *sp = &__csf;)
returns 0xffbfe5a7.

This causes the chunk to be set as follows:

*ret = {
    block_states    = 0x2ecb0
    chunk           = 0xff800000 "<bad address 0xff800000>"
    size            = 8388608
    reserved_bottom = 4201050
    nblocks         = 128
}

The first time that cothread_create is called the func passed in is
NILL so it gets the value of the current stack frame again.  This time
it is 0xffbfe5fb, and dest is then computed to be:

dest = 0xffbf2000 "<bad address 0xffbf2000>"

Now the mmap in cothread create seems to pass without failure in this
case.

The second time that cothread_create is called func is not null.  In
this case it ends up calling "cothread_stack_alloc" and falls into the
for loop.  In the first cycle of the loop where block is set to 1, then
low and high get set as follows:

block = 1
*low = 0xfffe0000 "<bad address 0xfffe0000>"
*high = 0xfffeffff "<bad address 0xfffeffff>"
chunk->block_states[1] = COTHREAD_BLOCK_STATE_UNUSED
*high-*low+1 = 65536

So it tries to call mmap again with the above values and mmap fails.
When I run it in dbx, the program stops with a ABRT signal that is
generated from the call to "g_error" when cothread_stack_alloc returns
FALSE.  However the signal must be taking a moment to kill the program
because the core file indicates that the program continues on to
pth_mctx_set and cores there.  Probably because the mmap call failed,
not because of a problem in pth_mctx_set, I am guessing.

I am guessing that they are using the mmap calls to treat the stack as
place to store cothread data.  I'm guessing that there must be something
different about the stack on Solaris that causes mmap (and therefore 
cothreads) to not work properly.

I notice that cothreads does not work for gstreamer even when you 
compile with gcc.  When people have told me that "gstreamer works on
Solaris with gcc" I am now suspecting that they did not test the
cothread specific code.

First of all gstreamer doesn't built easily using gcc on Solaris.  It
had the following issues when compiling.  It crashed first in
gstatomic_impl.h complaining that "val" was not defined in
gst_atomic_int_dec_and_test.  From looking at the  "HAVE_CPU_390"
implementation it seems that val should be 1, so I set "int val=1" at
the beginning of this function.

Then I get the following errors when linking in gst/autoplugtest:

Undefined			first referenced
 symbol  			    in file
___atomic_add                       ../../gst/.libs/libgstreamer-0.5.so
___atomic_sub                       ../../gst/.libs/libgstreamer-0.5.so

These seem to be referenced in gst_atomic_int_add() in gstatomic_impl.h
but not defined anywhere.  Strange.  So I changed the #ifdef so it doesn't
use this broken SPARC inline assembly and uses the default assembly instead.
I also had to add the "#include <ucontext.h>" to gst/cothreads.c that is
also in the attached Forte patch.

cothreads-gthreads also crashes when spawning a new thread.  It spits out
this info:

--output begin--

0: creating the gthreads
allocating pthread stack of size %d: Error 0
setting stack address: Error 0
setting stack size: Error 0
allocating pthread stack of size %d: Error 0
setting stack address: Error 0
setting stack size: Error 0
allocating pthread stack of size %d: Error 0
setting stack address: Error 0
setting stack size: Error 0
allocating pthread stack of size %d: Error 0
setting stack address: Error 0
setting stack size: Error 0
allocating pthread stack of size %d: Error 0
setting stack address: Error 0
setting stack size: Error 0
0: joining pthread 0
1: spawning a new cothread
Bus Error(coredump)

--output end--

In this case, I notice that it is still crashing in makecontext called
by pth_mctx_set.  However, in this case, it is not complaining that it had
any problems with mmap.  That's interesting.

On a whim, I also built a version of glib with the --with-threads=posix
passed into configure to see if using a pthreads version of glib (instead of
the  Solaris native thread version which is normally used on Solaris) made
any difference.  Both cothreads and cothreads-gthreads still crash the same
way.

I feel pretty over-my-head in terms of understanding the use of cothreads
in gstreamer, but I'm hoping that someone can help me understand what is
going on, and hopefully debug the problem. 

Thanks!

Brian

--Corps_of_Giraffes_946_000
Content-Type: TEXT/plain; name="gstreamer-solaris.pat"; charset=us-ascii
Content-Description: gstreamer-solaris.pat
Content-MD5: tXtLpIt11wktuolzaWd9kQ==

Index: gstreamer/configure.ac
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/configure.ac,v
retrieving revision 1.203
diff -u -p -r1.203 configure.ac
--- gstreamer/configure.ac	11 Jan 2003 00:27:29 -0000	1.203
+++ gstreamer/configure.ac	21 Jan 2003 11:38:12 -0000
@@ -174,6 +174,8 @@ int main ()
                 ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
 ])
 
+AC_CHECK_HEADER(ucontext.h, AC_DEFINE(HAVE_UCONTEXT_H))
+
 dnl Check for atomic.h
 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
Index: gstreamer/gst/cothreads.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/cothreads.c,v
retrieving revision 1.105
diff -u -p -r1.105 cothreads.c
--- gstreamer/gst/cothreads.c	1 Jan 2003 04:28:32 -0000	1.105
+++ gstreamer/gst/cothreads.c	21 Jan 2003 11:38:15 -0000
@@ -36,6 +36,11 @@
 #include "gstarch.h"
 #include "gstlog.h"
 #include "gstutils.h"
+#ifdef HAVE_MAKECONTEXT
+#ifdef HAVE_UCONTEXT_H
+    #include <ucontext.h>
+#endif
+#endif
 
 /* older glibc's have MAP_ANON instead of MAP_ANONYMOUS */
 #ifndef MAP_ANONYMOUS
@@ -101,8 +106,14 @@ cothread_get_current_context (void)
 cothread_context *
 cothread_context_init (void)
 {
+#ifndef __GNUC__
+  char __csf;
+  void *sp = &__csf;
+#else
+  void *sp = CURRENT_STACK_FRAME;
+#endif
+
   cothread_context *ctx;
-  void *sp;
 
   /* if there already is a cotread context for this thread,
    * just return it */
@@ -136,7 +147,6 @@ cothread_context_init (void)
   /* clear the cothread data */
   memset (ctx->cothreads, 0, sizeof (ctx->cothreads));
 
-  sp = CURRENT_STACK_FRAME;
   /* FIXME this may not be 64bit clean
    *       could use casts to uintptr_t from inttypes.h
    *       if only all platforms had inttypes.h
@@ -158,7 +168,7 @@ cothread_context_init (void)
   ctx->cothreads[0]->argv = NULL;
   ctx->cothreads[0]->priv = NULL;
   ctx->cothreads[0]->flags = COTHREAD_STARTED;
-  ctx->cothreads[0]->sp = (void *) CURRENT_STACK_FRAME;
+  ctx->cothreads[0]->sp = (void *) sp;
 
   GST_INFO (GST_CAT_COTHREADS, "0th cothread is %p at sp:%p", 
             ctx->cothreads[0], ctx->cothreads[0]->sp);
@@ -443,6 +453,13 @@ cothread_current (void)
 static void
 cothread_stub (void)
 {
+#ifndef __GNUC__
+  char __csf;
+  char *sp = &__csf;
+#else
+  char *sp = CURRENT_STACK_FRAME;
+#endif
+
   cothread_context *ctx = cothread_get_current_context();
   cothread_state *cothread = ctx->cothreads[ctx->current];
 
@@ -457,7 +474,7 @@ cothread_stub (void)
 
     GST_DEBUG (GST_CAT_COTHREADS, "cothread[%d] thread->func exited", ctx->current);
 
-    GST_DEBUG (GST_CAT_COTHREADS, "sp=%p", CURRENT_STACK_FRAME);
+    GST_DEBUG (GST_CAT_COTHREADS, "sp=%p", sp);
     GST_DEBUG (GST_CAT_COTHREADS, "ctx=%p current=%p", ctx,cothread_get_current_context());
     g_assert (ctx == cothread_get_current_context());
 
Index: gstreamer/gst/gst.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gst.c,v
retrieving revision 1.89
diff -u -p -r1.89 gst.c
--- gstreamer/gst/gst.c	16 Jan 2003 21:22:06 -0000	1.89
+++ gstreamer/gst/gst.c	21 Jan 2003 11:38:15 -0000
@@ -190,18 +190,54 @@ gst_init_with_popt_table (int *argc, cha
   gint nextopt, i, j, nstrip;
   gchar **temp;
   const struct poptOption *options;
-  /* this is probably hacky, no? */
-  const struct poptOption options_with[] = {
-    {NULL, NUL, POPT_ARG_INCLUDE_TABLE, poptHelpOptions, 				 0, "Help options:", NULL},
-    {NULL, NUL, POPT_ARG_INCLUDE_TABLE, (struct poptOption *) gst_init_get_popt_table(), 0, "GStreamer options:", NULL},
-    {NULL, NUL, POPT_ARG_INCLUDE_TABLE, (struct poptOption *) popt_options, 		 0, "Application options:", NULL},
-    POPT_TABLEEND
+  struct poptOption options_with[] = {
+     POPT_TABLEEND,
+     POPT_TABLEEND,
+     POPT_TABLEEND,
+     POPT_TABLEEND
   };
-  const struct poptOption options_without[] = {
-    {NULL, NUL, POPT_ARG_INCLUDE_TABLE, poptHelpOptions, 				 0, "Help options:", NULL},
-    {NULL, NUL, POPT_ARG_INCLUDE_TABLE, (struct poptOption *) gst_init_get_popt_table(), 0, "GStreamer options:", NULL},
-    POPT_TABLEEND
+  struct poptOption options_without[] = {
+     POPT_TABLEEND,
+     POPT_TABLEEND,
+     POPT_TABLEEND
   };
+
+  options_with[0].longName   = NULL;
+  options_with[0].shortName  = NUL;
+  options_with[0].argInfo    = POPT_ARG_INCLUDE_TABLE;
+  options_with[0].arg        = poptHelpOptions;
+  options_with[0].val        = 0;
+  options_with[0].descrip    = "Help options:";
+  options_with[0].argDescrip = NULL;
+  options_with[1].longName   = NULL;
+  options_with[1].shortName  = NUL;
+  options_with[1].argInfo    = POPT_ARG_INCLUDE_TABLE;
+  options_with[1].arg        = (struct poptOption *) gst_init_get_popt_table();
+  options_with[1].val        = 0;
+  options_with[1].descrip    = "GStreamer options:";
+  options_with[1].argDescrip = NULL;
+  options_with[2].longName   = NULL;
+  options_with[2].shortName  = NUL;
+  options_with[2].argInfo    = POPT_ARG_INCLUDE_TABLE;
+  options_with[2].arg        = (struct poptOption *) popt_options;
+  options_with[2].val        = 0;
+  options_with[2].descrip    = "Application options:";
+  options_with[2].argDescrip = NULL;
+
+  options_without[0].longName   = NULL;
+  options_without[0].shortName  = NUL;
+  options_without[0].argInfo    = POPT_ARG_INCLUDE_TABLE;
+  options_without[0].arg        = poptHelpOptions;
+  options_without[0].val        = 0;
+  options_without[0].descrip    = "Help options:";
+  options_without[0].argDescrip = NULL;
+  options_without[1].longName   = NULL;
+  options_without[1].shortName  = NUL;
+  options_without[1].argInfo    = POPT_ARG_INCLUDE_TABLE;
+  options_without[1].arg        = (struct poptOption *) gst_init_get_popt_table();
+  options_without[1].val        = 0;
+  options_without[1].descrip    = "GStreamer options:";
+  options_without[1].argDescrip = NULL;
 
   if (gst_initialized)
   {
Index: gstreamer/gst/gstarch.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstarch.h,v
retrieving revision 1.18
diff -u -p -r1.18 gstarch.h
--- gstreamer/gst/gstarch.h	11 Dec 2002 21:33:07 -0000	1.18
+++ gstreamer/gst/gstarch.h	21 Jan 2003 11:38:15 -0000
@@ -30,7 +30,7 @@
 
 
 /***** Intel x86 *****/
-#if defined(HAVE_CPU_I386)
+#if defined(HAVE_CPU_I386) && defined(__GNUC__)
 #define GST_ARCH_SET_SP(stackpointer) \
   __asm__( "movl %0, %%esp\n" : : "r"(stackpointer) );
 
@@ -43,7 +43,7 @@
 
 
 /***** PowerPC *****/
-#elif defined (HAVE_CPU_PPC)
+#elif defined (HAVE_CPU_PPC) && defined(__GNUC__)
 
 /* should bring this in line with others and use an "r" */
 #define GST_ARCH_SET_SP(stackpointer) \
@@ -68,7 +68,7 @@ struct minimal_ppc_stackframe {
 
 
 /***** DEC[/Compaq/HP?/Intel?] Alpha *****/
-#elif defined(HAVE_CPU_ALPHA)
+#elif defined(HAVE_CPU_ALPHA) && defined(__GNUC__)
 
 #define GST_ARCH_SET_SP(stackpointer) \
     __asm__("bis $31,%0,$30" : : "r"(stackpointer));
@@ -94,7 +94,7 @@ struct minimal_stackframe {
 
 
 /***** ARM *****/
-#elif defined(HAVE_CPU_ARM)
+#elif defined(HAVE_CPU_ARM) && defined(__GNUC__)
 
 #define GST_ARCH_SET_SP(stackpointer) \
     __asm__( "mov sp, %0" : : "r"(stackpointer));
@@ -110,7 +110,7 @@ struct minimal_stackframe {
 
 
 /***** Sun SPARC *****/
-#elif defined(HAVE_CPU_SPARC)
+#elif defined(HAVE_CPU_SPARC) && defined(__GNUC__)
 
 #define GST_ARCH_SET_SP(stackpointer) \
     __asm__( "ta 3\n\t" \
@@ -131,7 +131,7 @@ struct minimal_stackframe {
 
 
 /***** MIPS *****/
-#elif defined(HAVE_CPU_MIPS)
+#elif defined(HAVE_CPU_MIPS) && defined(__GNUC__)
 
 #define GST_ARCH_SET_SP(stackpointer) \
     __asm__("lw $sp,0(%0)\n\t" : : "r"(stackpointer));
@@ -146,7 +146,7 @@ struct minimal_stackframe {
 
 
 /***** HP-PA *****/
-#elif defined(HAVE_CPU_HPPA)
+#elif defined(HAVE_CPU_HPPA) && defined(__GNUC__)
 
 #define GST_ARCH_SET_SP(stackpointer) \
     __asm__("copy %0,%%sp\n\t" : : "r"(stackpointer));
@@ -160,7 +160,7 @@ struct minimal_stackframe {
 #define GST_ARCH_SETUP_STACK(sp) sp -= 4
 
 /***** S/390 *****/
-#elif defined(HAVE_CPU_S390)
+#elif defined(HAVE_CPU_S390) && defined(__GNUC__)
 
 #define GST_ARCH_SET_SP(stackpointer) \
     __asm__("lr 15,%0" : : "r"(stackpointer))
Index: gstreamer/gst/gstatomic_impl.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstatomic_impl.h,v
retrieving revision 1.1
diff -u -p -r1.1 gstatomic_impl.h
--- gstreamer/gst/gstatomic_impl.h	31 Dec 2002 03:21:07 -0000	1.1
+++ gstreamer/gst/gstatomic_impl.h	21 Jan 2003 11:38:15 -0000
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
 #if defined (GST_CAN_INLINE) || defined (__GST_ATOMIC_C__)
   
 /***** Intel x86 *****/
-#if defined (HAVE_CPU_I386)
+#if defined (HAVE_CPU_I386) && defined(__GNUC__)
 
 #ifdef GST_CONFIG_NO_SMP
 #define SMP_LOCK ""
@@ -78,7 +78,7 @@ gst_atomic_int_dec_and_test (GstAtomicIn
 }
 
 /***** PowerPC *****/
-#elif defined (HAVE_CPU_PPC)
+#elif defined (HAVE_CPU_PPC) && defined(__GNUC__)
 
 #ifdef GST_CONFIG_NO_SMP
 #define SMP_SYNC        ""
@@ -154,7 +154,7 @@ gst_atomic_int_dec_and_test (GstAtomicIn
 }
 
 /***** DEC[/Compaq/HP?/Intel?] Alpha *****/
-#elif defined(HAVE_CPU_ALPHA)
+#elif defined(HAVE_CPU_ALPHA) && defined(__GNUC__)
 
 GST_INLINE_FUNC void 	gst_atomic_int_init 	(GstAtomicInt *aint, gint val) { aint->counter = val; }
 GST_INLINE_FUNC void 	gst_atomic_int_destroy 	(GstAtomicInt *aint) { } 
@@ -206,7 +206,7 @@ gst_atomic_int_dec_and_test (GstAtomicIn
 }
 
 /***** Sun SPARC *****/
-#elif defined(HAVE_CPU_SPARC)
+#elif defined(HAVE_CPU_SPARC) && defined(__GNUC__)
 
 GST_INLINE_FUNC void 	gst_atomic_int_destroy 	(GstAtomicInt *aint) { } 
 
@@ -285,7 +285,7 @@ gst_atomic_int_dec_and_test (GstAtomicIn
 }
 
 /***** MIPS *****/
-#elif defined(HAVE_CPU_MIPS)
+#elif defined(HAVE_CPU_MIPS) && defined(__GNUC__)
 
 GST_INLINE_FUNC void 	gst_atomic_int_init 	(GstAtomicInt *aint, gint val) { aint->counter = val; }
 GST_INLINE_FUNC void 	gst_atomic_int_destroy 	(GstAtomicInt *aint) { } 
@@ -336,7 +336,7 @@ gst_atomic_int_dec_and_test (GstAtomicIn
 }
 
 /***** S/390 *****/
-#elif defined(HAVE_CPU_S390)
+#elif defined(HAVE_CPU_S390) && defined(__GNUC__)
 
 GST_INLINE_FUNC void 	gst_atomic_int_init 	(GstAtomicInt *aint, gint val) { aint->counter = val; }
 GST_INLINE_FUNC void 	gst_atomic_int_destroy 	(GstAtomicInt *aint) { } 
Index: gstreamer/gst/gstinfo.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstinfo.c,v
retrieving revision 1.51
diff -u -p -r1.51 gstinfo.c
--- gstreamer/gst/gstinfo.c	13 Dec 2002 15:33:39 -0000	1.51
+++ gstreamer/gst/gstinfo.c	21 Jan 2003 11:38:15 -0000
@@ -564,7 +564,12 @@ gst_debug_print_stack_trace (void)
 
 #endif /* GST_ENABLE_FUNC_INTSTRUMENTATION */
 
+/* Forte does not work with non-static inline functions */
+#ifndef __SUNPRO_C
 inline void *
+#else
+void *
+#endif
 _gst_debug_register_funcptr (void *ptr, gchar *ptrname)
 {
   if (!__gst_function_pointers)
Index: gstreamer/gst/gstinfo.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstinfo.h,v
retrieving revision 1.39
diff -u -p -r1.39 gstinfo.h
--- gstreamer/gst/gstinfo.h	15 Jan 2003 21:42:30 -0000	1.39
+++ gstreamer/gst/gstinfo.h	21 Jan 2003 11:38:15 -0000
@@ -352,7 +352,12 @@ void gst_default_info_handler (gint cate
                                gint line,const gchar *debug_string,
                                void *element,gchar *string);
 
+/* Forte does not work with non-static inline functions */
+#ifdef __SUNPRO_C
+void * _gst_debug_register_funcptr (void *ptr, gchar *ptrname);
+#else
 inline void * _gst_debug_register_funcptr (void *ptr, gchar *ptrname);
+#endif
 
 extern GstInfoHandler _gst_info_handler;
 extern guint32 _gst_info_categories;
Index: gstreamer/gst/elements/gstmd5sink.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/elements/gstmd5sink.c,v
retrieving revision 1.7
diff -u -p -r1.7 gstmd5sink.c
--- gstreamer/gst/elements/gstmd5sink.c	29 Sep 2002 17:52:31 -0000	1.7
+++ gstreamer/gst/elements/gstmd5sink.c	21 Jan 2003 11:38:15 -0000
@@ -151,7 +151,11 @@ md5_process_bytes (const void *buffer, s
       size_t add = 128 - left_over > len ? len : 128 - left_over;
 
       /* Only put full words in the buffer.  */
+#ifdef __GNUC__
       add -= add % __alignof__ (guint32);
+#else
+      add -= add % 4;
+#endif
 
       memcpy (&ctx->buffer[left_over], buffer, add);
       ctx->buflen += add;
Index: gstreamer/libs/ext/cothreads/cothreads/cothreads.c
===================================================================
RCS file: /cvsroot/gstreamer/cothreads/cothreads/cothreads.c,v
retrieving revision 1.21
diff -u -p -r1.21 cothreads.c
--- gstreamer/libs/ext/cothreads/cothreads/cothreads.c	12 Sep 2002 19:28:28 -0000	1.21
+++ gstreamer/libs/ext/cothreads/cothreads/cothreads.c	21 Jan 2003 11:38:16 -0000
@@ -238,7 +238,14 @@ cothreads_get_chunk (void) 
 cothread*
 cothread_create (cothread_func func, int argc, void **argv, cothread *main)
 {
-  char *low, *high, *dest;
+#ifndef __GNUC__
+  char __csf;
+  char *low;
+#else
+  char *low;
+#endif
+
+  char *high, *dest;
   cothread_private priv;
   cothread *ret = NULL;
   cothread_chunk *chunk;
@@ -250,9 +257,15 @@ cothread_create (cothread_func func, int
   priv.chunk = chunk;
   
   if (!func) {
+
+#ifndef __GNUC__
+     low = &__csf;
+#else
+     low = CURRENT_STACK_FRAME;
+#endif
+
     /* we are being asked to save the current thread into a new cothread. this
      * only happens for the first cothread in a thread. */
-    low = CURRENT_STACK_FRAME;
 #if PTH_STACK_GROWTH > 0
     dest = (char*) ((gulong)low | (chunk->size / chunk->nblocks - 1))
       + 1 - getpagesize() * 2;
@@ -302,7 +315,12 @@ cothread_create (cothread_func func, int
 cothread*
 cothread_self (void)
 {
+#ifndef __GNUC__
+  char __csf;
+  char *sp = &__csf;
+#else
   char *sp = CURRENT_STACK_FRAME;
+#endif
 
   return (cothread*)cothread_private_get (cothreads_get_chunk(), sp, NULL, sizeof (cothread_private));
 }
@@ -542,8 +560,13 @@ static cothread_chunk*
 cothread_chunk_new (glong size, gint nblocks)
 {
   cothread_chunk *ret;
+#ifndef __GNUC__
+  char __csf;
+  char *sp = &__csf;
+#else
   char *sp = CURRENT_STACK_FRAME;
-  
+#endif
+
   ret = g_new0 (cothread_chunk, 1);
   ret->nblocks = nblocks;
   ret->block_states = g_new0 (cothread_block_state, ret->nblocks);
Index: gstreamer/libs/ext/cothreads/cothreads/pth_mctx.c
===================================================================
RCS file: /cvsroot/gstreamer/cothreads/cothreads/pth_mctx.c,v
retrieving revision 1.1
diff -u -p -r1.1 pth_mctx.c
--- gstreamer/libs/ext/cothreads/cothreads/pth_mctx.c	8 Feb 2002 22:18:30 -0000	1.1
+++ gstreamer/libs/ext/cothreads/cothreads/pth_mctx.c	21 Jan 2003 11:38:16 -0000
@@ -164,7 +164,7 @@ intern int pth_mctx_set(
 
     /* configure new stack */
     mctx->uc.uc_stack.ss_sp    = pth_skaddr(makecontext, sk_addr_lo, sk_addr_hi-sk_addr_lo);
-    mctx->uc.uc_stack.ss_size  = pth_sksize(makecontext, sk_addr_lo, sk_addr_hi-sk_addr_lo);
+    mctx->uc.uc_stack.ss_size  = pth_sksize(Makecontext, sk_addr_lo, sk_addr_hi-sk_addr_lo);
     mctx->uc.uc_stack.ss_flags = 0;
 
     /* configure startup function (with no arguments) */
Index: gstreamer/libs/ext/cothreads/tests/cothreads.c
===================================================================
RCS file: /cvsroot/gstreamer/cothreads/tests/cothreads.c,v
retrieving revision 1.13
diff -u -p -r1.13 cothreads.c
--- gstreamer/libs/ext/cothreads/tests/cothreads.c	13 Aug 2002 21:53:24 -0000	1.13
+++ gstreamer/libs/ext/cothreads/tests/cothreads.c	21 Jan 2003 11:38:16 -0000
@@ -10,9 +10,7 @@
 #include <errno.h>
 
 #define NGTHREADS 5
-#define MAIN_STACK_SIZE 0x0800000 	/* Apparently 6 MB is the largest stack
-                                         * size available in linux while running
-                                         * threads, so go with aligned 4 MB? */
+#define MAIN_STACK_SIZE 0x0800000 	/* Apparently 6 MB is the largest stack */
 #define MAIN_STACK_NCOTHREADS 128	/* 64K stack size */
 #define THREAD_STACK_SIZE 0x0200000	/* 2 MB. Take it easy on non-i686 libc */
 #define THREAD_STACK_NCOTHREADS 32	/* 64K stack size */

--Corps_of_Giraffes_946_000--




More information about the gstreamer-devel mailing list