Bug 90230 - intel driver hangs in waitpid() for backlight helper process on output hotplug
Summary: intel driver hangs in waitpid() for backlight helper process on output hotplug
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-29 09:16 UTC by Olivier Fourdan
Modified: 2015-04-29 09:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Olivier Fourdan 2015-04-29 09:16:29 UTC
Using Fedora 22, when undocking/docking my laptop with an external monitor attached to the docking station, Xorg will hang on waitpid() for the backlight helper process.

Backtrace shows that the PID is -1:

#0  0x00007feccda90f3b in __GI___waitpid (pid=-1, stat_loc=stat_loc@entry=0x0, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
#1  0x00007fecc8601e58 in backlight_close (b=b@entry=0x97c8c8) at backlight.c:522
#2  0x00007fecc864b85a in sna_output_destroy (output=output@entry=0x97c960) at sna_display.c:3202
#3  0x00007fecc864f1e4 in sna_output_add (sna=sna@entry=0x7feccfeed000, id=<optimized out>, serial=serial@entry=5) at sna_display.c:3944
#4  0x00007fecc8651f21 in sna_mode_discover (sna=sna@entry=0x7feccfeed000) at sna_display.c:4211
#5  0x00007fecc8658198 in sna_handle_uevents (fd=<optimized out>, closure=0x7feccfeed000) at sna_driver.c:771
#6  0x00000000004799e7 in xf86Wakeup (blockData=<optimized out>, err=<optimized out>, pReadmask=0x836360 <LastSelectMask>) at xf86Events.c:284
#7  0x000000000043ee0d in WakeupHandler (result=result@entry=2, pReadmask=pReadmask@entry=0x836360 <LastSelectMask>) at dixutils.c:423
#8  0x0000000000592dc7 in WaitForSomething (pClientsReady=pClientsReady@entry=0x14189c0) at WaitFor.c:229
#9  0x0000000000439fd1 in Dispatch () at dispatch.c:361
#10 0x000000000043e2fb in dix_main (argc=15, argv=0x7ffd512ec9a8, envp=<optimized out>) at main.c:298
#11 0x00007feccd9e9790 in __libc_start_main (main=0x4286f0 <main>, argc=15, argv=0x7ffd512ec9a8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7ffd512ec998) at libc-start.c:289
#12 0x0000000000428729 in _start ()

It could be a Fedora 22 issue with SElinux (I dont know) but I think it would be safer to check for (b->pid > 0) instead of just ->pid) in backlight_close so that if the PID is not initialized somehow (default value is -1), it won hang.

Will send a patch to the ML in a minute for further review/discussion...
Comment 1 Chris Wilson 2015-04-29 09:36:22 UTC
Ok, I had momentary doubts thinking this meant that your panel's output was being destroyed and was worried. However, we unconditionally call backlight_close() expecting it only to take action if a backlight is attached.

commit e7016d30f3a0ae817c77ccbd962f776ac3e7e100
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Wed Apr 29 10:33:19 2015 +0100

    backlight: Do not hang forever if helper pid is -1
    
    Backlight helper PID is set to -1 by default, if for some reason it's
    not set, we may end up with waitpid(-1, ...) which will hang forever.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90230
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>


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.