[oneiric] apport test suite failure

Bug #868695 reported by Jamie Strandboge on 2011-10-05
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Low
Martin Pitt
Oneiric
Undecided
Unassigned

Bug Description

When running the apport test suite via QRT, if fails with:
* empty core dumps do not generate a report
* check test process creation/killing with apport
* a subsequent crash does not alter unseen report
* a subsequent crash alters seen report
* report has required fields
* dumped environment only has insensitive variables
* collected system groups has nonempty user groups information
* collected system groups are not those from root
* only one apport instance is ran at a time
* existing .lock file as dangling symlink does not create the file
* non-packaged executables do not create a report
* apport ignores SIGQUIT
* existence of user-inaccessible files does not leak
* non-packaged scripts do not create a report
* limitation of flooding: iteration 0 1 2
* core dump works for non-writable cwds
* non-packaged executables create core dumps on proper ulimits
Traceback (most recent call last):
  File "/usr/share/apport/testsuite/crash", line 386, in <module>
    check_crash(expect_corefile=True)
  File "/usr/share/apport/testsuite/crash", line 83, in check_crash
    assert os.path.exists('core'), 'leaves wanted core file'
AssertionError: leaves wanted core file

Martin Pitt (pitti) wrote :

Does that reproduce for you when you just run /usr/share/apport/testsuite/crash ? This succeeds for me (also if I run it from trunk). I also tried running it from QRT, also succeeds (at least that part, it fails some tests because I have hardening-wrapper installed). Let's first check if that's an issue for you due to the QRT environment or if something on your box is different. I'll also try to add some more verbiage to the test.

Changed in apport (Ubuntu Oneiric):
status: New → Incomplete
Jamie Strandboge (jdstrand) wrote :

I tried the QRT script in a new VM install with the oneiric-desktop-amd64.iso (beta2 install, upgraded to current release) and it failed in the same place. I then tried /usr/share/apport/testsuite/crash and it worked. I then tried running /usr/share/apport/testsuite/run and there were some failures, but they were the ones I have seen before. I did this as uid 1000 user (ie, in the admin group) and it worked fine. I then tried the test as a newuser (ie not in the admin group) and it failed with:
$ /usr/share/apport/testsuite/crash
* empty core dumps do not generate a report
* check test process creation/killing with apport
* a subsequent crash does not alter unseen report
* a subsequent crash alters seen report
* report has required fields
* dumped environment only has insensitive variables
* collected system groups has nonempty user groups information
Traceback (most recent call last):
  File "/usr/share/apport/testsuite/crash", line 190, in <module>
    assert pr['UserGroups']
AssertionError

Once I added 'testuser' to the admin group, /usr/share/apport/testsuite/crash worked fine.

Bottom line: the problem is reproducible in QRT. Outside of QRT, I get various other issues that I think are related to my setup. In QRT, I am going to add the unprivileged testuser to the admin group and make sure that /var/crash is cleaned out. I think that this is a QRT issue now, but it seems the testsuite may assume a specific environment that I may not be providing.

Changed in apport (Ubuntu Oneiric):
status: Incomplete → Invalid
Changed in apport (Ubuntu):
status: Incomplete → Invalid
Martin Pitt (pitti) wrote :

> assert pr['UserGroups']

Ah, I suppose that one would happen if your test user is not in any groups, thus "UserGroups" would not be created. I'm happy to make the test suite more clever in that regard. However, that's a very different issue than the "leaves wanted core file" failure. Did you still get this?

Changed in apport (Ubuntu):
status: Invalid → In Progress
importance: Undecided → Low
assignee: nobody → Martin Pitt (pitti)
Martin Pitt (pitti) wrote :

With a test user who is not in any group I also get the original report with 'leaves wanted core file'.

Martin Pitt (pitti) wrote :

UserGroups part fixed in http://bazaar.launchpad.net/~apport-hackers/apport/trunk/revision/1994 .

For the core file part, it fails to write a core file if you run this in a directory which the user you run this as can't write to. I suppose that is what happens with your QRT mode? I'll fix this.

Martin Pitt (pitti) wrote :
Changed in apport (Ubuntu):
status: In Progress → Fix Committed
Martin Pitt (pitti) wrote :

martin@donald:~/ubuntu/apport/trunk
$ sudo -H -u test test/crash

This now works completely. The only requirement is that $HOME is set correctly, i. e. if you use sudo, you need to use -H.

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  Edit
Everyone can see this information.

Other bug subscribers