Bug 1539 - Switching to a console terminal crashes X
Summary: Switching to a console terminal crashes X
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 1
Hardware: x86_64 Linux
Priority: Normal major
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2011-06-03 02:23 CEST by Juan Luis Baptiste
Modified: 2011-12-07 11:55 CET (History)
3 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments
Xorg log from the crash (45.67 KB, text/plain)
2011-06-03 02:24 CEST, Juan Luis Baptiste
Details
bug trace file (1.13 KB, text/plain)
2011-10-20 07:33 CEST, Juan Luis Baptiste
Details

Description Juan Luis Baptiste 2011-06-03 02:23:30 CEST
Description of problem:

When switching back and forth from an X session to a console terminal, X server will crash. The same happens when opening krandtray.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Login into KDE for example
2. Press ctrl alt F1 to go to a console terminal
3. Press ctrl alt F8 to go back to the X session
4. See how the X server restarts.
Comment 1 Juan Luis Baptiste 2011-06-03 02:24:45 CEST
Created attachment 511 [details]
Xorg log from the crash

Attached the log from the X server when the crash occured.
Comment 2 Juan Luis Baptiste 2011-06-03 02:27:42 CEST
I forgot to mention my hardware:

Dell Vostro 3550 with Intel iCore 5 with hybrid graphics, Intel + Ati Radeon 6600 HD:

00:02.0 VGA compatible controller: Intel Corporation Sandy Bridge Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: ATI Technologies Inc NI Whistler [AMD Radeon HD 6600M Series]
Thomas Backlund 2011-06-03 09:30:59 CEST

Attachment 511 mime type: application/octet-stream => text/plain

Comment 3 D Morgan 2011-06-03 10:03:16 CEST
from comment #1: 

Backtrace:
[   304.023] 0: /etc/X11/X (xorg_backtrace+0x28) [0x4a07b8]
[   304.023] 1: /etc/X11/X (0x400000+0x60fe9) [0x460fe9]
[   304.023] 2: /lib64/libpthread.so.0 (0x7f1951f5a000+0xf300) [0x7f1951f69300]
[   304.023] 3: /etc/X11/X (xf86SetScrnInfoModes+0x268) [0x4875c8]
[   304.023] 4: /etc/X11/X (0x400000+0x8f60c) [0x48f60c]
[   304.023] 5: /etc/X11/X (RRGetInfo+0x8f) [0x4c471f]
[   304.023] 6: /etc/X11/X (xf86Wakeup+0x3d8) [0x46af28]
[   304.023] 7: /etc/X11/X (WakeupHandler+0x4b) [0x431a9b]
[   304.023] 8: /etc/X11/X (WaitForSomething+0x1bc) [0x45a48c]
[   304.023] 9: /etc/X11/X (0x400000+0x2d6f2) [0x42d6f2]
[   304.023] 10: /etc/X11/X (0x400000+0x218ee) [0x4218ee]
[   304.023] 11: /lib64/libc.so.6 (__libc_start_main+0xfd) [0x7f1950ec7c3d]
[   304.023] 12: /etc/X11/X (0x400000+0x21499) [0x421499]
[   304.023] Segmentation fault at address (nil)
[   304.023] 
Fatal server error:
[   304.023] Caught signal 11 (Segmentation fault). Server aborting
[   304.023] 
[   304.023] 
Please consult the The X.Org Foundation support 
	 at http://bugs.mageia.org
 for help. 
[   304.023] Please also check the log file at "/var/log/Xorg.0.log" for additional information.

CC: (none) => dmorganec

Comment 4 Juan Luis Baptiste 2011-06-07 05:01:08 CEST
This has got worse, X randomly crashes with the same backtrace, just minutes after having logged in. In the past half hour it has crashed at least five times !! this make mageia unsuable.
Comment 5 Juan Luis Baptiste 2011-06-07 06:04:32 CEST
Installing the fglrx driver makes things worse, when using that driver the laptop freezes completely (no X restart) leaving a stack trace on the screen with no more option that force shutdown and turn it on again.
Comment 6 Thierry Vignaud 2011-06-09 15:58:56 CEST
Why do you load both intel & ati drivers?

CC: (none) => thierry.vignaud

Comment 7 Juan Luis Baptiste 2011-06-09 16:02:32 CEST
It's a laptop with hybrid graphics, both are getting loaded by default.
Manuel Hiebel 2011-07-27 19:10:33 CEST

Source RPM: (none) => x11-server

Comment 8 Thierry Vignaud 2011-07-29 16:39:48 CEST
Before saying it's x11-server who's buggy, we need to have a proper usable trace please:
1) enable Core*Debug media
2) install glibc-debug, x11-server-debug, x11-driver-video-ati-debug &
   x11-driver-video-intel-debug
3) get both https://bugs.mageia.org/attachment.cgi?id=121 &
   https://bugs.mageia.org/attachment.cgi?id=122
4) Just run "sh ./Xgdb2.sh" on a text terminal, then switch back
   to X11 until it segfaults.
5) attach the generated bug trace (it should be named something
   like "X.gdb.<some_random_PID_number>.txt"
Comment 9 Manuel Hiebel 2011-07-29 16:58:05 CEST
sorry thierry, indeed

Source RPM: x11-server => (none)

Comment 10 Juan Luis Baptiste 2011-08-03 06:38:24 CEST
There are some typos on the file, the X org binary is wrong, it's X instead of Xorg and because of that the Xgdb2.sh script fails. Also the command files in that script is missing the .txt extension. After fixing that, when the script is run on a text terminal it hangs trying to attach to X:

Attaching to program: /usr/bin/Xorg, process 1158

and never attaches, leaving an empty debug file after reboot. If I run the debug command on Xgdb2.sh script while on the X session then it will successfully attach to X binary.
Comment 11 Thierry Vignaud 2011-08-03 07:15:09 CEST
Because you're wrong, it's not typo as you would have found if you'd try comparing 'pidof X' and 'pidof Xorg'
The same way, Xgdb2 doesn't look for .txt for the command files...
Comment 12 Juan Luis Baptiste 2011-08-03 07:35:27 CEST
No, I'm not wrong:

[root@dci-laptop mageia]# pidof Xorg
[root@dci-laptop mageia]# pidof X
1112

and if I leave the -x parameter without the .txt extension:


[root@dci-laptop mageia]# gdb -x gcmds2 Xorg $(pidof Xorg)
GNU gdb (GDB) 7.1-6.mga1 (Mageia release 1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-mageia-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/Xorg...Reading symbols from /usr/lib/debug/usr/bin/Xorg.debug...done.
done.
gcmds2: No such file or directory.
(gdb) 


If I add the .txt then:

[root@dci-laptop Downloads]# gdb -x gcmds2.txt Xorg $(pidof Xorg)
GNU gdb (GDB) 7.1-6.mga1 (Mageia release 1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-mageia-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/Xorg...Reading symbols from /usr/lib/debug/usr/bin/Xorg.debug...done.
done.
/home/mageia/Downloads/gcmds2.txt:4: Error in sourced command file:
The program is not being run.

but if I also change "Xorg" for "X":

[root@dci-laptop Downloads]# gdb -x gcmds2.txt X $(pidof X)                                                                     
GNU gdb (GDB) 7.1-6.mga1 (Mageia release 1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-mageia-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/X...Reading symbols from /usr/lib/debug/usr/bin/Xwrapper.debug...done.
done.
Attaching to program: /usr/bin/X, process 1162
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x00007f648edb3da1 in ?? ()
[...]

You see ? in that case gdb successfully attaches to X binary, but just when ran under the X session, not from a text terminal.

So there's something wrong with the script.
Comment 13 Thierry Vignaud 2011-08-03 08:45:59 CEST
b/c you wrongly saved gcmds as gcmds.txt
And pidof X returns nothing here whereas pidof Xorg returns the right pid.
And quite a lot of people haved used this script the way I've written it.
I guess you're not starting X the usual way.
Comment 14 Juan Luis Baptiste 2011-08-03 15:10:23 CEST
I renamed gcmds2 to gmds2.txt because as I show to you in my previous comment I get an error of "gcmds2: No such file or directory" on gdb if I leave it as it is. Also as you should have seen too on my previous comment, for me, pidof Xorg returns nothing, pidof X is the one that actually works. 

This is a vanilla Mageia installation, the only extra package I have installed is the fglrx driver, and I'm starting X the way it starts as default.
Comment 15 Manuel Hiebel 2011-10-03 01:20:33 CEST
[manu@vosdook ~]$ ps -A | grep X
  986 tty7     00:46:58 Xorg
....

Keywords: (none) => NEEDINFO

Comment 16 Manuel Hiebel 2011-10-04 15:04:18 CEST
(if no response in 1month, we will close this bug)

Whiteboard: (none) => check

Comment 17 Juan Luis Baptiste 2011-10-04 17:07:48 CEST
I already responded, the provided debug instructions don't work so I as the reported can't do much to help.
Manuel Hiebel 2011-10-04 18:17:42 CEST

Whiteboard: check => (none)

Comment 18 andré blais 2011-10-10 02:10:19 CEST
Is by any chance that this problem is related to bug 2294 ?
("nautilus does not invoke application associated with ordinary files")

I note that the error message cited in comments #12 & 14 is essentially the same:
"gcmds2: No such file or directory"
(Except for the file name, of course.)

As well, the problem here also seems to be due to an existing file not being found.
Strange though that adding ".txt" made the file findable.

CC: (none) => andre999mga

Comment 19 Juan Luis Baptiste 2011-10-10 05:26:25 CEST
This has nothing to do with your problem. This is about X crashing with systems that have hybrid graphic cards, not with a file not being found. That error is about the run of a debug script for this problem, but it has nothing to do with it it self.
Comment 20 Juan Luis Baptiste 2011-10-10 05:27:30 CEST
Upgraded my laptop to cauldron with the hope that the latest xorg 1.11.1 fixed the problem but it doesn't. X still crashes when switching to a console.
Comment 21 Juan Luis Baptiste 2011-10-20 07:32:15 CEST
Ok, I reviewed this again and was able to run the debug script, but the initial Xgdb2.sh script was indeed wrong, I got it working by changing Xorg for X as mentioned before.

I'm attaching the generated trace file but I'm not sure it will be of any help.
Comment 22 Juan Luis Baptiste 2011-10-20 07:33:09 CEST
Created attachment 980 [details]
bug trace file
Comment 23 Juan Luis Baptiste 2011-10-30 03:49:40 CET
(In reply to comment #20)
> Upgraded my laptop to cauldron with the hope that the latest xorg 1.11.1 fixed
> the problem but it doesn't. X still crashes when switching to a console.

Sorry, when I said here 1.11.1 I was wrong, it was 1.10.4. I installed today 1.11.1 from core/updates_testing and the crash is gone (also with some painting problems with icons).

So this bug can be closed when xserver 1.11.1 is moved to core/release.
Comment 24 Manuel Hiebel 2011-12-07 11:55:11 CET
(In reply to comment #23)
> (In reply to comment #20)
> > Upgraded my laptop to cauldron with the hope that the latest xorg 1.11.1 fixed
> > the problem but it doesn't. X still crashes when switching to a console.
> 
> Sorry, when I said here 1.11.1 I was wrong, it was 1.10.4. I installed today
> 1.11.1 from core/updates_testing and the crash is gone (also with some painting
> problems with icons).
> 
> So this bug can be closed when xserver 1.11.1 is moved to core/release.

Ok thanks.

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.