xserver-multidpi/os
Rami Ylimaki 5b9a52be7e os: Prevent core dump from being truncated.
The problem fixed by this patch can be reproduced on Linux with the
following steps.
- Access NULL pointer intentionally in ProcessOtherEvent on key press.
- Instead of saving core dump to a file, write it into a pipe.
  echo "|/usr/sbin/my-core-dumper" > /proc/sys/kernel/core_pattern
- Dump the core by pressing a key.

While the core is being dumped into the pipe, the smart schedule timer
will cause a pending SIGALRM. Linux kernel stops writing data to the
pipe when there are pending signals. This causes the core dump to be
truncated. On my system I'm expecting a 6 MB dump but the size will be
60 kB instead. The problem is solved if we block the SIGALRM caused by
expired smart schedule timer.

I haven't been able to reproduce this problem in the following cases.
- Save core dump to a file instead of a pipe.
- kill -SEGV `pidof Xorg`
- Press a key to dump core while gdb is attached to Xorg.
- Give option -dumbSched to Xorg.

Also note that the fix works only when NoTrapSignals has the default
value FALSE. The problem can still be reproduced if error signals
aren't trapped. In addition to pending SIGALRM, there is a similar
problem with pending SIGIO from the keyboard driver during core dump.

Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-17 23:20:52 -08:00
..
.gitignore .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
Makefile.am Supply all code using dl*() with DLOPEN_LIBS 2009-10-29 14:15:02 -07:00
WaitFor.c Update to xextproto 7.0.99.1. 2009-07-15 17:00:05 +10:00
access.c Update Sun license notices to current X.Org standard form 2009-12-16 17:11:35 -08:00
auth.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
backtrace.c Miscellaneous compilation warning fixes 2009-12-08 15:50:28 -08:00
connection.c Clarify use of and need for mffs vs. ffs 2009-06-18 09:49:19 -07:00
io.c os: silence bigreqsproto compiler warning 2009-09-04 12:51:02 +10:00
log.c os: Prevent core dump from being truncated. 2010-02-17 23:20:52 -08:00
mitauth.c Remove a bunch of useless casts. 2009-01-22 02:11:16 -05:00
oscolor.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
osdep.h Bug 16832: XDMCP related build error when --disable-xdmcp is used 2009-08-03 20:58:37 -07:00
osinit.c linux: Yet more malloc() avoidance for backtrace() 2009-08-20 15:43:55 -04:00
rpcauth.c Remove a bunch of useless casts. 2009-01-22 02:11:16 -05:00
strcasecmp.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
strcasestr.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
strlcat.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
strlcpy.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
utils.c os: Introduce OsAbort for proper core dumps. 2010-02-17 23:20:41 -08:00
xdmauth.c Remove a bunch of useless casts. 2009-01-22 02:11:16 -05:00
xdmcp.c xdmcp: Don't crash on X -query with more than 255 IP addresses. (#20675) 2009-04-14 10:57:19 -04:00
xprintf.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
xsha1.c SHA1: Add support for Common Crypto 2009-11-05 18:34:50 -08:00
xstrans.c Change HAVE_CONFIG_H to HAVE_DIX_CONFIG_H. 2005-07-03 12:16:29 +00:00