1. 18 Feb, 2020 5 commits
    • Philip Withnall's avatar
      Merge branch 'wip/oholy/gunixmountmonitor-thread-safe' into 'master' · 4a1dcdfb
      Philip Withnall authored
      gunixmounts: Make GUnixMountMonitor thread-safe
      
      Closes #2030
      
      See merge request !1357
      4a1dcdfb
    • Ondrej Holy's avatar
      gunixmounts: Remove pending sources when finalizing · 501558ea
      Ondrej Holy authored
      mtab_file_changed_id is	not currently removed when finalizing, which
      could potentially lead to segfaults. Let's remove the source when
      finalizing to avoid this.
      501558ea
    • Ondrej Holy's avatar
      gunixmounts: Prevent race when mtab file changed · ab278c00
      Ondrej Holy authored
      mtab_file_changed_id might be set on thread default context, but it is
      always cleared on the global context because of usage of g_idle_add. This
      can cause the emission of redundant "mounts-change" signals. This should
      not cause any issues to the client application, but let's attach the idle
      source to the thread-default context instead to avoid those races for sure.
      ab278c00
    • Ondrej Holy's avatar
      gunixmounts: Prevent invalid time_read timestamps · 898a9c33
      Ondrej Holy authored
      The `get_mounts_timestamp()` function uses `mount_poller_time` when
      `proc_mounts_watch_source` is set, but the `mount_poller_time` is not
      initialized in the same time as `proc_mounts_watch_source`. This may
      cause that zero, or some outdated value is returned. Let's initialize
      `mount_poller_time` to prevent invalid values to be returned.
      898a9c33
    • Ondrej Holy's avatar
      gunixmounts: Make GUnixMountMonitor thread-safe · 972b9776
      Ondrej Holy authored
      The Nautilus test suite often crashes with "GLib-FATAL-CRITICAL:
      g_source_is_destroyed: assertion 'g_atomic_int_get (&source->ref_count)
      > 0' failed" if it is started with "GIO_USE_VOLUME_MONITOR=unix". This
      is because GUnixMountMonitor is simultaneously used from multiple
      threads over GLocalFile and GVolumeMonitor APIs. Let's add guards for
      proc_mounts_watch_source and mount_poller_time variables to prevent
      those crashes.
      
      Fixes: #2030
      972b9776
  2. 17 Feb, 2020 2 commits
  3. 16 Feb, 2020 3 commits
  4. 15 Feb, 2020 2 commits
  5. 14 Feb, 2020 6 commits
  6. 13 Feb, 2020 3 commits
  7. 12 Feb, 2020 4 commits
  8. 11 Feb, 2020 6 commits
    • Sebastian Dröge's avatar
      Merge branch 'docs-object-manager-example' into 'master' · d6886d89
      Sebastian Dröge authored
      docs: Don’t install object manager example separately
      
      See merge request !1359
      d6886d89
    • Philip Withnall's avatar
      docs: Don’t install object manager example separately · 760c8ccb
      Philip Withnall authored
      The relevant parts of the generated example documentation are already
      `xi:include`d into the `migrating-gdbus.xml` page, so are turned into
      HTML there. Installing them separately means they also get installed
      into `/usr/share/gtk-doc/html/gdbus-object-manager-example/`, which
      seems redundant.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      760c8ccb
    • Sebastian Dröge's avatar
    • Sebastian Dröge's avatar
      GMainContext - Move mutex unlocking in destructor right before freeing the mutex · 730a75fc
      Sebastian Dröge authored
      This does not have any behaviour changes but is cleaner. The mutex is
      only unlocked now after all operations on the context are done and right
      before freeing the mutex and the context itself.
      730a75fc
    • Sebastian Dröge's avatar
      GMainContext - Fix memory leaks and memory corruption when freeing sources while freeing a context · aa20167d
      Sebastian Dröge authored
      Instead of destroying sources directly while freeing the context, and
      potentially freeing them if this was the last reference to them, collect
      new references of all sources in a separate list before and at the same
      time invalidate their context so that they can't access it anymore. Only
      once all sources have their context invalidated, destroy them while
      still keeping a reference to them. Once all sources are destroyed we get
      rid of the additional references and free them if nothing else keeps a
      reference to them anymore.
      
      This fixes a regression introduced by 26056558 in 2012.
      
      The previous code that invalidated the context of each source and then
      destroyed it before going to the next source without keeping an
      additional reference caused memory leaks or memory corruption depending
      on the order of the sources in the sources lists.
      
      If a source was destroyed it might happen that this was the last
      reference to this source, and it would then be freed. This would cause
      the finalize function to be called, which might destroy and unref
      another source and potentially free it. This other source would then
      either
      - go through the normal free logic and change the intern linked list
        between the sources, while other sources that are unreffed as part of
        the main context freeing would not. As such the list would be in an
        inconsistent state and we might dereference freed memory.
      - go through the normal destroy and free logic but because the context
        pointer was already invalidated it would simply mark the source as
        destroyed without actually removing it from the context. This would
        then cause a memory leak because the reference owned by the context is
        not freed.
      
      Fixes https://github.com/gtk-rs/glib/issues/583 while still keeping
      https://bugzilla.gnome.org/show_bug.cgi?id=661767 fixes.
      aa20167d
    • Sebastian Dröge's avatar
      GMainContext - Fix GSource iterator if iteration can modify the list · b06c48de
      Sebastian Dröge authored
      We first have to ref the next source and then unref the previous one.
      This might be the last reference to the previous source, and freeing the
      previous source might unref and free the next one which would then leave
      use with a dangling pointer here.
      
      Fixes GNOME/glib#2031
      b06c48de
  9. 09 Feb, 2020 2 commits
  10. 08 Feb, 2020 3 commits
  11. 07 Feb, 2020 4 commits