Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tray: cairo_surface_reference assertion failure #11984

Open
Green-Sky opened this issue Jan 16, 2025 · 4 comments
Open

tray: cairo_surface_reference assertion failure #11984

Green-Sky opened this issue Jan 16, 2025 · 4 comments
Assignees
Milestone

Comments

@Green-Sky
Copy link
Contributor

Green-Sky commented Jan 16, 2025

Having the tray exist can cause a random crash.

Linux (nixos) using libayatana-appindicator

commit 355f69e

../src/cairo-surface.c:938: cairo_surface_reference: Assertion `CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count)' failed.

Thread 2 "tray gtk" received signal SIGABRT, Aborted.
[Switching to LWP 1515785]
0x00007ffff74a2efc in __pthread_kill_implementation () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
(gdb) bt
#0  0x00007ffff74a2efc in __pthread_kill_implementation () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#1  0x00007ffff7452e86 in raise () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#2  0x00007ffff743b935 in abort () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#3  0x00007ffff743b859 in __assert_fail_base.cold () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#4  0x00007ffff744b6e6 in __assert_fail () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#5  0x00007ffff0e037ad in cairo_surface_reference () from /nix/store/ag0yl2kh55ab1n3jq9d3ha0z0qi8krm2-cairo-1.18.0/lib/libcairo.so.2
#6  0x00007ffff0db9d68 in _cairo_gstate_init () from /nix/store/ag0yl2kh55ab1n3jq9d3ha0z0qi8krm2-cairo-1.18.0/lib/libcairo.so.2
#7  0x00007ffff0db6514 in _cairo_default_context_create () from /nix/store/ag0yl2kh55ab1n3jq9d3ha0z0qi8krm2-cairo-1.18.0/lib/libcairo.so.2
#8  0x00007ffff11cb4ab in get_surface_size () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#9  0x00007ffff11cbf46 in _gtk_icon_helper_get_size () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#10 0x00007ffff11e0eab in gtk_image_render_contents () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#11 0x00007ffff112dbbd in gtk_css_custom_gadget_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#12 0x00007ffff1133bff in gtk_css_gadget_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#13 0x00007ffff11e08f1 in gtk_image_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#14 0x00007ffff135d424 in gtk_widget_draw_internal () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#15 0x00007ffff1127aa1 in gtk_container_propagate_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#16 0x00007ffff1127bac in gtk_container_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#17 0x00007ffff141344e in gtk_tray_icon_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#18 0x00007ffff135d424 in gtk_widget_draw_internal () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#19 0x00007ffff13668a8 in gtk_widget_render () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#20 0x00007ffff12079bf in gtk_main_do_event () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#21 0x00007ffff18ec745 in _gdk_event_emit () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#22 0x00007ffff18fb689 in _gdk_window_process_updates_recurse_helper () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#23 0x00007ffff18fd296 in gdk_window_process_updates_internal () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#24 0x00007ffff18fd497 in gdk_window_process_updates_with_mode () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#25 0x00007ffff1860861 in _g_closure_invoke_va () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libgobject-2.0.so.0
#26 0x00007ffff187669c in signal_emit_valist_unlocked () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libgobject-2.0.so.0
#27 0x00007ffff187c2c2 in g_signal_emit_valist () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libgobject-2.0.so.0
#28 0x00007ffff187c36f in g_signal_emit () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libgobject-2.0.so.0
#29 0x00007ffff18f5a8f in gdk_frame_clock_paint_idle () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#30 0x00007ffff18e1b37 in gdk_threads_dispatch () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#31 0x00007ffff0aaec7a in g_timeout_dispatch () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libglib-2.0.so.0
#32 0x00007ffff0aaae39 in g_main_dispatch () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libglib-2.0.so.0
#33 0x00007ffff0aadfd7 in g_main_context_iterate_unlocked.isra () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libglib-2.0.so.0
#34 0x00007ffff0aae88f in g_main_loop_run () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libglib-2.0.so.0
#35 0x00007ffff1206b35 in gtk_main () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#36 0x00000000005c837c in main_gtk_thread (data=data@entry=0x0) at /nix/store/ypyyh34hziz6psvyb3z004dczv9x19ya-source/src/tray/unix/SDL_tray.c:133
#37 0x0000000000587125 in SDL_RunThread (thread=0x1fc9b20) at /nix/store/ypyyh34hziz6psvyb3z004dczv9x19ya-source/src/thread/SDL_thread.c:328
#38 0x00000000005d5541 in RunThread (data=<optimized out>) at /nix/store/ypyyh34hziz6psvyb3z004dczv9x19ya-source/src/thread/pthread/SDL_systhread.c:73
#39 0x00007ffff74a1272 in start_thread () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#40 0x00007ffff751cdec in clone3 () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
(gdb) info threads
  Id   Target Id                    Frame
  1    LWP 1515781 "tomato"         0x00007ffff7464a29 in __mpn_divrem () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
* 2    LWP 1515785 "tray gtk"       0x00007ffff74a2efc in __pthread_kill_implementation () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
  3    LWP 1515786 "pool-spawner"   0x00007ffff751ad1d in syscall () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
  4    LWP 1515787 "gmain"          0x00007ffff750f62f in poll () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
  7    LWP 1515790 "gdbus"          0x00007ffff750f62f in poll () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
  8    LWP 1515791 "tomato"         0x00007ffff74e90c5 in clock_nanosleep@GLIBC_2.2.5 () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
  9    LWP 1515792 "tray gtk"       0x00007ffff751ad1d in syscall () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
  10   LWP 1515801 "pw-data-loop"   0x00007ffff751d206 in epoll_wait () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
  11   LWP 1515802 "SDLPwAudioPlug" 0x00007ffff751d206 in epoll_wait () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6

Same crash also previously reported in #11893

tomato: ../src/cairo-surface.c:938: cairo_surface_reference: Assertion `CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count)' failed.

Thread 2 "tray gtk" received signal SIGABRT, Aborted.
[Switching to LWP 624082]
0x00007ffff74a2efc in __pthread_kill_implementation ()
   from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
(gdb) bt
#0  0x00007ffff74a2efc in __pthread_kill_implementation () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#1  0x00007ffff7452e86 in raise () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#2  0x00007ffff743b935 in abort () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#3  0x00007ffff743b859 in __assert_fail_base.cold () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#4  0x00007ffff744b6e6 in __assert_fail () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#5  0x00007ffff0e037ad in cairo_surface_reference () from /nix/store/ag0yl2kh55ab1n3jq9d3ha0z0qi8krm2-cairo-1.18.0/lib/libcairo.so.2
#6  0x00007ffff0db9d68 in _cairo_gstate_init () from /nix/store/ag0yl2kh55ab1n3jq9d3ha0z0qi8krm2-cairo-1.18.0/lib/libcairo.so.2
#7  0x00007ffff0db6514 in _cairo_default_context_create () from /nix/store/ag0yl2kh55ab1n3jq9d3ha0z0qi8krm2-cairo-1.18.0/lib/libcairo.so.2
#8  0x00007ffff11cb4ab in get_surface_size () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#9  0x00007ffff11cbf46 in _gtk_icon_helper_get_size () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#10 0x00007ffff11e0eab in gtk_image_render_contents () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#11 0x00007ffff112dbbd in gtk_css_custom_gadget_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#12 0x00007ffff1133bff in gtk_css_gadget_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#13 0x00007ffff11e08f1 in gtk_image_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#14 0x00007ffff135d424 in gtk_widget_draw_internal () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#15 0x00007ffff1127aa1 in gtk_container_propagate_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#16 0x00007ffff1127bac in gtk_container_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#17 0x00007ffff141344e in gtk_tray_icon_draw () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#18 0x00007ffff135d424 in gtk_widget_draw_internal () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#19 0x00007ffff13668a8 in gtk_widget_render () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#20 0x00007ffff12079bf in gtk_main_do_event () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#21 0x00007ffff18ec745 in _gdk_event_emit () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#22 0x00007ffff18fb689 in _gdk_window_process_updates_recurse_helper () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#23 0x00007ffff18fd296 in gdk_window_process_updates_internal () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#24 0x00007ffff18fd497 in gdk_window_process_updates_with_mode () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#25 0x00007ffff1833861 in _g_closure_invoke_va () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libgobject-2.0.so.0
#26 0x00007ffff184969c in signal_emit_valist_unlocked () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libgobject-2.0.so.0
#27 0x00007ffff184f2c2 in g_signal_emit_valist () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libgobject-2.0.so.0
#28 0x00007ffff184f36f in g_signal_emit () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libgobject-2.0.so.0
#29 0x00007ffff18f5a8f in gdk_frame_clock_paint_idle () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#30 0x00007ffff18e1b37 in gdk_threads_dispatch () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgdk-3.so.0
#31 0x00007ffff0aaec7a in g_timeout_dispatch () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libglib-2.0.so.0
#32 0x00007ffff0aaae39 in g_main_dispatch () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libglib-2.0.so.0
#33 0x00007ffff0aadfd7 in g_main_context_iterate_unlocked.isra () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libglib-2.0.so.0
#34 0x00007ffff0aae88f in g_main_loop_run () from /nix/store/yl0m9g65iv1wa6lrbbk959ag2ahw355b-glib-2.80.2/lib/libglib-2.0.so.0
#35 0x00007ffff1206b35 in gtk_main () from /nix/store/wky1jsp6g0vdn7i81g1s5yvha6fnadpr-gtk+3-3.24.42/lib/libgtk-3.so.0
#36 0x00000000005c74d9 in main_gtk_thread (data=data@entry=0x0) at /nix/store/2pwh4vl9h00kina3vwxykrjgwja1j95h-source/src/tray/unix/SDL_tray.c:131
#37 0x0000000000586bca in SDL_RunThread (thread=0x13dfe90) at /nix/store/2pwh4vl9h00kina3vwxykrjgwja1j95h-source/src/thread/SDL_thread.c:328
#38 0x00000000005d550f in RunThread (data=<optimized out>) at /nix/store/2pwh4vl9h00kina3vwxykrjgwja1j95h-source/src/thread/pthread/SDL_systhread.c:73
#39 0x00007ffff74a1272 in start_thread () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
#40 0x00007ffff751cdec in clone3 () from /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
@slouken slouken added this to the 3.2.0 milestone Jan 16, 2025
@slouken
Copy link
Collaborator

slouken commented Jan 16, 2025

@Semphriss, can you take a look?

@Semphriss
Copy link
Contributor

@Green-Sky Can you send a minimal reproducible code sample and specify when and how consistently the crash happens?

Since the crash happens in gtk_main, it's more difficult to guess which part of the code causes the crash. I did read that GTK functions, although they can be called from any thread, must be called from the same thread. That isn't the case currently, so I'll add myself the task of making it all happen in one thread.

@slouken
Copy link
Collaborator

slouken commented Jan 16, 2025

@Green-Sky Can you send a minimal reproducible code sample and specify when and how consistently the crash happens?

Since the crash happens in gtk_main, it's more difficult to guess which part of the code causes the crash. I did read that GTK functions, although they can be called from any thread, must be called from the same thread. That isn't the case currently, so I'll add myself the task of making it all happen in one thread.

Yes, you'll definitely have to do that.

@slouken
Copy link
Collaborator

slouken commented Jan 16, 2025

By the way, we're planning a release candidate build in the next few days, so if you can get to your tray bugs soon that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants