Attach .xsession-errors only when crash happened in same session

Bug #869974 reported by Sebastien Bacher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
Low
Martin Pitt

Bug Description

You could look at the .xsession-errors creation date maybe for that? It would be a first step to be able to say if an issue is likely one happening on session closing reported at next login (i.e the issue date and time would be older than the login one)

Revision history for this message
Martin Pitt (pitti) wrote :

~/.xsession-errors is only created fresh by gdm and lightdm, e. g. kdm just appends (at least last time I checked). I think I'll better ask ConsoleKit:

 unix-user = '1000'
 realname = 'Martin Pitt'
 seat = 'Seat1'
 session-type = ''
 active = TRUE
 x11-display = ':0'
 x11-display-device = '/dev/tty7'
 display-device = ''
 remote-host-name = ''
 is-local = TRUE
 on-since = '2011-10-07T09:46:35.438201Z'
 login-session-id = '4294967295'

and take the on-since property.

Changed in apport (Ubuntu):
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

However, at second thought I wonder if that's really much benefit. As developer you probably are not really interested in the session time, but want to correlate it to whether a crash happened and was reported in the same or a different session (do you need that?), or whether the crash happened at logout (bug 460932). What's your particular goal here?

Changed in apport (Ubuntu):
assignee: Martin Pitt (pitti) → nobody
status: In Progress → Incomplete
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Ok, my two main motivations there are:

- being able to tell if the issue I'm looking at might have been one from previous session at logout (i.e bug #460932)

- being able to see if the XsessionErrors info we get are reveleant since those are collected when ubuntu-bug is run, if that's in the same session they are pretty much out of context for the issue

But you are right maybe I'm coming from the wrong angle and with a solution than an issue, I'm fine closing that request and opening a new bug about "the XsessionErrors infos should be collected when the issue happen, not when it's reported"

Revision history for this message
Martin Pitt (pitti) wrote :

One thing that I can implement quickly is: if the crash happened and is reported in one session, attach XSessionErrors as usual, otherwise don't attach it.

The bigger solution to that problem is to introduce a concept of hooks which run at crash time as opposed to reporting time. These should be very cheap and fast, but capturing .xsession-errors is. Can you please file another bug "attach xsession-errors at crash time"?

Revision history for this message
Sebastien Bacher (seb128) wrote :

Ok, I've opened bug #870003 for the "collect the infos when the issue happens, not when it's reported"

I think the "report only if it's the same session" would spare some confusion where the warnings don't match at all the issue reported, thanks for working on that!

Martin Pitt (pitti)
summary: - Would be nice to have the "session started" time
+ Attach .xsession-errors only when crash happened in same session
Changed in apport (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in upstream trunk r1986.

Changed in apport (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.3 KiB)

This bug was fixed in the package apport - 1.24-0ubuntu1

---------------
apport (1.24-0ubuntu1) precise; urgency=low

  * New upstream release 1.23.1:
    - apport/crashdb.py: Ensure that duplicate table only has one entry per
      report ID.
    - apport-retrace: Pass correct executable path to gdb in --gdb with
      --sandbox mode.
    - apport-retrace: Do not leave behind temporary directories on errors.
    - apport-retrace: Drop assertion failure for existance of "Stacktrace".
      This isn't present in the case of gdb crashing, and there is not much we
      can do about it. This should not break the retracer.
    - apport/report.py: Unwind XError() from stack traces for the
      "StacktraceTop" field, as they take a significant part of the trace.
      This causes bugs to be duplicated which really have different causes.
  * New upstream release 1.24:
   - apport-retrace: Add --timestamp option to prepend a timestamp to log
     messages. This is useful for batch operations.
   - crash-digger: Call apport-retrace with --timestamps, to get consistent
     timestamps in log output.
   - hookutils.py: Add two new functions attach_gsettings_package() and
     attach_gsettings_schema() for adding user-modified gsettings keys to a
     report. (LP: #836489)
   - hookutils.py: Add new function in_session_of_problem() which returns
     whether the given report happened in the currently running XDG session.
     This can be used to determine if e. g. ~/.xsession-errors is relevant and
     should be attached.
   - backends/packaging-apt-dpkg.py, install_packages(): Also copy
     apt/sources.list.d/ into sandbox.
   - backends/packaging-apt-dpkg.py, install_packages(): Install apt keyrings
     from config dir or from system into sandbox. (LP: #856216)
   - packaging.py, backends/packaging-apt-dpkg.py: Define that
     install_packages() should return a SystemError for broken
     configs/unreachable servers etc., and fix the apt/dpkg implementation
     accordingly.
   - apport-retrace: Don't crash, just give a proper error message if servers
     are unreachable, or configuration files are broken. (LP: #859248)
   - backends/packaging-apt-dpkg.py: Fix crash when
     /etc/apport/native-origins.d contains any files. (LP: #865199)
   - hookutils, recent_logfile(): Fix invalid return value if log file is not
     readable. (LP: #819357)
   - test/crash: Fix race condition in the "second instance terminates
     immediately" check.
   - hookutils.py: Replace attach_gconf() with a no-op stub. It used static
     python modules like "gconf" which broke the PyGI GTK user interface, and
     gconf is rather obsolete these days.
   - ui.py, open_url(): Greatly simply and robustify by just using xdg-open.
     This already does the right thing wrt. reading the default browser from
     GNOME, KDE, XCE, and other desktops. (LP: #198449)
   - data/general-hooks/generic.py: Only attach ~/.xsession_errors if the bug
     is reported in the same XDG session as the crash happened. (LP: #869974)
   - Ignore crashes for programs which got updated in between the crash and
     reporting. (LP: #132904)
   - Special-case crashes of 'twistd': Try to determin...

Read more...

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.