Bug#822179: xorg: X.Org X Server starts normally, crashes with Segmentation fault on starting any application
- To: James Clarke <jrtc27@jrtc27.com>
- Cc: Julien Cristau <jcristau@debian.org>, 822179@bugs.debian.org, Matthias <Matthias.L2@web.de>, debian-hurd@lists.debian.org
- Subject: Bug#822179: xorg: X.Org X Server starts normally, crashes with Segmentation fault on starting any application
- From: Samuel Thibault <sthibault@debian.org>
- Date: Sat, 23 Apr 2016 15:55:26 +0200
- Message-id: <[🔎] 20160423135526.GH2829@var.home>
- Mail-followup-to: James Clarke <jrtc27@jrtc27.com>, Julien Cristau <jcristau@debian.org>, 822179@bugs.debian.org, Matthias <Matthias.L2@web.de>, debian-hurd@lists.debian.org
- Reply-to: Samuel Thibault <sthibault@debian.org>, 822179@bugs.debian.org
- In-reply-to: <[🔎] CAEF8D25-2589-4FF0-A42B-4A79ADEAB424@jrtc27.com>
- References: <[🔎] 146127336221.1174.4075042082403837664.reportbug@debian> <[🔎] 20160422193220.GD2718@betterave.cristau.org> <[🔎] CAEF8D25-2589-4FF0-A42B-4A79ADEAB424@jrtc27.com>
Hello,
James Clarke, on Sat 23 Apr 2016 14:44:52 +0100, wrote:
> I have attached a proposed patch which ensures XFD_SETSIZE never
> exceeds FD_SETSIZE.
Did you test it?
AIUI, nothing uses XFD_SETSIZE actually, it's just the default value
that X uses for FD_SETSIZE in case it's not already defined. I.e. your
change doesn't actually change anything: if FD_SETSIZE is define on
poll.h inclusion, it'll be used, not 512. What probably actually breaks
is the
(howmany(FD_SETSIZE, NFDBITS) > 8 && (__XFDS_BITS(p, 8))) ||
lines when FD_SETSIZE is not big enough. Probably these can be made
conditioned by the value of FD_SETSIZE, something like:
#if FD_SETSIZE >= 512
#define XFD_ANYSET_512(p) \
((howmany(FD_SETSIZE, NFDBITS) > 8 && (__XFDS_BITS(p, 8))) || \
(howmany(FD_SETSIZE, NFDBITS) > 9 && (__XFDS_BITS(p, 9))) || \
(howmany(FD_SETSIZE, NFDBITS) > 10 && (__XFDS_BITS(p, 10))) || \
(howmany(FD_SETSIZE, NFDBITS) > 11 && (__XFDS_BITS(p, 11))) || \
(howmany(FD_SETSIZE, NFDBITS) > 12 && (__XFDS_BITS(p, 12))) || \
(howmany(FD_SETSIZE, NFDBITS) > 13 && (__XFDS_BITS(p, 13))) || \
(howmany(FD_SETSIZE, NFDBITS) > 14 && (__XFDS_BITS(p, 14))) || \
(howmany(FD_SETSIZE, NFDBITS) > 15 && (__XFDS_BITS(p, 15))))
#else
#define XFD_ANYSET_512(p) 0
#endif
#define XFD_ANYSET(p) \
((howmany(FD_SETSIZE, NFDBITS) > 0 && (__XFDS_BITS(p, 0))) || \
(howmany(FD_SETSIZE, NFDBITS) > 1 && (__XFDS_BITS(p, 1))) || \
(howmany(FD_SETSIZE, NFDBITS) > 2 && (__XFDS_BITS(p, 2))) || \
(howmany(FD_SETSIZE, NFDBITS) > 3 && (__XFDS_BITS(p, 3))) || \
(howmany(FD_SETSIZE, NFDBITS) > 4 && (__XFDS_BITS(p, 4))) || \
(howmany(FD_SETSIZE, NFDBITS) > 5 && (__XFDS_BITS(p, 5))) || \
(howmany(FD_SETSIZE, NFDBITS) > 6 && (__XFDS_BITS(p, 6))) || \
(howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7))) || \
XFD_ANYSET_512(p))
Samuel
Reply to: