segfault when file disappears
When downloading a file with Firefox, and when mousepad is the application to process the downloaded file, the newly launched mousepad will segfault. I suspect this is due to the fact that Firefox removes the file again because it must assume the just launched helper is done with it. Perhaps the mousepad process should not fork itself.
#0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
#1 0x00007fa1eb5a6ec4 in dup_dirname (dirname=0x0) at inotify-sub.c:37
#2 _ih_sub_new (dirname=dirname@entry=0x0, filename=filename@entry=0x0, watch_hardlinks=1, user_data=user_data@entry=0x555ac0639cb0) at inotify-sub.c:54
#3 0x00007fa1eb5a8486 in g_inotify_file_monitor_start
(local_monitor=0x555ac0746cb0 [GInotifyFileMonitor], dirname=0x0, basename=0x0, filename=0x555ac06c66d0 "/tmp/mozilla_mozillaUser0/xbacklight.c", source=0x555ac0639cb0) at ginotifyfilemonitor.c:64
#4 0x00007fa1eb57c10d in g_local_file_monitor_start
(local_monitor=local_monitor@entry=0x555ac0746cb0 [GInotifyFileMonitor], filename=filename@entry=0x7fa1cc00a7f0 "/tmp/mozilla_mozillaUser0/xbacklight.c", is_directory=is_directory@entry=0, flags=flags@entry=(G_FILE_MONITOR_WATCH_HARD_LINKS | G_FILE_MONITOR_WATCH_MOVES), context=0x0) at glocalfilemonitor.c:777
#5 0x00007fa1eb57c286 in g_local_file_monitor_new_for_path
(pathname=0x7fa1cc00a7f0 "/tmp/mozilla_mozillaUser0/xbacklight.c", is_directory=0, flags=(G_FILE_MONITOR_WATCH_HARD_LINKS | G_FILE_MONITOR_WATCH_MOVES), error=<optimized out>) at glocalfilemonitor.c:861
#6 0x00007fa1eb4e5de0 in g_file_monitor_file
(file=0x555abfd27f80, flags=flags@entry=(G_FILE_MONITOR_WATCH_HARD_LINKS | G_FILE_MONITOR_WATCH_MOVES), cancellable=cancellable@entry=0x0, error=error@entry=0x7fff1f47c130) at gfile.c:5327
#7 0x0000555abf3a75e3 in mousepad_file_set_monitor (data=data@entry=0x555ac0505120) at mousepad-file.c:228
#8 0x00007fa1eaf738ed in g_timeout_dispatch (source=0x555abfc3e300, callback=0x555abf3a7520 <mousepad_file_set_monitor>, user_data=0x555ac0505120)
at gmain.c:4615
#9 0x00007fa1eaf72e87 in g_main_dispatch (context=0x555abfba9400) at gmain.c:3142
#10 g_main_context_dispatch (context=context@entry=0x555abfba9400) at gmain.c:3795
#11 0x00007fa1eaf73230 in g_main_context_iterate (context=0x555abfba9400, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at gmain.c:3868
#12 0x00007fa1eaf73542 in g_main_loop_run (loop=0x555ac063fcc0) at gmain.c:4064
#13 0x00007fa1ec1417e3 in gtk_dialog_run (dialog=dialog@entry=0x555ac0630460 [MousepadEncodingDialog]) at gtkdialog.c:1401
#14 0x0000555abf3a6ee5 in mousepad_encoding_dialog
(parent=parent@entry=0x555abfe902b0 [MousepadWindow], file=0x555ac0505120 [MousepadFile], valid=valid@entry=0, encoding=encoding@entry=0x7fff1f47c37c)
at mousepad-encoding-dialog.c:634
#15 0x0000555abf3b7ebf in mousepad_window_open_file (window=window@entry=0x555abfe902b0 [MousepadWindow], file=0x555abfd27f80, encoding=<optimized out>,
encoding@entry=MOUSEPAD_ENCODING_UTF_8, must_exist=must_exist@entry=0) at mousepad-window.c:2021
#16 0x0000555abf3b81f5 in mousepad_window_open_files
(window=window@entry=0x555abfe902b0 [MousepadWindow], files=files@entry=0x7fff1f47c400, n_files=n_files@entry=1, encoding=MOUSEPAD_ENCODING_UTF_8, must_exist=must_exist@entry=0) at mousepad-window.c:2070
#17 0x0000555abf3a0948 in mousepad_application_open
(gapplication=gapplication@entry=0x555abfba50e0 [MousepadApplication], files=files@entry=0x555abfe6c420, n_files=n_files@entry=1, hint=hint@entry=0x0)
at mousepad-application.c:840
#18 0x0000555abf3a0c62 in mousepad_application_command_line
(gapplication=0x555abfba50e0 [MousepadApplication], command_line=0x555abfe85e80 [GApplicationCommandLine]) at mousepad-application.c:754
#19 0x00007fa1e60e66cd in ffi_call_unix64 () at ../src/x86/unix64.S:101
#20 0x00007fa1e60e5bdf in ffi_call_int
(cif=cif@entry=0x7fff1f47c720, fn=fn@entry=0x555abf3a0aa0 <mousepad_application_command_line>, rvalue=<optimized out>, avalue=avalue@entry=0x7fff1f47c610, closure=closure@entry=0x0) at ../src/x86/ffi64.c:662
...
This is caused by G_FILE_MONITOR_WATCH_HARD_LINKS
, which are not handled by glib (_ih_sub_new
in this case).