From: kees@org-net.nl (kj hermans)
Subject: Re: WaitForSomething(): select :errno=22
Date: 22 May 2001 08:53:44 -0700 [thread overview]
Message-ID: <3ebe4270.0105220753.1772224f@posting.google.com> (raw)
In-Reply-To: 3ebe4270.0105220227.712f63a4@posting.google.com
kees@org-net.nl (kj hermans) wrote in message news:<3ebe4270.0105220227.712f63a4@posting.google.com>...
> "G. Hugh Song" <ghsong@nospam.com> wrote in message news:<3B0757FB.7A6A7FA8@nospam.com>...
> > My UP2000 board running Linux/Alpha SMP from SuSE-7.0
> > xf86-3.3.6-49.alpha.rpm and xglint-3.3.6-49.alpha.rpm.
> > afterstp-1.8.0-0.alpha.rpm.
> >
> > X often crashes with the messages:
> >
> > WaitForSomething():select :errno=22
> >
> > Any clue to this problem?
> >
> > Thank you.
>
> Well, 22 is EINVAL on Linux and 'man select' says that select() returns EINVAL
> when n is negative, so somehow the maximum filedescriptor fed to select() manages
> to become negative. According to the http://www.afterstep.org/code, afterstep
> has two functions that start with 'WaitFor', namely 'WaitForExpose()' and
> 'WaitForButtonsUp()'. However, the source code to the X server has a function called
> 'WaitForSomething()' in 'xc/programs/Xserver/os/WaitFor.c' on line 342,
> where 'MAXSOCKS' is the culprit.
> And in 'xc/programs/Xserver/os/osdep.h', around line 70,
> we find a piece of code that can easily lead to MAXSOCKS being -1
>
> #ifndef OPEN_MAX
> #ifdef SVR4
> #define OPEN_MAX 256
> #else
> #include <sys/param.h>
> #ifndef OPEN_MAX
> #if defined(NOFILE) && !defined(NOFILES_MAX)
> #define OPEN_MAX NOFILE
> #else
> #define OPEN_MAX NOFILES_MAX
> #endif
> #endif
> #endif
> #endif
>
> #if OPEN_MAX <= 256
> #define MAXSOCKS (OPEN_MAX - 1)
> #else
> #define MAXSOCKS 256
> #endif
>
> I think. But I'm not sure; just a quick source code scan.
>
> KC
In short; when compiling for your system,
maybe somebody forgot to #define NOFILE _and_ NOFILES_MAX.
If that's the case (and I'm not very sure about this), write to the person who
packages these rpms, or the person who's supposed to have created the standard
header files for your Linux distribution (Suse, that is); because in my
Linux, OPEN_MAX is already #define-d in /usr/include/linux/limits.h as 256.
Of course it's just a possibility; this needs to be proven by recompiling
the Xserver for your system with some sort of echo of this value.
you can also add the lines
#if !defined(OPEN_MAX) && !defined(SVR4) && !defined(NOFILE) && !defined(NOFILES_MAX)
#error "impossible system configuration"
#endif
on top of all these defines inside the source code and recompile.
next prev parent reply other threads:[~2001-05-22 15:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-20 5:36 WaitForSomething(): select :errno=22 G. Hugh Song
2001-05-22 10:27 ` kj hermans
2001-05-22 15:53 ` kj hermans [this message]
2001-05-25 6:21 ` G. Hugh Song
2001-05-28 8:42 ` kj hermans
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox