summaryrefslogtreecommitdiff
path: root/composite
diff options
context:
space:
mode:
authorRami Ylimaki <ext-rami.ylimaki@nokia.com>2010-01-28 11:08:34 +0200
committerKeith Packard <keithp@keithp.com>2010-02-17 23:20:52 -0800
commit5b9a52be7e975e59e0bbc6b43539ecaff96b2ecd (patch)
treed042a732e1bf0589040deb340148b431e41f9298 /composite
parentca364ca82a760d8e5347a6f9f79636c9a5e4e03f (diff)
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>
Diffstat (limited to 'composite')
-rw-r--r--composite/compwindow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/composite/compwindow.c b/composite/compwindow.c
index c10cb9ee9..f2f6ea3cd 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -205,7 +205,7 @@ compPositionWindow (WindowPtr pWin, int x, int y)
#ifdef COMPOSITE_DEBUG
if ((pWin->redirectDraw != RedirectDrawNone) !=
(pWin->viewable && (GetCompWindow(pWin) != NULL)))
- abort ();
+ OsAbort ();
#endif
if (pWin->redirectDraw != RedirectDrawNone)
{