_ip_get_path_for_wd assertion failed: (wd >= 0)
@3v1n0
Submitted by Marco Trevisan Link to original bug (#795522)
Description
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 (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:51
set = {__val = {18446744067266838239, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552}}
pid = <optimized out>
tid = <optimized out>
#1 0x0000561a5bb82a8b in dump_gjs_stack_on_signal_handler (signo=6) at ../src/main.c:372
sa = {__sigaction_handler = {sa_handler = 0x561a5bb82ac0 <dump_gjs_stack_alarm_sigaction>, sa_sigaction = 0x561a5bb82ac0 <dump_gjs_stack_alarm_sigaction>}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
i = 65
#2 <signal handler called>
No locals.
#3 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
set = {__val = {18446744067266838239, 139951509340162, 0, 6, 32, 24, 32, 7875667050066240512, 0, 139952381755424, 2064, 139952381755424, 2048, 139952381762944, 0, 139952854851350}}
pid = <optimized out>
tid = <optimized out>
#4 0x00007f49502daf5d in __GI_abort () at abort.c:90
save_stage = 2
act = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {7875667050066240512, 94669669138432, 139952381762944, 110, 139952892173536, 139952492541904, 139952895968160, 0, 139952854864894, 139952381762944, 0, 0, 7875667050066240512, 139952895968064, 7875667050066240512, 139952895764312}}, sa_flags = 872422784, sa_restorer = 0x6e}
sigs = {__val = {32, 0 <repeats 15 times>}}
#5 0x00007f495242481d in g_assertion_message (domain=domain@entry=0x7f4952a32758 "GLib-GIO", file=file@entry=0x7f4952a64340 "../../../../../gio/inotify/inotify-path.c", line=line@entry=583, func=func@entry=0x7f4952a643a0 <__func__.9543> "_ip_get_path_for_wd", message=message@entry=0x561a5d16abb0 "assertion failed: (wd >= 0)") at ../../../../glib/gtestutils.c:2436
lstr = "583\000I\177\000\000\000drxt\375Km\300\315\032]\032V\000\000zA\246RI\177\000"
s = 0x7f4934001d80 ""
#6 0x00007f49524248aa in g_assertion_message_expr (domain=domain@entry=0x7f4952a32758 "GLib-GIO", file=file@entry=0x7f4952a64340 "../../../../../gio/inotify/inotify-path.c", line=line@entry=583, func=func@entry=0x7f4952a643a0 <__func__.9543> "_ip_get_path_for_wd", expr=expr@entry=0x7f4952a6417a "wd >= 0") at ../../../../glib/gtestutils.c:2459
s = 0x561a5d16abb0 "assertion failed: (wd >= 0)"
#7 0x00007f4952a2d5d6 in _ip_get_path_for_wd (wd=<optimized out>) at ../../../../../gio/inotify/inotify-path.c:583
dir_list = <optimized out>
dir = <optimized out>
__func__ = "_ip_get_path_for_wd"
#8 0x00007f4952a2d9af in ih_event_callback (event=0x7f4934002b10, sub=0x561a5d214470, file_event=<optimized out>) at ../../../../../gio/inotify/inotify-helper.c:182
parent_dir = <optimized out>
other = <optimized out>
interesting = <optimized out>
__func__ = "ih_event_callback"
#9 0x00007f4952a2ce89 in ip_event_dispatch (dir_list=dir_list@entry=0x561a5ecf9880, file_list=0x0, event=0x7f4934002b10) at ../../../../../gio/inotify/inotify-path.c:492
sub = 0x561a5d214470
subl = 0x561a5ecf9220
dir = 0x561a5fcec590
interesting = 0
l = 0x561a5ecf9880
#10 0x00007f4952a2d062 in ip_event_dispatch (event=<optimized out>, file_list=<optimized out>, dir_list=0x561a5ecf9880) at ../../../../../gio/inotify/inotify-path.c:554
interesting = 0
#11 ip_event_callback (event=event@entry=0x7f4934002b50) at ../../../../../gio/inotify/inotify-path.c:555
event = 0x7f4934002b50
#12 0x00007f4952a2c41a in ik_source_dispatch (source=source@entry=0x561a5cc8fb40, func=0x7f4952a2cfa0 <ip_event_callback>, user_data=<optimized out>) at ../../../../../gio/inotify/inotify-kernel.c:324
event = 0x7f4934002b50
iks = 0x561a5cc8fb40
user_callback = <optimized out>
interesting = 0
now = 930641014
__func__ = "ik_source_dispatch"
#13 0x00007f49523fde25 in g_main_dispatch (context=0x561a5c53ab60) at ../../../../glib/gmain.c:3148
dispatch = 0x7f4952a2c1c0 <ik_source_dispatch>
prev_source = 0x0
was_in_call = 0
user_data = 0x0
callback = 0x7f4952a2cfa0 <ip_event_callback>
cb_funcs = 0x7f49526c5280 <g_source_callback_funcs>
cb_data = 0x561a5cc8fc60
need_destroy = <optimized out>
source = 0x561a5cc8fb40
current = 0x561a5d16e810
i = 0
#14 g_main_context_dispatch (context=context@entry=0x561a5c53ab60) at ../../../../glib/gmain.c:3813
No locals.
#15 0x00007f49523fe1f0 in g_main_context_iterate (context=context@entry=0x561a5c53ab60, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../../glib/gmain.c:3886
max_priority = 2147483647
timeout = 10
some_ready = 1
nfds = <optimized out>
allocated_nfds = 2
fds = 0x561a5c5148f0
#16 0x00007f49523fe27c in g_main_context_iteration (context=0x561a5c53ab60, may_block=may_block@entry=1) at ../../../../glib/gmain.c:3947
retval = <optimized out>
#17 0x00007f49523fe2c1 in glib_worker_main (data=<optimized out>) at ../../../../glib/gmain.c:5742
No locals.
#18 0x00007f4952425645 in g_thread_proxy (data=0x561a5c53b800) at ../../../../glib/gthread.c:784
thread = 0x561a5c53b800
#19 0x00007f49506897fc in start_thread (arg=0x7f493a9a9700) at pthread_create.c:465
pd = 0x7f493a9a9700
now = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {139952492549888, 7971392138181629608, 140725622742510, 140725622742511, 139952492549888, 27, -8056262574619470168, -8056180814957226328}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
pagesize_m1 = <optimized out>
sp = <optimized out>
freesize = <optimized out>
__PRETTY_FUNCTION__ = "start_thread"
#20 0x00007f49503b6b0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.
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;