Bug 630052 - gnome-session-save does not work from F9->F14
Summary: gnome-session-save does not work from F9->F14
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-session
Version: 14
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Ray Strode [halfline]
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-03 15:35 UTC by Dan Thurman
Modified: 2012-08-16 20:13 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
: 664516 (view as bug list)
Environment:
Last Closed: 2012-08-16 20:12:55 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Proposed patch for gnome-session (3.10 KB, patch)
2010-12-20 15:24 UTC, Olivier Fourdan
no flags Details | Diff
Build the discard_hash before saving/removing state files (3.05 KB, patch)
2010-12-20 15:30 UTC, Olivier Fourdan
no flags Details | Diff

Description Dan Thurman 2010-09-03 15:35:14 UTC
Description of problem:

gnome-session-save does not work. It fails to
save desktop sessions, incorrectly collapse apps
from many workspaces into a single workspace, loses
positional placements, or simply disappears if
it was semi-successfully saved. Most apps are
not saved.

This problem has been persistent since F9 release and
went from bad to worst starting from F10 to current.

Missing button in: Systems->Preferences->Personal->Startup Applications->Options
and this is needed for positive verification of saves. Standalone
checkbox gives no positive feedback. As it is,  there is no
guarantee that a session was saved and is not known
until a user logs off or reboots.

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

2.6.34.6-47.fc13.i686
gnome-session-2.30.0-1.fc13.i686
gnome-session-xsession-2.30.0-1.fc13.i686

How reproducible:

Extremely sporadic

Steps to Reproduce:
1. gnome-session-save OR
2. Systems->Preferences->Personal->Startup Applications->Options
  
Actual results:

Most of the time, no session is saved. If somehow saved,
all/some apps disappear, apps spread across workspaces
collapse into a single workspace, or positional placement
is lost.

Expected results:

A saved session, apps restored to their original
workspaces and correctly positionally placed.

Additional info:

Need the save button in Systems->Preferences->Personal->Startup Applications->Options for positive feedback for without it, there is no positive verification if a session save was successful or not. Also needed for one-shot snapshot saves as user may not want to save all desktop apps running at the time before logging off or a forced system is reboot is issued.

Comment 1 Bernie Innocenti 2010-10-01 05:20:11 UTC
Still does not work in F14.

Is this a Fedora-specific bug or an upstream bug?

Comment 2 Olivier Fourdan 2010-12-20 15:24:10 UTC
Created attachment 469787 [details]
Proposed patch for gnome-session

I believe this is an upstream bug.

What happens is that metacity uses the same state file each time, named after the SM client-id which remains.

gnome-session removes 'old' the state file after the app has saved its state but metacity uses the same so its state file is removed by the session manager and the state is not restored (thus the position and workspace of running windows is not restored).

The problem appears with that commit upstream:

  http://git.gnome.org/browse/gnome-session/commit/?id=3e346957cebcbf9e747757d2d649329266743afc

The order of events is as follow (observed by enabling debug logs in both metacity and gnome-session):

1. Session terminating
2. Session manager sends a SaveYourself to all clients
3. metacity get SaveYouself messaage, save its state file and replies SaveYourselfDone
4. Session manager gets SaveYourselfDone
5. Session manager checks for discard_Exec in hash table in gnome-session/gsm-session-save.c gsm_session_clear_one_client()
6. Session manager does discard_exec in hash table so runs the discard_exec command thus removing the state-file in gnome-session/gsm-session-save.c gsm_session_clear_one_client()
7. Session manager adds the discard_exec to the hash table in save_one_client()

So the discard command is never found in the has (as its' empty) because the hash is populated after the removal...

gsm_session_save()
  |
  +-> gsm_session_clear_saved_session()
  |     |
  |     +-> gsm_session_clear_one_client()
  |           |
  |           +-> g_hash_table_lookup (discard_hash, discard_exec) ?
  |               FALSE => g_spawn_async (discard_exec)
  |
  +-> save_one_client()
        |
        +-> g_hash_table_insert (data->discard_hash, discard_exec, discard_exec);

The patch here attached does the things differently, it actually populates the discard_hash with the existing (old) discard commands, then save the session and removes the old discard command not found in the hash.

With this patch, gnome-session and metacity behave as expected.

Comment 3 Olivier Fourdan 2010-12-20 15:30:13 UTC
Created attachment 469789 [details]
Build the discard_hash before saving/removing state files

Updated patch (remove an unrelated comment in the code)

Comment 4 Fedora End Of Life 2012-08-16 20:13:00 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


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