pwmt / girara

User interface library
https://pwmt.org/projects/girara
zlib License
48 stars 17 forks source link

Test crash with GLib 2.76 #26

Closed sebastinas closed 6 months ago

sebastinas commented 1 year ago

On GitLab by @jtojnar on Mar 12, 2023, 24:28


After updating to GLib 2.76.0, datastructures test crashes:

2/6 datastructures         FAIL              0.18s   exit status 1
>>> LD_LIBRARY_PATH=/build/girara-0.3.9/build/ MALLOC_PERTURB_=174 /build/girara-0.3.9/build/tests/test_datastructures
 ✀  
stdout:
Running suite(s): Datastructures
91%: Checks: 12, Failures: 0, Errors: 1
../tests/test_datastructures.c:238:E:node_basics:test_datastructures_node:0: (after this point) Received signal 11 (Segmentation fault)
stderr:
debug: ../tests/test_datastructures.c:370: critical_print(): expected glib critical: girara_list_merge: assertion 'list != NULL' failed
debug: ../tests/test_datastructures.c:370: critical_print(): expected glib critical: girara_list_merge: assertion 'list != NULL' failed
debug: ../tests/test_datastructures.c:370: critical_print(): expected glib critical: girara_list_find: assertion 'list != NULL && compare != NULL' failed
debug: ../tests/test_datastructures.c:370: critical_print(): expected glib critical: girara_list_find: assertion 'list != NULL && compare != NULL' failed
debug: ../tests/test_datastructures.c:370: critical_print(): expected glib critical: girara_list_find: assertion 'list != NULL && compare != NULL' failed
debug: ../tests/test_datastructures.c:370: critical_print(): expected glib critical: girara_list_find: assertion 'list != NULL && compare != NULL' failed
 0# (anonymous namespace)::segabort_handler(int) in /nix/store/22j72lfbx73y61xv3phyisz9nkkbjk4x-libsegfault-unstable-2022-11-13/lib/libsegfault.so
 1# 0x00007FFFF723DBF0 in /nix/store/8bmp6r3a0xfha3wj36phlc47clh9w81l-glibc-2.35-224/lib/libc.so.6
 2# girara_node_free.localalias at ../girara/datastructures.c:461
 3# test_datastructures_node_fn at ../tests/test_datastructures.c:264
 4# srunner_run_tagged in /nix/store/mj9cq5rdhivvjqyjcaam7klwvzkpl8lr-check-0.15.2/lib/libcheck.so.0
 5# run_suite at ../tests/tests.c:12
 6# __libc_start_call_main in /nix/store/8bmp6r3a0xfha3wj36phlc47clh9w81l-glibc-2.35-224/lib/libc.so.6
 7# __libc_start_main_impl in /nix/store/8bmp6r3a0xfha3wj36phlc47clh9w81l-glibc-2.35-224/lib/libc.so.6
 8# _start in /build/girara-0.3.9/build/tests/test_datastructures
sebastinas commented 1 year ago

On GitLab by @jtojnar on Mar 12, 2023, 14:24


I have bisected this to https://gitlab.gnome.org/GNOME/glib/commit/45b5a6c1e56d5b73cc5ed798ef59a5601e56c170, the removal of slice allocator.

Similar crash happens with GEGL https://gitlab.gnome.org/GNOME/gegl/-/issues/320.

sebastinas commented 1 year ago

On GitLab by @jtojnar on Mar 12, 2023, 15:52


Opened an issue against GLib: https://gitlab.gnome.org/GNOME/glib/-/issues/2937

sebastinas commented 1 year ago

On GitLab by @stiglers-eponym on Mar 14, 2023, 13:22


Hi! This issue seems to be the reason why zathura crashes when trying to see the outline (or table of contents) of a PDF. For me this is a very relevant issue, and maybe others also experience this problem.

For users of Arch Linux: downgrading to GLib 2.74.6 helps.

sebastinas commented 1 year ago

On GitLab by @valoq on Mar 14, 2023, 13:49


As already reported, after upgrading to GLib 2.76 zathura crashes with Segmentation fault when the index is displayed.

There is no relevant output in the debug log but gdb shows:

Thread 1 "zathura" received signal SIGSEGV, Segmentation fault.
0x00007ffff7ea2f8b in girara_node_free () from /usr/lib/libgirara-gtk3.so.3

Possibly related: When compiling zathura with the new glib, I get the following warning:

[66/84] Compiling C object libzathura.a.p/zathura_utils.c.o
In file included from /usr/include/glib-2.0/glib/giochannel.h:36,
                 from /usr/include/glib-2.0/glib.h:56,
                 from /usr/include/gtk-3.0/gdk/gdkconfig.h:8,
                 from /usr/include/gtk-3.0/gdk/gdk.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from ../zathura/utils.c:8:
../zathura/utils.c: In function ‘zathura_get_version_string’:
/usr/include/glib-2.0/glib/gstring.h:72:5: warning: ignoring return value of ‘g_string_free_and_steal’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   68 |   (__builtin_constant_p (free_segment) ?        \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   69 |     ((free_segment) ?                           \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   70 |       (g_string_free) ((str), (free_segment)) : \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   71 |       g_string_free_and_steal (str))            \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   72 |     :                                           \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   73 |     (g_string_free) ((str), (free_segment)))
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../zathura/utils.c:225:3: note: in expansion of macro ‘g_string_free’
  225 |   g_string_free(string, FALSE);
      |   ^~~~~~~~~~~~~
sebastinas commented 1 year ago

On GitLab by @jtojnar on Mar 14, 2023, 13:58


Yes, the warning is also from GLib 2.76.0 bump: https://gitlab.gnome.org/GNOME/glib/-/commit/c3d07a625a407b56432f4b8c60295fd32ee1ee2b

sebastinas commented 1 year ago

It's not related to this issue, though.

sebastinas commented 1 year ago

On GitLab by @Antiz on Mar 14, 2023, 19:14


Hi, I'm (one of) the Arch Linux maintainer of the girara package (and all of the zathura* packages as well).
Thanks for fixing this issue!

We do have an open bug on Arch side regarding this issue . Is a new girara release including this fix already planned?
It's basically just to decide if it's worth patching the current release on Arch side or just waiting for a new upstream release.

Thanks in advance :smile:

sebastinas commented 1 year ago

I can prepare a release next weekend.

sebastinas commented 1 year ago

On GitLab by @Antiz on Mar 14, 2023, 19:16


Sounds good to me. Thanks a lot!

sebastinas commented 1 year ago

On GitLab by @valoq on Mar 16, 2023, 11:48


mentioned in issue zathura#342

sebastinas commented 1 year ago

On GitLab by @valoq on Mar 16, 2023, 11:48


mentioned in issue zathura#343

sebastinas commented 1 year ago

mentioned in commit 6926cc1234853ccf3010a1e2625aafcf462ed60e

sebastinas commented 1 year ago

On GitLab by @kamsh on Mar 22, 2023, 16:40


mentioned in issue zathura#344