[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GNOME partly working



At Tue, 17 May 2005 23:57:24 +0200,
Michael Banck wrote:
> 3. There is a pretty severe issue with pthread_attr_setstacksize()
> from libgthread resulting in nautilus to abort.  I hacked around that
> in glib for now, Neal might be able to look into that later on.

Our current libpthread doesn't support floating stacks.  To get at the
thread specific data (TSD), we look at the base of the stack.  To find
the base of the stack, we take the current stack point and bitwise and
it with ~(2MB - 1).  This mode of operation makes supporting user
stacks very difficult as we have no mechanism to express these
constraints to the user.

Currently, pthread_attr_setstacksize is essentially a stub (if the
caller specifies 2MB it succeeds all other values return EINVAL).
glib thinks that since it is present (it checks for it using autoconf,
apparently), it must work.  Arguably, we are not not POSIX compliant:

  The pthread_attr_setstacksize() function shall fail if:

  [EINVAL]
      The value of stacksize is less than {PTHREAD_STACK_MIN} or
      exceeds a system-imposed limit.

Thus for our implementation PTHREAD_STACK_MIN would be 2MB and the
system imposed limit would be 2MB.  (As a side note that we don't
currently define PTHREAD_STACK_MIN as it is supposed to be defined by
<limits.h> and that is provided by glibc and not something we can
easily change.  We could just define it in <pthread.h>, however, we
still have the problem that the respective sysconf parameter is
undefined.  Since user stacks are not really supported anyway, there
is no real use in providing this.)

Since glib just ignores the stack size parameter if
pthread_attr_setstacksize is not found, it should just ignore any
failure.

I spooke with Michael about this issue offline and he is filing a bug
upstream.

Thanks,
Neal



Reply to: