From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103734,6a7c75abf03cb3c2 X-Google-Attributes: gid103734,public X-Google-Thread: 111c93,6a7c75abf03cb3c2 X-Google-Attributes: gid111c93,public X-Google-Thread: f4bda,6a7c75abf03cb3c2 X-Google-Attributes: gidf4bda,public X-Google-ArrivalTime: 2001-05-22 08:53:44 PST Path: archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mail From: kees@org-net.nl (kj hermans) Newsgroups: comp.os.linux.alpha,comp.os.linux.x,comp.windows.x Subject: Re: WaitForSomething(): select :errno=22 Date: 22 May 2001 08:53:44 -0700 Organization: http://groups.google.com/ Message-ID: <3ebe4270.0105220753.1772224f@posting.google.com> References: <3B0757FB.7A6A7FA8@nospam.com> <3ebe4270.0105220227.712f63a4@posting.google.com> NNTP-Posting-Host: 213.53.218.161 Content-Type: text/plain; charset=EUC-KR Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 990546824 22231 127.0.0.1 (22 May 2001 15:53:44 GMT) X-Complaints-To: groups-support@google.com NNTP-Posting-Date: 22 May 2001 15:53:44 GMT Xref: archiver1.google.com comp.os.linux.alpha:2923 comp.os.linux.x:11315 comp.windows.x:2401 kees@org-net.nl (kj hermans) wrote in message news:<3ebe4270.0105220227.712f63a4@posting.google.com>... > "G. Hugh Song" 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 > #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.