Bug 12291

Summary: Crash when leaving Xserver 1.3.99
Product: xorg Reporter: Brice Goglin <brice.goglin>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: jiang.he
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 8888    
Attachments:
Description Flags
Check whether fd == -1 before doing stuff in RemoveGeneralSocket
none
check for fd == -1 before calling RemoveGeneralSocket none

Description Brice Goglin 2007-09-05 11:18:19 UTC
With Xserver 1.3.99.0 (or .2), run 'startx /usr/bin/xterm' and then hit <ctrl-d> in the terminal. X will try to exit, but fail to restore the VT console, because it crashes. The backtrace is not always the same, sometimes in RemoveGeneralSocket, sometimes in ResetPicturePrivateIndex, FreeScreenSaverTimer, ... whatever.

I talked to daniels on IRC who told me the fix was just to test whether fd is -1 is RemoveGeneralSocket. So I applied the following patch and couldn't get the crash to occur anymore.

Brice
Comment 1 Brice Goglin 2007-09-05 11:19:33 UTC
Created attachment 11436 [details] [review]
Check whether fd == -1 before doing stuff in RemoveGeneralSocket
Comment 2 Julien Cristau 2007-09-06 13:25:11 UTC
Created attachment 11453 [details] [review]
check for fd == -1 before calling RemoveGeneralSocket

The consensus on irc seemed to be that the check for fd == -1 should be done in dbus-core.
Comment 3 Julien Cristau 2007-09-11 02:29:42 UTC
*** Bug 12389 has been marked as a duplicate of this bug. ***
Comment 4 Julien Cristau 2007-09-20 17:36:09 UTC
Fixed on master:
commit 3a965fdadccea7beff09a28c9c0ef4b4975eae38
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Thu Sep 20 16:22:24 2007 -0700

    Don't segfault on shutdown if we never managed to connect to dbus.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.