Subject: xsrc/5809: X server crashes unhelpfully
To: None <>
From: None <>
List: netbsd-bugs
Date: 07/21/1998 13:13:30
>Number:         5809
>Category:       xsrc
>Synopsis:       X server crashes unhelpfully
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 21 06:20:00 1998
>Originator:     Dave Sainty
Dynamic Technology Services and Products Ltd (NZ)
>Release:        recent sup
System: NetBSD 1.3F NetBSD 1.3F (TEQUILA) #1: Mon Jul 20 23:24:49 NZST 1998 i386

	xalloc.c in the X server does not check returns from library calls for
	failure.  This can lead to obscure crashes (Signal 11 trapped blah
	blah), and result in a lengthy bug hunt, including big searches for
	things to delete so you will have enough disk to compile the X server.

	Well, now that I know this is the problem my next guess is that it's
	because my libc is out of date, though I'm surprised that this would
	cause this particular result unless some #defines have changed their
	numeric values recently.


Apply this patch to warn of the problem at the source...  Admittedly it is a
little bizarre that this operation could ever fail...

--- xc/programs/Xserver/os/xalloc.c.orig	Fri Aug 22 21:34:30 1997
+++ xc/programs/Xserver/os/xalloc.c	Wed Jul 22 00:47:42 1998
@@ -680,6 +680,9 @@
 #if defined(HAS_MMAP_ANON) || defined (MMAP_DEV_ZERO)
 #if defined(_SC_PAGESIZE) /* || defined(linux) */
     pagesize = sysconf(_SC_PAGESIZE);
+    if (pagesize == -1)
+	FatalError("OsInitAllocator: Failed to get pagesize\n");
     pagesize = getpagesize();