Bug 14444 - Xorg crash when changing backlight properties on text console.
Summary: Xorg crash when changing backlight properties on text console.
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/DDX/Xorg (show other bugs)
Version: 7.3 (2007.09)
Hardware: Other All
: medium normal
Assignee: Jesse Barnes
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2008-02-09 04:50 UTC by Raúl
Modified: 2008-03-17 08:34 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg log (70.39 KB, text/plain)
2008-02-09 04:50 UTC, Raúl
no flags Details
test patch (759 bytes, patch)
2008-02-09 09:58 UTC, Wang Zhenyu
no flags Details | Splinter Review
Check for VT sema in RandR set property code (497 bytes, patch)
2008-03-06 14:43 UTC, Jesse Barnes
no flags Details | Splinter Review
Check for VT sema in RandR set property code (2.11 KB, patch)
2008-03-06 16:08 UTC, Jesse Barnes
no flags Details | Splinter Review
YAVTSP (yet another vt sema patch) (499 bytes, patch)
2008-03-06 16:50 UTC, Jesse Barnes
no flags Details | Splinter Review
Check for VT sema in randr crtc set function (814 bytes, patch)
2008-03-13 09:31 UTC, Jesse Barnes
no flags Details | Splinter Review

Description Raúl 2008-02-09 04:50:24 UTC
Created attachment 14234 [details]
Xorg log

Hello:

  I wanted to change xserver backlight settings using xrandr on a text console. I did this:

  DISPLAY=:0 xrandr --output LVDS --set BACKLIGHT_CONTROL native

  This is a toshiba satellite laptop, amd64, intel 965GM with Debian unstable, 2.6.24, xserver 2:1.4.1~git20080131-1, intel driver git 20080203.

  I know this is not a very common way to do it, but xserver crashed with this backtrace.

#0  XkbEnableDisableControls (xkbi=0x190, change=<value optimized out>,
    newValues=<value optimized out>, changes=0x0, cause=0x7fff9c459890) at ../../xkb/xkbUtils.c:748
#1  0x0000000000540759 in XkbRemoveResourceClient (inDev=0x87ea10, id=<value optimized out>)
    at ../../xkb/xkbEvents.c:1038
#2  0x000000000044735b in CloseDevice (dev=0x87ea10) at ../../dix/devices.c:604
#3  0x000000000044754f in CloseDownDevices () at ../../dix/devices.c:626
#4  0x000000000056a643 in AbortServer () at ../../os/log.c:405
#5  0x000000000056ac95 in FatalError (f=0x5738a8 "Caught signal %d.  Server aborting\n")
    at ../../os/log.c:552
#6  0x00000000004756d9 in xf86SigHandler (signo=11)
    at ../../../../hw/xfree86/common/xf86Events.c:766
#7  <signal handler called>
#8  0x00002b370fb78deb in memcpy () from /lib/libc.so.6
#9  0x00000000004af303 in xf86_crtc_convert_cursor_to_argb (crtc=0x2b3712d44000,
    src=0x955710 "?�������") at ../../../../hw/xfree86/modes/xf86Cursors.c:216
#10 0x00000000004afd67 in xf86_load_cursor_image (scrn=<value optimized out>,
    src=0x955710 "?�������") at ../../../../hw/xfree86/modes/xf86Cursors.c:438
#11 0x00000000004af997 in xf86_reload_cursors (screen=0x8300f0)
    at ../../../../hw/xfree86/modes/xf86Cursors.c:614
#12 0x00002b37117c0ebc in i830_crtc_commit (crtc=0x8067a0) at ../../src/i830_display.c:928
#13 0x00000000004aeb2e in xf86CrtcSetMode (crtc=0x8067a0, mode=0x7fff9c45a280,
---Type <return> to continue, or q <return> to quit---
    rotation=<value optimized out>, x=0, y=0) at ../../../../hw/xfree86/modes/xf86Crtc.c:312
#14 0x00000000004b298c in xf86RandR12CrtcSet (pScreen=<value optimized out>, randr_crtc=0x84d2d0,
    randr_mode=0x8490d0, x=0, y=0, rotation=16384, num_randr_outputs=1, randr_outputs=0x84e870)
    at ../../../../hw/xfree86/modes/xf86RandR12.c:777
#15 0x000000000051a90f in RRCrtcSet (crtc=0x84d2d0, mode=0x8490d0, x=0, y=0, rotation=1,
    numOutputs=1, outputs=0x84e870) at ../../randr/rrcrtc.c:300
#16 0x000000000051b012 in ProcRRSetCrtcConfig (client=0x15f1490) at ../../randr/rrcrtc.c:833
#17 0x000000000044e3b0 in Dispatch () at ../../dix/dispatch.c:502
#18 0x0000000000436b8d in main (argc=8, argv=0x7fff9c45aa58, envp=<value optimized out>)
    at ../../dix/main.c:452
Comment 1 Raúl 2008-02-09 04:51:15 UTC
I forgot to say I'm not using any framebuffer driver or mode for text consoles.
Comment 2 Wang Zhenyu 2008-02-09 09:58:07 UTC
Created attachment 14242 [details] [review]
test patch

It seems to access cursor memory which is unbound in VT switch. Above is experimental patch.
Comment 3 Raúl 2008-02-10 03:07:36 UTC
Thanks for the patch!

It has worked! I issued the same command using the git patched drivers, and well, I had a screen mixing a garbled Xorg picture and text console, but then I changed to vt7 (where Xorg is running) and it looked fine, then changed to vt6(text console) and it looked fine as well.

So from my POV this is fixed.
Comment 4 Julien Cristau 2008-02-10 03:17:01 UTC
(In reply to comment #3)
> So from my POV this is fixed.
> 
please don't mark bugs as fixed until they're actually fixed in git, as opposed to having a patch in bugzilla. thanks.
Comment 5 Raúl 2008-02-10 09:31:36 UTC
I don't know if it's worth the noise, but I wanted to say sorry. Now I know.
Comment 6 Wang Zhenyu 2008-02-11 07:58:22 UTC
yeah, I don't think we should do like this test patch, but inhibit such behavior much earlier, although currently I have no idea where to do this. But this should be a low priority thing any way.
Comment 7 Gordon Jin 2008-02-14 00:22:11 UTC
Jesse, do you have idea?
Comment 8 Jesse Barnes 2008-02-14 09:32:48 UTC
Yeah, I agree with Zhenyu.  We've had other problems occur when apps try to access X services while the server has been VT switched, this probably isn't the only one.  Keith may have some ideas here...
Comment 9 Jesse Barnes 2008-03-06 14:43:30 UTC
Created attachment 14899 [details] [review]
Check for VT sema in RandR set property code

Raul, can you check that this works for you?  It would be good to get this fixed for the 1.5 server release...
Comment 10 Jesse Barnes 2008-03-06 14:44:30 UTC
I think this is really a server bug...
Comment 11 Jesse Barnes 2008-03-06 16:08:48 UTC
Created attachment 14900 [details] [review]
Check for VT sema in RandR set property code

Oops, should have tried that last patch before posting it.  I think this one will work...
Comment 12 Jesse Barnes 2008-03-06 16:50:35 UTC
Created attachment 14901 [details] [review]
YAVTSP (yet another vt sema patch)

Assuming it works, this is the one I'd actually like to push.
Comment 13 Jesse Barnes 2008-03-11 17:52:27 UTC
Raul, any chance you can test the last patch I attached to this bug the other day?
Comment 14 Raúl 2008-03-12 00:42:32 UTC
Jesse, sorry for the low responsivity. I took a look at your patch some days ago, but provided I need to do some settings to get a valid xserver build environment I lowed priority to this. To be completely honest, I'm living a vacation period away of any computer not inside my working office and hence I'd take some time to come back to "normal" activity.

I still read the e-mail from time to time, so if you still think that this issue is somewhat important for the project I may do some effort to test it. If so just comment.

Thanks.
Comment 15 Jesse Barnes 2008-03-12 11:08:23 UTC
Thanks Raul, maybe we can reproduce this in-house.

Nian, is this something you can reproduce?  If so, can you try the patch in this bug to see if it fixes the problem?
Comment 16 Jesse Barnes 2008-03-12 11:08:33 UTC
Thanks Raul, maybe we can reproduce this in-house.

Nian, is this something you can reproduce?  If so, can you try the patch in this bug to see if it fixes the problem?
Comment 17 Jesse Barnes 2008-03-12 11:08:55 UTC
Oops, accidentally reassigned.
Comment 18 WuNian 2008-03-13 01:52:34 UTC
Hi, Jesse,
The patch does not work for me on GM965. X still crashed.
Comment 19 Jesse Barnes 2008-03-13 09:31:39 UTC
Created attachment 15093 [details] [review]
Check for VT sema in randr crtc set function

Oops, I should have looked at the backtrace before posting that last one.  Can you give this patch a try?
Comment 20 WuNian 2008-03-16 19:54:57 UTC
Good, the patch works for me. And the command works:
xrandr --output LVDS --set BACKLIGHT_CONTROL native
Comment 21 Jesse Barnes 2008-03-17 08:34:42 UTC
Fixed in commit bee2ddf35f75086cee951142098637f2c756b96b.


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.