Using GFileMonitor crashes GNOME Shell with toggling down object error
System information
Linux, Fedora Silverblue 31
GJS 1.58.3
GNOME Shell 3.34.2
Bug information
Trying to use Gio file monitor inside gnome-shell extension causes the shell crash with error:
toggling down object GInotifyFileMonitor that's already queued to toggle up
Steps to reproduce
-
Create a new file in temp dir to watch from code (e.g.
touch /tmp/testfile
). -
Use below code inside a class in a gnome extension:
this.watchFile = Gio.file_new_for_path('/tmp/testfile');
this.fileMonitor = this.watchFile.monitor(Gio.FileMonitorFlags.NONE, null);
this.onChange = (monitor, file, otherFile, event) =>
{
// No code in callback yet
}
this.fileMonitor.connect('changed', this.onChange.bind(this));
-
Run a simple separate app with a timer that writes some random data every 1 sec to the watched file.
-
Wait for crash to happen within next few minutes.
Current behaviour
Crash.
Stack trace:
Jan 04 21:44:37 gnome-shell[1173]: toggling down object GInotifyFileMonitor that's already queued to toggle up
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Keyboard handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Media keys handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Color management.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Wacom handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Power management handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Power management handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Color management.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Keyboard handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Media keys handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Wacom handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Keyboard handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Color management.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Power management handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Wacom handling.
Jan 04 21:44:39 systemd[970]: Failed to start GNOME Media keys handling.
Jan 04 21:44:39 systemd-coredump[7026]: Process 1173 (gnome-shell) of user 1000 dumped core.
Stack trace of thread 1173:
#0 0x00007fc10ab14625 raise (libc.so.6)
#1 0x0000560570eb7322 dump_gjs_stack_on_signal_handler (gnome-shell)
#2 0x00007fc10ab146b0 __restore_rt (libc.so.6)
#3 0x00007fc10b92f755 _g_log_abort (libglib-2.0.so.0)
#4 0x00007fc10b9307d9 g_log_default_handler (libglib-2.0.so.0)
#5 0x0000560570eb73de default_log_handler (gnome-shell)
#6 0x00007fc10b930a0b g_logv (libglib-2.0.so.0)
#7 0x00007fc10b930bf3 g_log (libglib-2.0.so.0)
#8 0x00007fc10b0ade7d n/a (libgjs.so.0)
#9 0x00007fc10b0bb8e8 _ZN11ToggleQueue13handle_toggleEPFvP8_GObjectNS_9DirectionEE (libgjs.so.0)
#10 0x00007fc10b0bb9af _ZN11ToggleQueue18idle_handle_toggleEPv (libgjs.so.0)
#11 0x00007fc10b925e3b g_idle_dispatch (libglib-2.0.so.0)
#12 0x00007fc10b929510 g_main_context_dispatch (libglib-2.0.so.0)
#13 0x00007fc10b9298a0 g_main_context_iterate.isra.0 (libglib-2.0.so.0)
#14 0x00007fc10b929b93 g_main_loop_run (libglib-2.0.so.0)
#15 0x00007fc10ad6ed20 meta_run (libmutter-5.so.0)
#16 0x0000560570eb6cad main (gnome-shell)
#17 0x00007fc10aaff1a3 __libc_start_main (libc.so.6)
#18 0x0000560570eb6e8e _start (gnome-shell)
Stack trace of thread 1178:
#0 0x00007fc10abcea6f __poll (libc.so.6)
#1 0x00007fc10b92980e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
#2 0x00007fc10b929943 g_main_context_iteration (libglib-2.0.so.0)
#3 0x00007fc10b929991 glib_worker_main (libglib-2.0.so.0)
#4 0x00007fc10b952fc2 g_thread_proxy (libglib-2.0.so.0)
#5 0x00007fc109f714e2 start_thread (libpthread.so.0)
#6 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 1218:
#0 0x00007fc109f77d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1 0x00007fc10845b06d _ZN7mozilla6detail21ConditionVariableImpl4waitERNS0_9MutexImplE (libmozjs-60.so.0)
#2 0x00007fc10845b245 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-60.so.0)
#3 0x00007fc1086bc98f _ZN2js12HelperThread10threadLoopEv (libmozjs-60.so.0)
#4 0x00007fc1086bca69 _ZN2js12HelperThread10ThreadMainEPv (libmozjs-60.so.0)
#5 0x00007fc1086b46a9 _ZN2js6detail16ThreadTrampolineIRFvPvEJPNS_12HelperThreadEEE5StartES2_ (libmozjs-60.so.0)
#6 0x00007fc109f714e2 start_thread (libpthread.so.0)
#7 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 1180:
#0 0x00007fc10abcea6f __poll (libc.so.6)
#1 0x00007fc10b92980e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
#2 0x00007fc10b929b93 g_main_loop_run (libglib-2.0.so.0)
#3 0x00007fc10bb7ca4a gdbus_shared_thread_func (libgio-2.0.so.0)
#4 0x00007fc10b952fc2 g_thread_proxy (libglib-2.0.so.0)
#5 0x00007fc109f714e2 start_thread (libpthread.so.0)
#6 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 1190:
#0 0x00007fc109f77d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1 0x00007fc0f22c711b util_queue_thread_func (r600_dri.so)
#2 0x00007fc0f22c6d2b impl_thrd_routine (r600_dri.so)
#3 0x00007fc109f714e2 start_thread (libpthread.so.0)
#4 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 1217:
#0 0x00007fc109f77d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1 0x00007fc10845b06d _ZN7mozilla6detail21ConditionVariableImpl4waitERNS0_9MutexImplE (libmozjs-60.so.0)
#2 0x00007fc10845b245 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-60.so.0)
#3 0x00007fc1086bc98f _ZN2js12HelperThread10threadLoopEv (libmozjs-60.so.0)
#4 0x00007fc1086bca69 _ZN2js12HelperThread10ThreadMainEPv (libmozjs-60.so.0)
#5 0x00007fc1086b46a9 _ZN2js6detail16ThreadTrampolineIRFvPvEJPNS_12HelperThreadEEE5StartES2_ (libmozjs-60.so.0)
#6 0x00007fc109f714e2 start_thread (libpthread.so.0)
#7 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 6809:
#0 0x00007fc109f77d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1 0x00007fc0dc1f7d5e _ZN10rayon_core5sleep5Sleep5sleep17h2d0f2139607116b6E (librsvg-2.so.2)
#2 0x00007fc0dc1f8402 _ZN10rayon_core8registry12WorkerThread15wait_until_cold17h661dafdfcbaa85e5E (librsvg-2.so.2)
#3 0x00007fc0dc1fcde5 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h356e8ce3ed631017E.llvm.13914659533576072043 (librsvg-2.so.2)
#4 0x00007fc0dc1f7157 _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h4255b83c54a050e8E (librsvg-2.so.2)
#5 0x00007fc0dc353bcf _ZN83_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$9call_once17h119df384485e079dE (librsvg-2.so.2)
#6 0x00007fc0dc35446c _ZN3std3sys4unix6thread6Thread3new12thread_start17ha7e8e0c43366c502E (librsvg-2.so.2)
#7 0x00007fc109f714e2 start_thread (libpthread.so.0)
#8 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 6808:
#0 0x00007fc109f77d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1 0x00007fc0dc1f7d5e _ZN10rayon_core5sleep5Sleep5sleep17h2d0f2139607116b6E (librsvg-2.so.2)
#2 0x00007fc0dc1f8402 _ZN10rayon_core8registry12WorkerThread15wait_until_cold17h661dafdfcbaa85e5E (librsvg-2.so.2)
#3 0x00007fc0dc1fcde5 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h356e8ce3ed631017E.llvm.13914659533576072043 (librsvg-2.so.2)
#4 0x00007fc0dc1f7157 _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h4255b83c54a050e8E (librsvg-2.so.2)
#5 0x00007fc0dc353bcf _ZN83_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$9call_once17h119df384485e079dE (librsvg-2.so.2)
#6 0x00007fc0dc35446c _ZN3std3sys4unix6thread6Thread3new12thread_start17ha7e8e0c43366c502E (librsvg-2.so.2)
#7 0x00007fc109f714e2 start_thread (libpthread.so.0)
#8 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 6807:
#0 0x00007fc109f77d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1 0x00007fc0dc1f7d5e _ZN10rayon_core5sleep5Sleep5sleep17h2d0f2139607116b6E (librsvg-2.so.2)
#2 0x00007fc0dc1f8402 _ZN10rayon_core8registry12WorkerThread15wait_until_cold17h661dafdfcbaa85e5E (librsvg-2.so.2)
#3 0x00007fc0dc1fcde5 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h356e8ce3ed631017E.llvm.13914659533576072043 (librsvg-2.so.2)
#4 0x00007fc0dc1f7157 _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h4255b83c54a050e8E (librsvg-2.so.2)
#5 0x00007fc0dc353bcf _ZN83_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$9call_once17h119df384485e079dE (librsvg-2.so.2)
#6 0x00007fc0dc35446c _ZN3std3sys4unix6thread6Thread3new12thread_start17ha7e8e0c43366c502E (librsvg-2.so.2)
#7 0x00007fc109f714e2 start_thread (libpthread.so.0)
#8 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 6806:
#0 0x00007fc109f77d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1 0x00007fc0dc1f7d5e _ZN10rayon_core5sleep5Sleep5sleep17h2d0f2139607116b6E (librsvg-2.so.2)
#2 0x00007fc0dc1f8402 _ZN10rayon_core8registry12WorkerThread15wait_until_cold17h661dafdfcbaa85e5E (librsvg-2.so.2)
#3 0x00007fc0dc1fcde5 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h356e8ce3ed631017E.llvm.13914659533576072043 (librsvg-2.so.2)
#4 0x00007fc0dc1f7157 _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h4255b83c54a050e8E (librsvg-2.so.2)
#5 0x00007fc0dc353bcf _ZN83_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$9call_once17h119df384485e079dE (librsvg-2.so.2)
#6 0x00007fc0dc35446c _ZN3std3sys4unix6thread6Thread3new12thread_start17ha7e8e0c43366c502E (librsvg-2.so.2)
#7 0x00007fc109f714e2 start_thread (libpthread.so.0)
#8 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 1181:
#0 0x00007fc10abcea6f __poll (libc.so.6)
#1 0x00007fc10b92980e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
#2 0x00007fc10b929943 g_main_context_iteration (libglib-2.0.so.0)
#3 0x00007fc10551293d dconf_gdbus_worker_thread (libdconfsettings.so)
#4 0x00007fc10b952fc2 g_thread_proxy (libglib-2.0.so.0)
#5 0x00007fc109f714e2 start_thread (libpthread.so.0)
#6 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 1216:
#0 0x00007fc109f77d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1 0x00007fc10845b06d _ZN7mozilla6detail21ConditionVariableImpl4waitERNS0_9MutexImplE (libmozjs-60.so.0)
#2 0x00007fc10845b245 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-60.so.0)
#3 0x00007fc1086bc98f _ZN2js12HelperThread10threadLoopEv (libmozjs-60.so.0)
#4 0x00007fc1086bca69 _ZN2js12HelperThread10ThreadMainEPv (libmozjs-60.so.0)
#5 0x00007fc1086b46a9 _ZN2js6detail16ThreadTrampolineIRFvPvEJPNS_12HelperThreadEEE5StartES2_ (libmozjs-60.so.0)
#6 0x00007fc109f714e2 start_thread (libpthread.so.0)
#7 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 1215:
#0 0x00007fc109f77d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1 0x00007fc10845b06d _ZN7mozilla6detail21ConditionVariableImpl4waitERNS0_9MutexImplE (libmozjs-60.so.0)
#2 0x00007fc10845b245 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-60.so.0)
#3 0x00007fc1086bc98f _ZN2js12HelperThread10threadLoopEv (libmozjs-60.so.0)
#4 0x00007fc1086bca69 _ZN2js12HelperThread10ThreadMainEPv (libmozjs-60.so.0)
#5 0x00007fc1086b46a9 _ZN2js6detail16ThreadTrampolineIRFvPvEJPNS_12HelperThreadEEE5StartES2_ (libmozjs-60.so.0)
#6 0x00007fc109f714e2 start_thread (libpthread.so.0)
#7 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 1189:
#0 0x00007fc109f77d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1 0x00007fc0f22c711b util_queue_thread_func (r600_dri.so)
#2 0x00007fc0f22c6d2b impl_thrd_routine (r600_dri.so)
#3 0x00007fc109f714e2 start_thread (libpthread.so.0)
#4 0x00007fc10abd9693 __clone (libc.so.6)
Stack trace of thread 6524:
#0 0x00007fc10abcea6f __poll (libc.so.6)
#1 0x00007fc0dcb66196 poll_func (libpulse.so.0)
#2 0x00007fc0dcb57801 pa_mainloop_poll (libpulse.so.0)
#3 0x00007fc0dcb57e83 pa_mainloop_iterate (libpulse.so.0)
#4 0x00007fc0dcb57f30 pa_mainloop_run (libpulse.so.0)
#5 0x00007fc0dcb660dd thread (libpulse.so.0)
#6 0x00007fc0dcb01b9c internal_thread_func (libpulsecommon-13.0.so)
#7 0x00007fc109f714e2 start_thread (libpthread.so.0)
#8 0x00007fc10abd9693 __clone (libc.so.6)
This also seems to happen when running some other apps. Please see the similiar issue here.
Edited by Philip Chimento