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 725503 - tests: unix-stream test just failed
tests: unix-stream test just failed
Status: RESOLVED DUPLICATE of bug 791754
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 711802
 
 
Reported: 2014-03-02 14:35 UTC by Allison Karlitskaya (desrt)
Modified: 2017-12-19 09:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Allison Karlitskaya (desrt) 2014-03-02 14:35:36 UTC
# random seed: R02S991af33424e7e434b09634adb6f7f22b
# Start of unix-streams tests

(/home/desrt/code/glib/gio/tests/.libs/lt-unix-streams:25750): GLib-CRITICAL **: g_source_set_ready_time: assertion 'source->ref_count > 0' failed
ok 1 /unix-streams/basic
PASS: unix-streams 1 /unix-streams/basic
../../tap-test: line 5: 25750 Trace/breakpoint trap   $1 -k --tap
# GLib-FATAL-CRITICAL: g_source_set_ready_time: assertion 'source->ref_count > 0' failed
ERROR: unix-streams - missing test plan
ERROR: unix-streams - exited with status 133 (terminated by signal 5?)
Comment 1 Allison Karlitskaya (desrt) 2014-03-02 15:04:53 UTC
Looks like we can have a race between a cancellable source being destroyed and cancellable_source_cancelled() being called.  The cancellable doesn't take a ref on the source (and indeed it shouldn't) but then:

        g_signal_connect (cancellable, "cancelled",
                          G_CALLBACK (cancellable_source_cancelled),
                          source);

and

static void
cancellable_source_cancelled (GCancellable *cancellable,
                              gpointer      user_data)
{
  GSource *source = user_data;

  if (!g_source_is_destroyed (source))
    g_source_set_ready_time (source, 0);
}


which means that if the cancellable is cancelled in one thread, and the source is destroyed in another (between the check for _is_destroyed() and the _set_ready_time() call) then we will call _set_ready_time() on a destroyed source.
Comment 2 Philip Withnall 2017-12-19 09:36:42 UTC
The code has changed slightly since this race was first reported, but the race still exists. Duping to bug #791754, because it has a backtrace.

*** This bug has been marked as a duplicate of bug 791754 ***