Keruspe / GPaste

Clipboard management system
BSD 2-Clause "Simplified" License
784 stars 56 forks source link

crashes when ~/.local/share/gpaste doesn't exist #378

Closed attila-lendvai closed 2 years ago

attila-lendvai commented 2 years ago

i'm packaging GPaste for guix. i'm using the tag 3.34.4 because gnome-shell --version => GNOME Shell 3.34.5.

$ gdb /gnu/store/pzklfrj5vyrri5y0kqxadcq5lh9q26dj-gpaste-3.34.4/libexec/gpaste/gpaste-ui 
Reading symbols from /gnu/store/pzklfrj5vyrri5y0kqxadcq5lh9q26dj-gpaste-3.34.4/libexec/gpaste/gpaste-ui...
(gdb) r
Starting program: /gnu/store/pzklfrj5vyrri5y0kqxadcq5lh9q26dj-gpaste-3.34.4/libexec/gpaste/gpaste-ui 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libthread_db.so.1".
[New Thread 0x7ffff64e0700 (LWP 13879)]
[New Thread 0x7ffff5cdf700 (LWP 13880)]
[New Thread 0x7ffff4c1c700 (LWP 13881)]
[New Thread 0x7fffe7fff700 (LWP 13882)]

Thread 1 "gpaste-ui" received signal SIGSEGV, Segmentation fault.
on_histories_ready (source_object=<optimized out>, res=<optimized out>, user_data=0x9118c0) at src/libgpaste/ui/gpaste-ui-panel.c:187
187     for (GStrv h = histories; *h; ++h)
(gdb) back
#0  on_histories_ready (source_object=<optimized out>, res=<optimized out>, user_data=0x9118c0) at src/libgpaste/ui/gpaste-ui-panel.c:187
#1  0x00007ffff76ce489 in g_task_return_now () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libgio-2.0.so.0
#2  0x00007ffff76cef93 in g_task_return.part () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libgio-2.0.so.0
#3  0x00007ffff772f065 in reply_cb () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libgio-2.0.so.0
#4  0x00007ffff76ce489 in g_task_return_now () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libgio-2.0.so.0
#5  0x00007ffff76cef93 in g_task_return.part () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libgio-2.0.so.0
#6  0x00007ffff7723fe2 in g_dbus_connection_call_done () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libgio-2.0.so.0
#7  0x00007ffff76ce489 in g_task_return_now () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libgio-2.0.so.0
#8  0x00007ffff76ce4c9 in complete_in_idle_cb () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libgio-2.0.so.0
#9  0x00007ffff74eef14 in g_main_context_dispatch () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libglib-2.0.so.0
#10 0x00007ffff74ef288 in g_main_context_iterate.isra () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libglib-2.0.so.0
#11 0x00007ffff74ef30c in g_main_context_iteration () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libglib-2.0.so.0
#12 0x00007ffff76f9a3d in g_application_run () from /gnu/store/3374zddwfb0m8711k2jrvhwr1s2fkvq3-glib-2.62.6/lib/libgio-2.0.so.0
#13 0x00000000004023b9 in main (argc=1, argv=0x7fffffffc738) at src/ui/gpaste-ui.c:113
(gdb) info locals
h = 0x0
data = 0x9118c0
priv = 0x7eda30
histories = 0x0
current = 0x7fffe8014750 "history"
(gdb) 

notice how histories is null.

the clue was:

$ gpaste-client list-histories

** (gpaste-client:14109): CRITICAL **: 18:29:21.049: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code1: Error opening directory '/home/alendvai/.local/share/gpaste': No such file or directory

once i mkdir ~/.local/share/gpaste then the gui comes up, even though that directory is still empty.

attila-lendvai commented 2 years ago

maybe related to: https://github.com/Keruspe/GPaste/issues/347

attila-lendvai commented 2 years ago

seems to be the same with a new version:

$ gpaste-client version
GPaste 3.42.2
$ mv ~/.local/share/gpaste/ /tmp/
$ gpaste-client list-histories 

** (gpaste-client:14561): CRITICAL **: 14:21:27.149: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code1: Error opening directory '/home/alendvai/.local/share/gpaste': No such file or directory