autopilot crashed with SIGSEGV in XLastKnownRequestProcessed()

Bug #1258170 reported by Christopher Townsend
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Autopilot
Fix Released
Undecided
Martin Pitt
autopilot (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

This is occurring on the Unity stack daily release runs and I can reproduce it as well on my machine. It may be specific to Intel machines since the Nvidia machine does not exhibit this behavior.

To reproduce, run:
autopilot run unity.tests.test_panel.PanelCrossMonitorsTests.test_panel_title_updates_moving_window

ProblemType: Crash
DistroRelease: Ubuntu 14.04
Package: python-autopilot 1.4+14.04.20131125-0ubuntu1
ProcVersionSignature: Ubuntu 3.12.0-5.13-generic 3.12.2
Uname: Linux 3.12.0-5-generic x86_64
ApportVersion: 2.12.7-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Dec 5 09:21:53 2013
ExecutablePath: /usr/bin/autopilot
ExecutableTimestamp: 1385361829
InstallationDate: Installed on 2013-04-02 (246 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Alpha amd64 (20130402)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/autopilot run unity.tests.test_panel.PanelCrossMonitorsTests.test_panel_title_updates_moving_window -v
ProcCwd: /home/townsend/fix-restore-window-bad-placement/unity/tests/autopilot
SegvAnalysis:
 Segfault happened at: 0x7f6893817200 <XLastKnownRequestProcessed>: mov 0x90(%rdi),%rax
 PC (0x7f6893817200) ok
 source "0x90(%rdi)" (0x00000090) not located in a known VMA region (needed readable region)!
 destination "%rax" ok
SegvReason: reading NULL VMA
Signal: 11
SourcePackage: autopilot
StacktraceTop:
 XLastKnownRequestProcessed (dpy=0x0) at ../../src/Macros.c:145
 ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
 gdk_x11_display_error_trap_push () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
 gdk_x11_window_foreign_new_for_display () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
 ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6
Title: autopilot crashed with SIGSEGV in XLastKnownRequestProcessed()
UpgradeStatus: Upgraded to trusty on 2013-11-07 (28 days ago)
UserGroups: adm autopilot cdrom dip lpadmin plugdev sambashare sudo

Related branches

Revision history for this message
Christopher Townsend (townsend) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 XLastKnownRequestProcessed (dpy=0x0) at ../../src/Macros.c:145
 delete_outdated_error_traps (display_x11=display_x11@entry=0x2cae190) at /build/buildd/gtk+3.0-3.8.7/./gdk/x11/gdkdisplay-x11.c:2572
 gdk_x11_display_error_trap_push (display=display@entry=0x2cae190) at /build/buildd/gtk+3.0-3.8.7/./gdk/x11/gdkdisplay-x11.c:2618
 gdk_x11_window_foreign_new_for_display (display=0x2cae190, window=69206019) at /build/buildd/gtk+3.0-3.8.7/./gdk/x11/gdkwindow-x11.c:1199
 ffi_call_unix64 () at ../src/x86/unix64.S:76

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in autopilot (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
information type: Private → Public
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

This looks like a crash deep inside Gtk to me. I'll see if I can find someone to take a look.

Martin Pitt (pitti)
Changed in autopilot (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

I ran this test 15 times on my system (ThinkPad X230, external DVI, Intel graphics, current trusty) without any crash/failure. Do you have a pointer to a failed log? Does this test require a particular display configuration, such as multiple monitors?

Changed in autopilot (Ubuntu):
status: New → Incomplete
Revision history for this message
Christopher Townsend (townsend) wrote :

Hi Martin,

This is affecting the qa-intel-4000 Jenkins CI machine. Here is the console log from that machine: http://q-jenkins.ubuntu-ci:8080/job/autopilot-trusty-daily_release/823/label=qa-intel-4000/console

This is how I discovered the issue and was able to reproduce on my system (Dell XPS 13, no external monitor, Intel Gfx, current Trusty).

Let me know if you need any additional info.

Changed in autopilot (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

I can reproduce the crash if I use my internal and the external monitor side by side. Mouse behaviour in Unity in that mode is awfully buggy (you can't move between the two monitors, and the mouse area seems to randomly switch between the two), but it reproduces the crash.

Changed in autopilot (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Christopher Townsend (townsend) wrote :

Hi Martin,

Just to confirm your results, it only occurs on my system with both the internal monitor and an external monitor. Sorry for my misinformation about being internal monitor only.

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

Simple reproducer:

python -c 'from gi.repository import GdkX11; display = GdkX11.X11Display(); print("display:", display); fd = GdkX11.X11Window.foreign_new_for_display(display, 1); print("foreign:", fd); origin = fd.get_origin(); print("origin:", origin)'

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

More complete example with a valid XID (but doesn't make a difference):

xvfb-run python -c 'from gi.repository import Gdk, GdkX11; display = GdkX11.X11Display(); print("display:", display); rw = Gdk.get_default_root_window(); print("rootwin:", rw); xid = rw.get_xid(); print("xid:", xid); fd = GdkX11.X11Window.foreign_new_for_display(display, xid); print("foreign:", fd); origin = fd.get_origin(); print("origin:", origin)'

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

Turns out that the GdkX11.X11Display has no public constructor, so it's invalid to create a GdkDisplay like that. The official API is to use Gdk.Display.get_default(), which makes this whole thing work. The question is now, how did that ever work? The same python command crashes in saucy and raring as well, so it's not something new on the GI/GTK side. Did we perhaps just recently start doing multi-monitor testing in CI?

test_panel_title_updates_moving_window() does not have a direct reference to the "geometry" property, but that might be called somewhere internally (and that might be a new thing).

autopilot itself doesn't seem to use that property anywhere by itself, nor does it have a test for it.

Changed in autopilot:
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

That's how the geometry property is being used:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/unity/tests/test_panel.py", line 1172, in test_panel_title_updates_moving_window
    drag_window_to_screen(calc_win, monitor)
  File "/usr/lib/python2.7/dist-packages/unity/emulators/X11.py", line 56, in drag_window_to_screen
    (win_x, win_y, win_w, win_h) = window.geometry
  File "/usr/lib/python2.7/dist-packages/autopilot/process/_bamf.py", line 488, in geometry
    raise NotImplementedError('moo!')
NotImplementedError: moo!

Martin Pitt (pitti)
Changed in autopilot:
status: Triaged → In Progress
Changed in autopilot (Ubuntu):
status: Triaged → In Progress
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:autopilot at revision None, scheduled for release in autopilot, milestone 1.4

Changed in autopilot:
status: In Progress → Fix Committed
Revision history for this message
Christopher Townsend (townsend) wrote :

Nice, thanks!

Martin Pitt (pitti)
Changed in autopilot (Ubuntu):
status: In Progress → Fix Committed
Martin Pitt (pitti)
Changed in autopilot:
assignee: nobody → Martin Pitt (pitti)
status: Fix Committed → Fix Released
Changed in autopilot (Ubuntu):
assignee: Martin Pitt (pitti) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.4 KiB)

This bug was fixed in the package autopilot - 1.4+14.04.20140123.1-0ubuntu1

---------------
autopilot (1.4+14.04.20140123.1-0ubuntu1) trusty; urgency=low

  [ Barry Warsaw ]
  * Make Autopilot tracepoint extension module compatible with python 3.
    (LP: #1266574)

  [ Christopher Lee ]
  * Handle xml parse exception nicely as well as add some nicer
    logging/feedback.
  * Fixes issues with load_test_suite_from_name.
  * Make autopilot able to run it's own tests again.
  * When setting up logging take into account not all modes/commands
    have a verbose argument.
  * Fixes the issue when listing an non-existent test suite raised an
    uncaught exception. .
  * Minor fix for a failing functional test, now passes under python 2
    and 3.
  * Minor fixup of TypeError in platform docs re: skipping tests.
  * Add details to Faq docs re: launching (click) applications. (LP:
    #1257148)
  * Refactor of the application launching code (incl. tests).
  * Fix issue with launching click app and added 100% unit test to cover
    it.
  * Fixes the issue where test discovery gets confused when there are
    local (in cwd) and system installed tests.

  [ Thomi Richards ]
  * Fix tox.ini config file to restrict flake8 runs to the autopilot/
    directory.
  * Make autopilot fail when no command is specified. (LP: #1255334)
  * Move the contents of the 'autopilot' script into autopilot/run.py,
    and make setuptools generate the autopilot script for us.
  * Make autopilot understand how the "-qt=XXX" option works. (LP:
    #1255405)
  * Handle xml parse exception nicely as well as add some nicer
    logging/feedback.
  * Fix autopilot test case loading. (LP: #1255752, #1255659)
  * Move the BackendException class to solve a circular import.
  * Make autopilot support subunit bytestream output. (LP: #1255662)
  * Make autopilot able to run it's own tests again.
  * Remove an incorrect comment from the source code.
  * Fix some unit tests that were printing to stdout.
  * Lay the groundwork for attaching files to test results.
  * Fix failing tests in python3.
  * Add click package log file to test result. (LP: #1257453)
  * Add a simple shell script that can be used to generate unit test
    coverage for autopilot itself.
  * Add unit tests for common input code.
  * Remove some unused code code in the type support unit tests.
  * Don't include test lines in coverage count.
  * Add a few missing test cases, increase test case coverage.
  * Add unit tests for process snapshot support.
  * A few tweaks to the make_coverage script to make it a bit more
    useful.
  * Fix issue with launching click app and added 100% unit test to cover
    it.
  * Fix eventually matcher so it can match against complex types. (LP:
    #1269984)

  [ Martin Pitt ]
  * Fix initialization of GdkDisplay, to fix crash when accessing
    Window.geometry. (LP: #1258170)
  * tests: Ensure we don't leave remmina and other processes open. (LP:
    #1259721)
  * Don't inherit our stdout to spawned processes, to allow users to
    redirect autopilot's stdout to tee and other programs which wait for
    EOF. (LP: #1259721)
  * Fix functional tests to actually run against the build t...

Read more...

Changed in autopilot (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.