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 795522 - _ip_get_path_for_wd assertion failed: (wd >= 0)
_ip_get_path_for_wd assertion failed: (wd >= 0)
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 756974 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-04-24 21:56 UTC by Marco Trevisan (Treviño)
Modified: 2018-05-24 20:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marco Trevisan (Treviño) 2018-04-24 21:56:50 UTC
In Ubuntu we're getting some reports about this crash (see https://errors.ubuntu.com/problem/7d4e9fc521926903d3f796d9d01b38c242396745, you might get access from https://forms.canonical.com/reports/)

  • #0 raise
    at ../sysdeps/unix/sysv/linux/raise.c line 51
  • #1 dump_gjs_stack_on_signal_handler
    at ../src/main.c line 372
  • #2 <signal handler called>
  • #3 __GI_raise
    at ../sysdeps/unix/sysv/linux/raise.c line 51
  • #4 __GI_abort
    at abort.c line 90
  • #5 g_assertion_message
  • #6 g_assertion_message_expr
    at ../../../../glib/gtestutils.c line 2459
  • #7 _ip_get_path_for_wd
    at ../../../../../gio/inotify/inotify-path.c line 583
  • #8 ih_event_callback
    at ../../../../../gio/inotify/inotify-helper.c line 182
  • #9 ip_event_dispatch
    at ../../../../../gio/inotify/inotify-path.c line 492
  • #10 ip_event_dispatch
    at ../../../../../gio/inotify/inotify-path.c line 554
  • #11 ip_event_callback
    at ../../../../../gio/inotify/inotify-path.c line 555
  • #12 ik_source_dispatch
    at ../../../../../gio/inotify/inotify-kernel.c line 324
  • #13 g_main_dispatch
    at ../../../../glib/gmain.c line 3148
  • #14 g_main_context_dispatch
    at ../../../../glib/gmain.c line 3813
  • #15 g_main_context_iterate
    at ../../../../glib/gmain.c line 3886
  • #16 g_main_context_iteration
    at ../../../../glib/gmain.c line 3947
  • #17 glib_worker_main
    at ../../../../glib/gmain.c line 5742
  • #18 g_thread_proxy
    at ../../../../glib/gthread.c line 784
  • #19 start_thread
    at pthread_create.c line 465
  • #20 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 95



For some reaseon the parir watch description is unset, not sure if in such case we should just not try to get the path with something like:

diff --git a/gio/inotify/inotify-helper.c b/gio/inotify/inotify-helper.c
index d94458753..a24f1a645 100644
--- a/gio/inotify/inotify-helper.c
+++ b/gio/inotify/inotify-helper.c
@@ -175,7 +175,7 @@ ih_event_callback (ik_event_t  *event,
         {
           GFile *other;
 
-          if (event->pair)
+          if (event->pair && event->pair->wd >= 0)
             {
               const char *parent_dir;
               gchar *fullpath;
Comment 1 Philip Withnall 2018-05-16 10:44:14 UTC
I don’t think you can just fix it by checking whether the paired event’s watch descriptor is valid — this will just cause the code to treat the event as if it doesn’t have a paired event, which is incorrect and will result in the wrong GFileMonitorEvent handling at a higher level.

The problem here seems to be a state management problem: somehow ih_event_callback() is being called for an ik_event_t whose paired event has been stopped (ip_watched_file_stop()) or not started (ip_watched_file_start()), or which has somehow otherwise never received a valid watch descriptor or had its watch descriptor invalidated. I wonder if there’s a problem with stopping events for one descriptor when stopping events for its pair, or something like that.

Would you be able to investigate further to work out exactly where the state management problem is?
Comment 2 Philip Withnall 2018-05-16 10:44:41 UTC
*** Bug 756974 has been marked as a duplicate of this bug. ***
Comment 3 Marco Trevisan (Treviño) 2018-05-16 11:37:25 UTC
(In reply to Philip Withnall from comment #1)
> I don’t think you can just fix it by checking whether the paired event’s
> watch descriptor is valid — this will just cause the code to treat the event
> as if it doesn’t have a paired event, which is incorrect and will result in
> the wrong GFileMonitorEvent handling at a higher level.

Yeah, I had some concerns in fact. Going a bit furher down at the at the stack I didn't notice anything obviously wrong though.

> The problem here seems to be a state management problem
> Would you be able to investigate further to work out exactly where the state
> management problem is?

So, yeah, I might check a bit furhter... However I've never got this crash personally, so doing proper debugging is a bit tricky.
Comment 4 GNOME Infrastructure Team 2018-05-24 20:27:23 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1370.