From: kees@org-net.nl (kj hermans)
Subject: Re: WaitForSomething(): select :errno=22
Date: 22 May 2001 03:27:32 -0700 [thread overview]
Message-ID: <3ebe4270.0105220227.712f63a4@posting.google.com> (raw)
In-Reply-To: 3B0757FB.7A6A7FA8@nospam.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
next prev parent reply other threads:[~2001-05-22 10:27 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 [this message]
2001-05-22 15:53 ` kj hermans
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