Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Recover from console login

  1. #1

    Default Recover from console login

    I'm trying to debug a game with gdb. The game runs in fullscreen and causes
    a segmentation fault and then gives control back to gdb. However, since the
    game is in fullscreen, the gdb session can't be viewed. So, at this point I
    did CTRL-ALT-F6 which blanks the screen and gives me a console to login
    with. I do this and determine the PID of the game process and kill it. This
    should remove the x-window the game was using and leave the gdb session
    on my gnome-terminal. I then exit the console login, which leaves me at
    a console login prompt.

    Now is the problem. How do I return back to my gnome-terminal gdb
    session, ie, how do I recover from my console login? Via email, somebody
    informed me that CTRL-ALT-F9 works for him, but it does not for me. In
    fact, I've tried CTRL-ALT-<every function key> and nothing works for me.
    The only thing for me to do at this point is to kill the power.

    Any ideas?

    (BTW, the game must be debugged in fullscreen because the problem
    goes away when not in fullscreen.)

    I'm running openSUSE 11.3 32-bit.

    Thanks

    Ron

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,670
    Blog Entries
    15

    Default Re: Recover from console login

    Hi
    Ctrl+Alt+F7 will get you back.... try it without the game running.

    F1 - F6 are VT's (console logins), F7 GUI (although it can be F8), F10 are kernel messages.

    Press ctrl+alt+backspace twice to restart the X server

    Go to a console login and login as root and run;
    Code:
    init 3
    init 5 && exit
    will restart X completely.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,050

    Default Re: Recover from console login

    On Fri, 18 Feb 2011 20:06:01 +0000, rderosier wrote:

    > (BTW, the game must be debugged in fullscreen because the problem goes
    > away when not in fullscreen.)


    If it doesn't crash on startup, try launching it, and then switch to the
    console and connect gdb to the process using:

    gdb --pid [pidnumber]

    You could also do this over ssh from a remote system.

    Another option would be to launch screen in a terminal window and then
    launch the program from within screen (in my experience, if you start
    screen in a terminal window, it'll use the X display unless you unset the
    DISPLAY variable). Then you could go to the console after the crash and
    use:

    screen -r -d

    to reconnect to the screen session to view the gdb output.

    Jim
    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  4. #4

    Default Re: Recover from console login

    Malcolm,

    > Ctrl+Alt+F7 will get you back.... try it without the game running.

    As I said in the original post, Ctrl+Alt+F7 did nothing. However,
    since you asked me to "try it", I did the following:
    1. opened gnome-terminal
    2. ctrl+alt+f6
    3. at console login prompt did ctrl+alt+f7 and nothing happened

    > Press ctrl+alt+backspace twice to restart the X server

    I did this just in a gnome-terminal and my whole screen
    blanked and blinked a couple of times and logged me out.
    I was then presented a normal login window. I can see
    how this keeps me from killing the power to recover, and
    maybe that's what you were trying to point out (and if
    so, thanks for the info). Hopefully, this suggestion didn't
    have anything to do with trying to get me back to my
    gdb session?

    I haven't tried your "Code" instructions yet and I'm afraid
    to, thinking it will log me out again, and what you already
    told me will do that. So, what's the purpose of the "Code"
    instructions. Will it get me back to my gdb session?

    Thanks

    Ron

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,670
    Blog Entries
    15

    Default Re: Recover from console login

    Hi
    Try using F8 then, using the command;
    [CODE]
    ps -ef |grep vt
    or
    ps -ef |grep "/usr/bin/X"
    [/CODE}
    will show you the vt (Virtual Terminal) it's running on.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  6. #6

    Default Re: Recover from console login

    Jim,

    > Another option would be to launch screen in a terminal window and then
    > launch the program from within screen (in my experience, if you start
    > screen in a terminal window, it'll use the X display unless you unset the
    > DISPLAY variable). Then you could go to the console after the crash and
    > use:
    >
    > screen -r -d
    >
    > to reconnect to the screen session to view the gdb output.

    This worked in connecting me to my gdb session and finding out where
    the sigsegv was coming from. THANKS!

    But, again, I found myself still in a console login and no way to recover
    from it without killing the power.

  7. #7

    Default Re: Recover from console login

    Malcolm,

    > Hi
    > Try using F8 then, using the command;
    > [CODE]
    > ps -ef |grep vt
    > or
    > ps -ef |grep "/usr/bin/X"
    > [/CODE}
    > will show you the vt (Virtual Terminal) it's running on.

    I know you are trying to help me, and I REALLY appreciate that!
    However, telling me to try F8 doesn't help when I've already stated
    that NO function key with Ctrl-Alt works for me. (I did however try
    Ctrl-Alt-F8 as you asked, and it did not work.) I don't understand
    what you wanted me to do with the rest of what's above. But, I
    did ps -ef | grep vt and it showed /usr/bin/Xorg ... tcp vt7 was
    running on tty7 owned by root.

    Again I found myself with no way to recover from the console, so
    I tried your Ctrl-Alt-Backspace twice again, but this time it didn't
    do anything.

    > init 3
    > init 5 && exit

    So, I thought I would test your suggestion of executing the above code as root.
    I logged out as myself and back in as root. As soon as I typed "init 3" the screen
    changed to the normal openSUSE background that one sees when it reboots with
    all the stuff on the left-hand side and the words "done" on the right-hand side.
    And it left me at a login prompt. I logged in again as root which took me back to
    the same console session that I had entered "init 3" (it was already on the screen).
    So, I typed "init 5 && exit" and the screen blanked and actually took me back to
    my login session where I ran gdb, but with all windows closed. So, this seems to
    recover from a console login without the need to kill the power. However, this
    behaved so oddly to me, that I tried it a second time and when I did Ctrl-Alt-F6,
    it took me back to the same root console login with both "init 3" and "init 5 && exit"
    still on the screen. ODD! Anyway, I type "init 3" again and we went on the same
    journey as before. Is this the behavior you expected?

    Thanks

    Ron

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,670
    Blog Entries
    15

    Default Re: Recover from console login

    Hi
    So vt7 = F7 then there are issues with the keyboard. Can you try an alternate keyboard to see if it follows?

    init 3 is no X running multiuser, network etc init 5 is with gdm, X running etc. The exit command just logs out of the root console session as well.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: Recover from console login

    On 02/18/2011 09:06 PM, rderosier wrote:
    >
    > I've tried CTRL-ALT-<every function key> and nothing works


    hardware fault or bad/burned out keyboard controller module on the
    motherboard/in the USB system..

    try to sub in a known good keyboard..

    --
    DenverD
    CAVEAT: http://is.gd/bpoMD
    [NNTP posted w/openSUSE 11.3, KDE4.5.5, Thunderbird3.0.11, nVidia
    173.14.28 3D, Athlon 64 3000+]
    "It is far easier to read, understand and follow the instructions than
    to undo the problems caused by not." DD 23 Jan 11

  10. #10

    Default Re: Recover from console login

    Quote Originally Posted by malcolmlewis View Post
    Hi
    So vt7 = F7 then there are issues with the keyboard. Can you try an alternate keyboard to see if it follows?

    init 3 is no X running multiuser, network etc init 5 is with gdm, X running etc. The exit command just logs out of the root console session as well.
    Sorry, 1 computer 1 keyboard. However, for what it's worth, I have an Apple Macintosh computer/keyboard.
    I have my Intel Mac set up as a dual-boot system for Mac OS X and Linux.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •