xserver-multidpi/hw/xquartz
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
..
bundle XQuartz: Add some .gitignore magic 2010-01-30 10:55:38 -08:00
doc XQuartz: Updated man page fullscreen_hotkeys fullscreen_menu 2008-12-31 12:42:48 -08:00
GL os: Prevent core dump from being truncated. 2010-02-17 23:20:52 -08:00
mach-startup XQuartz: clang static analysis fixes 2010-02-15 15:03:49 -08:00
pbproxy XQuartz: clang static analysis fixes 2010-02-15 15:03:49 -08:00
xpr XQuartz: Attatch a stub display when CoreGraphics reports no displays. 2010-01-30 14:49:02 -08:00
applewm.c Add type name argument to CreateNewResourceType 2009-12-18 17:44:12 -08:00
applewmExt.h XQuartz: ProcAppleWMAttachTransient to play nice with the new Dock in SL 2009-07-03 19:46:00 -07:00
darwin.c XQuartz: Dead code removal 2010-01-30 14:30:40 -08:00
darwin.h XQuartz: Dead code removal 2010-01-30 14:30:40 -08:00
darwinEvents.c XQuartz: Fix a bunch of compilation warnings about style 2009-09-27 23:31:35 -07:00
darwinEvents.h XQuartz: Transition from xEvent based mieq to InternalEvent 2009-09-27 23:31:07 -07:00
darwinfb.h XQuartz: Unify how we set our bitmasks for visuals 2009-07-31 15:34:13 -07:00
darwinXinput.c XQuartz: Fix linking (CloseInput()) 2010-02-15 15:03:49 -08:00
keysym2ucs.c Darwin: Flattened quartz into darwin, renamed darwin xquartz 2007-12-05 20:32:40 -08:00
keysym2ucs.h Darwin: Flattened quartz into darwin, renamed darwin xquartz 2007-12-05 20:32:40 -08:00
Makefile.am XQuartz: Transition from xEvent based mieq to InternalEvent 2009-09-27 23:31:07 -07:00
pseudoramiX.c xquartz: switch to byte counting functions 2009-07-14 10:13:45 +10:00
pseudoramiX.h Darwin: Flattened quartz into darwin, renamed darwin xquartz 2007-12-05 20:32:40 -08:00
quartz.c XQuartz: Fix a bunch of compilation warnings about style 2009-09-27 23:31:35 -07:00
quartz.h XQuartz: Fix a bunch of compilation warnings about style 2009-09-27 23:31:35 -07:00
quartzAudio.c XQuartz: Fix a possible buffer overrun in quartzAudio 2010-02-15 16:46:21 -08:00
quartzAudio.h XQuartz: Purge redundant QuartzBell 2009-08-05 16:17:01 -07:00
quartzCocoa.m XQuartz: Transition from xEvent based mieq to InternalEvent 2009-09-27 23:31:07 -07:00
quartzCommon.h XQuartz: More fullscreen fixes 2008-10-21 09:34:49 -07:00
quartzKeyboard.c XQuartz: clang static analysis fixes 2010-02-15 15:03:49 -08:00
quartzKeyboard.h XQuartz: Transition from xEvent based mieq to InternalEvent 2009-09-27 23:31:07 -07:00
quartzStartup.c Xquartz: Removed include directive for removed header 2008-07-11 10:13:06 -07:00
sanitizedCarbon.h XQuartz: Handled sanitization of namespace better 2008-04-18 20:07:55 -07:00
sanitizedCocoa.h XQuartz: Handled sanitization of namespace better 2008-04-18 20:07:55 -07:00
threadSafety.c XQuartz: spewCallStack is noop on Tiger now... 2008-11-21 10:59:41 -08:00
threadSafety.h XQuartz: Cleaned up startup and thread creation a tad. 2008-04-26 19:21:05 -07:00
X11Application.h XQuartz: Controller thread launches clients 2009-11-05 18:34:50 -08:00
X11Application.m XQuartz: clang static analysis fixes 2010-02-15 15:03:49 -08:00
X11Controller.h XQuartz: Buildfix for Leopard and older 2009-11-11 18:00:19 -08:00
X11Controller.m XQuartz: Cleanup X11Controller.m compilation warnings. 2009-11-05 18:34:50 -08:00