This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin > 1.7.9: Segmentation faults / STATUS_STACK_OVERFLOW


On Feb 10 17:24, Corinna Vinschen wrote:
> Other than that, you can change the pthread stacksize since 1.7.10.  Try
> this:
> 
> > int main(void)
> > {
> >   int ret;
> >   puts("Starting test");
> > 
> > #if 0
> >   // Working fine if called in the main thread.
> >   callGlob(NULL);
> > #else
> >   // Not working if called in another thread.
> 
>     pthread_attr_t attr;
>     pthread_attr_init (&attr);
>     pthread_attr_setstacksize (&attr, 1024 * 1024);
> 
> >   ret = pthread_create(&threadId, NULL, callGlob, NULL);

Oops, sorry, you have to change the pthread_create call so that it uses
attr, of course:

      ret = pthread_create (&threadId, &attr, callGlob, NULL);


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]