After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 648942 - segfault in at-spi-bus-launcher
segfault in at-spi-bus-launcher
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: at-spi2-core
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Li Yuan
Depends on:
Blocks:
 
 
Reported: 2011-04-29 14:08 UTC by Matthias Clasen
Modified: 2011-04-29 19:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.02 KB, patch)
2011-04-29 14:32 UTC, Matthias Clasen
accepted-commit_now Details | Review

Description Matthias Clasen 2011-04-29 14:08:12 UTC
Here is a segfault in XFlush that is happening sometimes in the gdm login session:
https://bugzilla.redhat.com/show_bug.cgi?id=699776

Looking at the code:

    Display *display = XOpenDisplay (NULL);
    if (display)
      {
        Atom bus_address_atom = XInternAtom (display, "AT_SPI_BUS", False);
        XDeleteProperty (display,
                         XDefaultRootWindow (display),
                         bus_address_atom);
      }
    XFlush (display);
    XCloseDisplay (display);

It seems fairly obvious that the XFlush and XCloseDisplay calls would be better off inside the if as well...
Comment 1 Matthias Clasen 2011-04-29 14:32:42 UTC
Created attachment 186887 [details] [review]
patch
Comment 2 Mike Gorse 2011-04-29 14:55:56 UTC
Comment on attachment 186887 [details] [review]
patch

That looks right. Thanks.




>From 5ba83f8f603bd4ae6f938f760d30cf0856a217aa Mon Sep 17 00:00:00 2001
>From: Matthias Clasen <mclasen@redhat.com>
>Date: Fri, 29 Apr 2011 10:31:02 -0400
>Subject: [PATCH] Only flush a display if we have one
>
>This was causing occasional segfaults in the gdm session.
>https://bugzilla.gnome.org/show_bug.cgi?id=648942
>---
> bus/at-spi-bus-launcher.c |    7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
>diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c
>index 0d6b4b7..9300979 100644
>--- a/bus/at-spi-bus-launcher.c
>+++ b/bus/at-spi-bus-launcher.c
>@@ -398,11 +398,12 @@ main (int    argc,
>         XDeleteProperty (display,
>                          XDefaultRootWindow (display),
>                          bus_address_atom);
>+
>+        XFlush (display);
>+        XCloseDisplay (display);
>       }
>-    XFlush (display);
>-    XCloseDisplay (display);
>   }
>-    
>+
>   if (_global_app->a11y_launch_error_message)
>     {
>       g_printerr ("Failed to launch bus: %s", _global_app->a11y_launch_error_message);
>-- 
>1.7.4.4
>