From: Georg Wittig <Georg.Wittig@gmd.de>
To: axp-list@redhat.com
Subject: patch for Xserver crash on alpha
Date: Fri, 7 Aug 1998 15:20:04 +0200 [thread overview]
Message-ID: <19980807152004.A20588@twister.gmd.de> (raw)
Found this one in comp.os.linux.x. Don't know yet if it really fixes
the problem.
----------------------------------------------------------------------------
From: raphael@cs.uky.edu
Newsgroups: comp.os.linux.x
Subject: Bug fixed in XFree86 for Linux/AXP
Date: Thu, 06 Aug 1998 18:40:28 GMT
Message-ID: <6qctat$9fj$1@nnrp1.dejanews.com>
NNTP-Posting-Host: 128.163.146.41
X-Article-Creation-Date: Thu Aug 06 18:40:28 1998 GMT
A while ago I reported a bug with XF86 servers under Linux/AXP.
I have now tracked down and corrected this bug.
It is due to an assumption that fd_mask is 32 bits wide. On Linux/AXP,
fd_mask is 65 bits wide. The symptom was that client #27 leads to a segment
violation. The cure is to use lffs() instead of the library ffs(), differing
only in that the parameter is long, not int. This fix needs to be placed
in several locations (but not all where ffs() is used), and there is one
other mod necessary.
Besides minor changes to reduce the number of compiler warnings,
here are the necessary fixes:
-----
diff -r xc/programs/Xserver/os/WaitFor.c /tmp/xc/programs/Xserver/os/WaitFor.c
85a86,100
> #if defined(__linux__) && defined(__alpha__) /* raphael: added */
> #define ffs lffs
> int lffs(unsigned long mask) {
> register i;
> if ( ! mask ) return 0;
> i = 1;
> while (! (mask & 1)) {
> i++;
> mask = mask >> 1;
> }
> return i;
> }
> #else
> #endif
>
144a160
> #define dbprintf(list) printf list /* raphael */
422c438,439
< client_index = ConnectionTranslation[curclient + (i << 5)];
---
> client_index = /* raphael: modified */
> ConnectionTranslation[curclient + (i * (sizeof(__fd_mask) * 8))];
diff -r xc/programs/Xserver/os/connection.c
/tmp/xc/programs/Xserver/os/connecti on.c 167a168,172
> #if defined(__linux__) && defined(__alpha__) /* raphael: added */
> #define ffs lffs
> extern int lffs(long);
> #endif
>
diff -r xc/programs/Xserver/os/io.c /tmp/xc/programs/Xserver/os/io.c
87a88,92
> #if defined(__linux__) && defined(__alpha__) /* raphael: added */
> #define ffs lffs
> extern int lffs(long);
> #endif
>
970c975,976
< register int index, base, mask;
---
> register int index, base;
> register long mask; /* raphael */
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
--
Georg Wittig GMD email:Georg.Wittig@gmd.de
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Remove /etc/passwd. Remove /etc/group too,
if you want to make it interesting... Then reboot the machine.
next reply other threads:[~1998-08-07 13:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-08-07 13:20 Georg Wittig [this message]
1998-08-07 13:38 ` patch for Xserver crash on alpha Matti Aarnio
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