Bug 11237 - server shutdown crashes and leaves corrupted consoles
Summary: server shutdown crashes and leaves corrupted consoles
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/savage (show other bugs)
Version: 7.2 (2007.02)
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard:
Keywords:
: 11496 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-11 14:02 UTC by Tormod Volden
Modified: 2007-07-11 18:16 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.0.log after ctrl-alt-backspace (41.66 KB, text/plain)
2007-06-11 14:26 UTC, Tormod Volden
no flags Details
xorg.conf (Debian sid/lenny) (2.97 KB, text/plain)
2007-06-11 14:28 UTC, Tormod Volden
no flags Details
gdb session when X server crashes at shutdown (8.15 KB, text/plain)
2007-06-28 14:25 UTC, Tormod Volden
no flags Details
another gdb session (8.96 KB, text/plain)
2007-06-28 15:11 UTC, Tormod Volden
no flags Details
workaround: checks for valid ShadowVirtual (627 bytes, patch)
2007-07-07 02:42 UTC, Tormod Volden
no flags Details | Splinter Review

Description Tormod Volden 2007-06-11 14:02:55 UTC
Originally I filed this in Debian, it's the same in Ubuntu.

After logging out from the X session and the server restarts (or resets) with a couple of mode switching flashes, the virtual consoles are broken.

Savage Twister, linux 2.6.22rc2, xorg-server 1.3, savage 2.1.2
Comment 1 Tormod Volden 2007-06-11 14:26:41 UTC
Created attachment 10257 [details]
Xorg.0.log after ctrl-alt-backspace

They also get corrupted if quit the session with ctrl-alt-backspace.
Comment 2 Tormod Volden 2007-06-11 14:28:23 UTC
Created attachment 10258 [details]
xorg.conf (Debian sid/lenny)
Comment 3 Marc Gasnot 2007-06-14 12:24:43 UTC
I have exactly the same problem with a SuperSavage chipset (IBM ThinkPad T23) and Debian testing since xorg was updated to 7.2. There's no special need to add my xorg.0.log and xorg.conf because they are quite identical to those that are already presenred here - unless you really need it.

My configuration:
SuperSavage, linux 2.6.18, xorg-server 1.3, savage 2.1.2

the drm.ko and savage.ko modules are already broken on 2.6.18 kernel with xorg above 7.0, but I use a git recompiled version that worked correctly with 7.1.

Another problem that came with this vesion is that X crashes when a program try to change the screen resolution, like fullscreen games. In this case, the X server is entierly restarted and the virtual consoles are also broken.
I don't know if it is another bug, but it seems to be related anyway.
Comment 4 Marc Gasnot 2007-06-21 23:17:51 UTC
I'm here for a little correction: I discovered that the X crash when changing screen resolution doesn't always brake the virtual consoles, so I think it is really another bug. Sorry  for the flood...
Comment 5 Tormod Volden 2007-06-24 06:22:47 UTC
I think it is related / a consequence that the X server starts up on a new VT each time (vt7, vt8, vt9, vt10...).
Comment 6 Tormod Volden 2007-06-28 14:25:13 UTC
Created attachment 10494 [details]
gdb session when X server crashes at shutdown

I think the gdb output indicates some stale psav pointers.
Comment 7 Tormod Volden 2007-06-28 15:11:11 UTC
Created attachment 10495 [details]
another gdb session

This trace was with NoTrapSignal, which avoided the second segfault which came when the server aborted. I also printed more variables.
Comment 8 Tormod Volden 2007-07-05 13:36:24 UTC
Some more instances of this in https://bugs.launchpad.net/bugs/123134 and its duplicates.

This could be related to bug #11354.
Comment 9 Tormod Volden 2007-07-06 02:16:17 UTC
This is my analysis from looking at the source:

SavageCloseScreen() first calls SAVAGEDRICloseScreen() which zeroes out these variables:
   psav->ShadowVirtual = NULL;
   psav->ShadowPhysical = 0;

Then later it calls SavageWriteMode() ->  SavageGEReset() which through:
        if (!from_timeout)
            psav->WaitIdleEmpty(psav);

calls ShadowWait which fatally tries to access psav->ShadowVirtual

But I am not sure which steps are wrong and should be fixed...
Comment 10 Tormod Volden 2007-07-06 02:30:23 UTC
Small correction: Given the uninitialized value of r at the time of crash, the calling line in SavageGEReset() is rather this one (I have to trace on the machine when I get to it to confirm):

    } else
        psav->WaitIdleEmpty(psav);

Comment 11 Tormod Volden 2007-07-07 02:42:53 UTC
Created attachment 10613 [details] [review]
workaround: checks for valid ShadowVirtual

This is a workaround, that keeps the server from crashing and borking the consoles. It returns from ShadowWait if there is no ShadowVirtual pointer. 
But I think ShadowWait should not have been called in the first place.
Comment 12 Alex Deucher 2007-07-11 18:01:20 UTC
thanks for tracking this down.  fixed.
7832dcd82046238d5accb55468c65241f0edc6d0
Comment 13 Alex Deucher 2007-07-11 18:16:10 UTC
*** Bug 11496 has been marked as a duplicate of this bug. ***


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.