After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768996 - gapplication/quit test fails intermittently
gapplication/quit test fails intermittently
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gapplication
2.49.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-07-20 14:40 UTC by Emilio Pozuelo Monfort
Modified: 2018-04-10 10:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
g_test_dbus_down: Ensure next test does not use old connection (2.27 KB, patch)
2018-04-04 09:03 UTC, Simon McVittie
committed Details | Review

Description Emilio Pozuelo Monfort 2016-07-20 14:40:44 UTC
glib 2.49.3

Running the gio/tests/gapplication test in a loop, it eventually fails with:

/gapplication/no-dbus: OK
/gapplication/no-appid: OK
/gapplication/properties: OK
/gapplication/app-id: OK
/gapplication/quit: Failed to register: The connection is closed
**
GLib-GIO:ERROR:/build/glib2.0-2.49.3/./gio/tests/gapplication.c:564:test_quit: assertion failed: (activated)
cleaning up pid 24437
Aborted (core dumped)

(gdb) bt
  • #0 raise
    from /lib/x86_64-linux-gnu/libc.so.6
  • #1 abort
    from /lib/x86_64-linux-gnu/libc.so.6
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at /build/glib2.0-2.49.3/./glib/gtestutils.c line 2452
  • #4 test_quit
    at /build/glib2.0-2.49.3/./gio/tests/gapplication.c line 564
  • #5 test_case_run
    at /build/glib2.0-2.49.3/./glib/gtestutils.c line 2158
  • #6 g_test_run_suite_internal
    at /build/glib2.0-2.49.3/./glib/gtestutils.c line 2241
  • #7 g_test_run_suite_internal
    at /build/glib2.0-2.49.3/./glib/gtestutils.c line 2253
  • #8 g_test_run_suite
    at /build/glib2.0-2.49.3/./glib/gtestutils.c line 2328
  • #9 g_test_run
    at /build/glib2.0-2.49.3/./glib/gtestutils.c line 1596
  • #10 main
    at /build/glib2.0-2.49.3/./gio/tests/gapplication.c line 990

Comment 1 Matthias Clasen 2016-07-21 02:32:45 UTC
Don't do that, then ?
Comment 2 Emilio Pozuelo Monfort 2016-07-21 07:59:44 UTC
Normally I wouldn't do that :p

But I made a normal build and the test suite failed there. And when trying to reproduce it, I found it's not 100% reproducible. Probably a race.
Comment 3 Simon McVittie 2018-04-03 10:27:48 UTC
See also Bug #721921, which might have the same root cause.
Comment 4 Simon McVittie 2018-04-04 09:03:44 UTC
Created attachment 370520 [details] [review]
g_test_dbus_down: Ensure next test does not use old connection

There's a race condition somewhere in GTestDBus that can result in
the next test being started at a time when g_bus_get() would still
return the connection that is in the process of closing. This can
be reproduced reasonably reliably by running the gapplication test
10K times in a loop.

Instead of relying on waiting for the weak reference to be released,
we can force the issue by clearing it.
Comment 5 Philip Withnall 2018-04-10 10:22:13 UTC
Review of attachment 370520 [details] [review]:

Looks good, thanks. Since this affects more than just the tests (since it modifies GTestDBus), I’m only going to push it to master unless you particularly also want it backported to glib-2-56. Let me know if so.

I think this patch is orthogonal (does not conflict with) Allison’s suggested solution for https://bugzilla.gnome.org/show_bug.cgi?id=721921#c13, since GTestDBus comes under cases #3 (and #4, to a certain extent) of that list. We’re not impacting on cases #1 and #2.
Comment 6 Philip Withnall 2018-04-10 10:29:22 UTC
Pushed to master.

Attachment 370520 [details] pushed as 3d50691 - g_test_dbus_down: Ensure next test does not use old connection