nomeata / screen-message

Very simple tool to display some text as large as possible
54 stars 8 forks source link

crashes on rather large screens (some letters, some fonts only) #11

Open luto opened 1 year ago

luto commented 1 year ago

Some time ago sm started crashing for me when I press the letter E. This is on arch linux, sm installed from the AUR.

  1. start sm
  2. press e key
  3. crash

Any other letter (e.g. a) works fine.

The makes me sad, because I LOVE your tool and use it every single day. I already recompiled it, which didn't help. Below is a stack trace from gdb. Let me know if there is anything else I can provide. I am a dev myself, but inexperienced with C. However, if you give me some keywords on what to do, I am happy to get you more debugging info or try patches.

Thank you!

(gdb) run
Starting program: /usr/bin/sm 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff2fff6c0 (LWP 223708)]
[New Thread 0x7ffff27fe6c0 (LWP 223709)]
[New Thread 0x7ffff1ffd6c0 (LWP 223710)]
[Thread 0x7ffff1ffd6c0 (LWP 223710) exited]
[New Thread 0x7ffff1ffd6c0 (LWP 223711)]
[New Thread 0x7ffff17fc6c0 (LWP 223712)]
[Thread 0x7ffff1ffd6c0 (LWP 223711) exited]
[Thread 0x7ffff17fc6c0 (LWP 223712) exited]
[New Thread 0x7ffff17fc6c0 (LWP 223713)]
[New Thread 0x7ffff1ffd6c0 (LWP 223714)]
[Thread 0x7ffff17fc6c0 (LWP 223713) exited]
[Thread 0x7ffff1ffd6c0 (LWP 223714) exited]
[New Thread 0x7ffff1ffd6c0 (LWP 223715)]
[New Thread 0x7ffff17fc6c0 (LWP 223716)]
[New Thread 0x7ffff0eb36c0 (LWP 223717)]
[New Thread 0x7fffdbfff6c0 (LWP 223718)]
[Thread 0x7ffff0eb36c0 (LWP 223717) exited]
[New Thread 0x7ffff0eb36c0 (LWP 223719)]
[New Thread 0x7fffdb7fe6c0 (LWP 223720)]
[Thread 0x7fffdbfff6c0 (LWP 223718) exited]
[Thread 0x7ffff0eb36c0 (LWP 223719) exited]
[Thread 0x7fffdb7fe6c0 (LWP 223720) exited]
[Thread 0x7ffff1ffd6c0 (LWP 223715) exited]

Thread 1 "sm" received signal SIGSEGV, Segmentation fault.
0x00007ffff66c5284 in pixman_image_get_format () from /usr/lib/libpixman-1.so.0
(gdb) bt
#0  0x00007ffff66c5284 in pixman_image_get_format () at /usr/lib/libpixman-1.so.0
#1  0x00007ffff7573463 in _cairo_ft_scaled_glyph_init_surface
    (scaled_font=scaled_font@entry=0x555555662870, scaled_glyph=scaled_glyph@entry=0x555555908fb0, info=info@entry=CAIRO_SCALED_GLYPH_INFO_SURFACE, face=face@entry=0x555555833600, foreground_color=foreground_color@entry=0x0, vertical_layout=vertical_layout@entry=0, load_flags=<optimized out>) at ../cairo/src/cairo-ft-font.c:2574
#2  0x00007ffff75748d3 in _cairo_ft_scaled_glyph_init
    (abstract_font=0x555555662870, scaled_glyph=0x555555908fb0, info=CAIRO_SCALED_GLYPH_INFO_SURFACE, foreground_color=<optimized out>) at ../cairo/src/cairo-ft-font.c:2754
#3  0x00007ffff753bd98 in _cairo_scaled_glyph_lookup
    (scaled_font=0x555555662870, index=<optimized out>, info=(CAIRO_SCALED_GLYPH_INFO_METRICS | CAIRO_SCALED_GLYPH_INFO_SURFACE), foreground_color=0x7ffff75c8660 <cairo_color_black.lto_priv>, scaled_glyph_ret=0x7fffffff9bd0) at ../cairo/src/cairo-scaled-font.c:3073
#4  0x00007ffff7578f40 in _cairo_xlib_surface_add_glyph (pscaled_glyph=0x7fffffff9bd0, font=0x555555662870, display=0x555555713a70)
    at ../cairo/src/cairo-xlib-render-compositor.c:1203
#5  composite_glyphs (surface=0x555555709090, op=CAIRO_OPERATOR_IN, _src=0x5555555e3120, src_x=0, src_y=0, dst_x=0, dst_y=0, info=0x7fffffff9d90)
    at ../cairo/src/cairo-xlib-render-compositor.c:1633
#6  0x00007ffff754d43b in clip_and_composite
    (compositor=0x7ffff75ff640 <compositor>, extents=0x7fffffff9e30, draw_func=0x7ffff754e580 <composite_glyphs>, mask_func=0x0, draw_closure=0x7fffffff9d90, need_clip=4)
    at ../cairo/src/cairo-traps-compositor.c:1049
#7  0x00007ffff754ee35 in _cairo_traps_compositor_glyphs
    (_compositor=0x7ffff75ff640 <compositor>, extents=0x7fffffff9e30, scaled_font=0x555555662870, glyphs=0x7fffffffa5b0, num_glyphs=<optimized out>, overlap=0)
    at ../cairo/src/cairo-traps-compositor.c:2331
#8  0x00007ffff74f9929 in _cairo_compositor_glyphs
    (compositor=0x7ffff75ff640 <compositor>, surface=0x555555709090, op=<optimized out>, source=<optimized out>, glyphs=0x7fffffffa5b0, num_glyphs=1, scaled_font=0x555555662870, clip=0x5555557c0610) at ../cairo/src/cairo-compositor.c:292
#9  0x00007ffff7580af9 in _cairo_xlib_surface_glyphs
    (_surface=<optimized out>, op=CAIRO_OPERATOR_OVER, source=0x7fffffffa260, glyphs=0x7fffffffa5b0, num_glyphs=1, scaled_font=0x555555662870, clip=0x5555557c0610)
    at ../cairo/src/cairo-xlib-surface.c:1665
#10 0x00007ffff754837c in _cairo_surface_show_text_glyphs
    (surface=0x555555709090, op=CAIRO_OPERATOR_OVER, source=0x7fffffffa260, utf8=0x0, utf8_len=<optimized out>, glyphs=0x7fffffffa5b0, num_glyphs=<optimized out>, clusters=0x0, num_clusters=<optimized out>, cluster_flags=0, scaled_font=0x555555662870, clip=0x5555557c0610) at ../cairo/src/cairo-surface.c:2920
#11 0x00007ffff750404a in _cairo_gstate_show_text_glyphs (gstate=0x5555555e5690, glyphs=<optimized out>, num_glyphs=<optimized out>, info=0x0)
    at ../cairo/src/cairo-gstate.c:2077
#12 0x00007ffff75558d6 in cairo_show_glyphs (num_glyphs=1, glyphs=0x7fffffffb650, cr=0x55555564e110) at ../cairo/src/cairo.c:3670
#13 cairo_show_glyphs (cr=0x55555564e110, glyphs=glyphs@entry=0x7fffffffb650, num_glyphs=num_glyphs@entry=1) at ../cairo/src/cairo.c:3650
#14 0x00007ffff7e7983c in pango_cairo_renderer_show_text_glyphs
    (renderer=renderer@entry=0x55555563ab90, text=text@entry=0x0, text_len=text_len@entry=0, glyphs=glyphs@entry=0x555555723520, clusters=clusters@entry=0x0, num_clusters=num_clusters@entry=0, backward=0, font=0x55555580b9f0, x=0, y=380928) at ../pango/pango/pangocairo-render.c:495
#15 0x00007ffff7e79aac in pango_cairo_renderer_draw_glyph_item
    (renderer=0x55555563ab90, text=0x5555558be3c0 "e", glyph_item=<optimized out>, x=<optimized out>, y=<optimized out>) at ../pango/pango/pangocairo-render.c:540
#16 0x00007ffff7e371d3 in pango_renderer_draw_glyph_item
    (renderer=renderer@entry=0x55555563ab90, text=text@entry=0x5555558be3c0 "e", glyph_item=glyph_item@entry=0x55555571f1a0, x=x@entry=0, y=y@entry=380928)
    at ../pango/pango/pango-renderer.c:856
#17 0x00007ffff7e3ff0a in pango_renderer_draw_layout_line (renderer=renderer@entry=0x55555563ab90, line=line@entry=0x55555589ad90, x=0, y=380928)
    at ../pango/pango/pango-renderer.c:691
#18 0x00007ffff7e405b9 in pango_renderer_draw_layout (renderer=renderer@entry=0x55555563ab90, layout=layout@entry=0x55555563a9b0, x=x@entry=0, y=y@entry=0)
    at ../pango/pango/pango-renderer.c:201
#19 0x00007ffff7e7a687 in _pango_cairo_do_layout (do_path=0, layout=0x55555563a9b0, cr=0x55555564e110) at ../pango/pango/pangocairo-render.c:1007
--Type <RET> for more, q to quit, c to continue without paging--
#20 pango_cairo_show_layout (cr=0x55555564e110, layout=0x55555563a9b0) at ../pango/pango/pangocairo-render.c:1139
#21 0x00005555555580f2 in  ()
#22 0x00007ffff7687c89 in _gtk_marshal_BOOLEAN__BOXEDv
    (closure=0x55555572bbc0, return_value=0x7fffffffcc60, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x5555555e54e0) at gtk/gtkmarshalers.c:130
#23 0x00007ffff79261fc in gtk_widget_draw_marshallerv
    (closure=0x55555572bbc0, return_value=0x7fffffffcc60, instance=0x5555555de210, args=0x7fffffffcd10, marshal_data=0x0, n_params=1, param_types=0x5555555e54e0)
    at ../gtk/gtk/gtkwidget.c:979
#24 0x00007ffff74ad11c in _g_closure_invoke_va
    (param_types=<optimized out>, n_params=<optimized out>, args=0x7fffffffcd10, instance=<optimized out>, return_value=<optimized out>, closure=0x55555572bbc0)
    at ../glib/gobject/gclosure.c:895
#25 g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffcd10)
    at ../glib/gobject/gsignal.c:3456
#26 0x00007ffff74ad204 in g_signal_emit (instance=instance@entry=0x5555555de210, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3606
#27 0x00007ffff7935993 in gtk_widget_draw_internal (widget=0x5555555de210, cr=0x55555564e110, clip_to_size=<optimized out>) at ../gtk/gtk/gtkwidget.c:7077
#28 0x00007ffff770775e in gtk_container_propagate_draw (container=container@entry=0x555555882550, child=0x5555555de210, cr=cr@entry=0x55555564e110)
    at ../gtk/gtk/gtkcontainer.c:3854
#29 0x00007ffff7707886 in gtk_container_draw (widget=0x555555882550, cr=0x55555564e110) at ../gtk/gtk/gtkcontainer.c:3674
#30 0x00007ffff76b5611 in gtk_box_draw_contents
    (gadget=<optimized out>, cr=<optimized out>, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>, unused=0x0) at ../gtk/gtk/gtkbox.c:453
#31 0x00007ffff77080e1 in gtk_css_custom_gadget_draw
    (gadget=<optimized out>, cr=<optimized out>, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>) at ../gtk/gtk/gtkcsscustomgadget.c:159
#32 0x00007ffff7713cdc in gtk_css_gadget_draw (gadget=0x5555557ea4e0, cr=0x55555564e110) at ../gtk/gtk/gtkcssgadget.c:885
#33 0x00007ffff76b5b15 in gtk_box_draw (widget=<optimized out>, cr=<optimized out>) at ../gtk/gtk/gtkbox.c:462
#34 0x00007ffff793587a in gtk_widget_draw_internal (widget=0x555555882550, cr=0x55555564e110, clip_to_size=<optimized out>) at ../gtk/gtk/gtkwidget.c:7084
#35 0x00007ffff770775e in gtk_container_propagate_draw (container=container@entry=0x555555614280, child=0x555555882550, cr=cr@entry=0x55555564e110)
    at ../gtk/gtk/gtkcontainer.c:3854
#36 0x00007ffff7707886 in gtk_container_draw (widget=0x555555614280, cr=0x55555564e110) at ../gtk/gtk/gtkcontainer.c:3674
#37 0x00007ffff793587a in gtk_widget_draw_internal (widget=0x555555614280, cr=0x55555564e110, clip_to_size=<optimized out>) at ../gtk/gtk/gtkwidget.c:7084
#38 0x00007ffff7941f63 in gtk_widget_render (widget=0x555555614280, window=0x55555559d5c0, region=<optimized out>) at ../gtk/gtk/gtkwidget.c:17610
#39 0x00007ffff77e2fbb in gtk_main_do_event (event=<optimized out>) at ../gtk/gtk/gtkmain.c:1844
#40 gtk_main_do_event (event=<optimized out>) at ../gtk/gtk/gtkmain.c:1691
#41 0x00007ffff7ebccc3 in _gdk_event_emit (event=0x7fffffffd240) at ../gtk/gdk/gdkevents.c:73
#42 _gdk_event_emit (event=0x7fffffffd240) at ../gtk/gdk/gdkevents.c:67
#43 0x00007ffff7ec4882 in _gdk_window_process_updates_recurse_helper (window=0x55555559d5c0, expose_region=<optimized out>) at ../gtk/gdk/gdkwindow.c:3874
#44 0x00007ffff7ec91ac in gdk_window_process_updates_internal (window=0x55555559d5c0) at ../gtk/gdk/gdkwindow.c:4020
#45 0x00007ffff7ec93b1 in gdk_window_process_updates_with_mode (window=<optimized out>, recurse_mode=<optimized out>) at ../gtk/gdk/gdkwindow.c:4215
#46 0x00007ffff74ad11c in _g_closure_invoke_va
    (param_types=<optimized out>, n_params=<optimized out>, args=0x7fffffffd4e0, instance=<optimized out>, return_value=<optimized out>, closure=0x555555701510)
    at ../glib/gobject/gclosure.c:895
#47 g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd4e0)
    at ../glib/gobject/gsignal.c:3456
#48 0x00007ffff74ad204 in g_signal_emit (instance=instance@entry=0x5555555de330, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3606
#49 0x00007ffff7ec08b1 in _gdk_frame_clock_emit_paint (frame_clock=0x5555555de330) at ../gtk/gdk/gdkframeclock.c:657
#50 gdk_frame_clock_paint_idle (data=0x5555555de330) at ../gtk/gdk/gdkframeclockidle.c:597
--Type <RET> for more, q to quit, c to continue without paging--
#51 0x00007ffff7ead6ae in gdk_threads_dispatch (data=0x555555724000) at ../gtk/gdk/gdk.c:769
#52 0x00007ffff73920a2 in g_timeout_dispatch (source=0x55555578ec00, callback=<optimized out>, user_data=<optimized out>) at ../glib/glib/gmain.c:5007
#53 0x00007ffff739187b in g_main_dispatch (context=0x5555555d0d10) at ../glib/glib/gmain.c:3444
#54 g_main_context_dispatch (context=0x5555555d0d10) at ../glib/glib/gmain.c:4162
#55 0x00007ffff73e8279 in g_main_context_iterate.constprop.0 (context=0x5555555d0d10, block=1, dispatch=1, self=<optimized out>) at ../glib/glib/gmain.c:4238
#56 0x00007ffff7390ddf in g_main_loop_run (loop=0x555555818120) at ../glib/glib/gmain.c:4438
#57 0x00007ffff77d8e9f in gtk_main () at ../gtk/gtk/gtkmain.c:1329
#58 0x0000555555557793 in  ()
#59 0x00007ffff7178290 in __libc_start_call_main (main=main@entry=0x555555557020, argc=argc@entry=1, argv=argv@entry=0x7fffffffd9c8)
    at ../sysdeps/nptl/libc_start_call_main.h:58
#60 0x00007ffff717834a in __libc_start_main_impl
     (main=0x555555557020, argc=1, argv=0x7fffffffd9c8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd9b8) at ../csu/libc-start.c:381
#61 0x0000555555557875 in  ()
nomeata commented 1 year ago

Ha, that's a weird bug! I'm not sure what to do myself, though. sm has been pretty stable for years and I think it's unlikely nobody ever started something with e, so it might have been a change to some of the libraries. The crash seems related to Cairo, maybe open a bug there and see if they have an idea?

luto commented 1 year ago

I am certain something else changed on my system and sm is most likely not at fault, yes. Just out of luck to figure out what exactly 😅 i'll look around.

nomeata commented 1 year ago

It might be at fault if it does something wrong that just happened to have worked before. Thanks for looking into it!

luto commented 1 year ago

backtrace with sm symbols intact:

#0  0x00007ffff6568284 in pixman_image_get_format () at /usr/lib/libpixman-1.so.0
#1  0x00007ffff73a5463 in _cairo_ft_scaled_glyph_init_surface
    (scaled_font=scaled_font@entry=0x55555563bd30, scaled_glyph=scaled_glyph@entry=0x55555590c060, info=info@entry=CAIRO_SCALED_GLYPH_INFO_SURFACE, face=face@entry=0x555555720400, foreground_color=foreground_color@entry=0x0, vertical_layout=vertical_layout@entry=0, load_flags=<optimized out>) at ../cairo/src/cairo-ft-font.c:2574
#2  0x00007ffff73a68d3 in _cairo_ft_scaled_glyph_init
    (abstract_font=0x55555563bd30, scaled_glyph=0x55555590c060, info=CAIRO_SCALED_GLYPH_INFO_SURFACE, foreground_color=<optimized out>) at ../cairo/src/cairo-ft-font.c:2754
#3  0x00007ffff736dd98 in _cairo_scaled_glyph_lookup
    (scaled_font=0x55555563bd30, index=<optimized out>, info=(CAIRO_SCALED_GLYPH_INFO_METRICS | CAIRO_SCALED_GLYPH_INFO_SURFACE), foreground_color=0x7ffff73fa660 <cairo_color_black.lto_priv>, scaled_glyph_ret=0x7fffffff9c10) at ../cairo/src/cairo-scaled-font.c:3073
#4  0x00007ffff73aaf40 in _cairo_xlib_surface_add_glyph (pscaled_glyph=0x7fffffff9c10, font=0x55555563bd30, display=0x555555714c30)
    at ../cairo/src/cairo-xlib-render-compositor.c:1203
#5  composite_glyphs (surface=0x5555558dc030, op=CAIRO_OPERATOR_IN, _src=0x5555555e3130, src_x=0, src_y=0, dst_x=0, dst_y=0, info=0x7fffffff9dd0)
    at ../cairo/src/cairo-xlib-render-compositor.c:1633
#6  0x00007ffff737f43b in clip_and_composite
    (compositor=0x7ffff7431640 <compositor>, extents=0x7fffffff9e70, draw_func=0x7ffff7380580 <composite_glyphs>, mask_func=0x0, draw_closure=0x7fffffff9dd0, need_clip=4)
    at ../cairo/src/cairo-traps-compositor.c:1049
#7  0x00007ffff7380e35 in _cairo_traps_compositor_glyphs
    (_compositor=0x7ffff7431640 <compositor>, extents=0x7fffffff9e70, scaled_font=0x55555563bd30, glyphs=0x7fffffffa5f0, num_glyphs=<optimized out>, overlap=0)
    at ../cairo/src/cairo-traps-compositor.c:2331
#8  0x00007ffff732b929 in _cairo_compositor_glyphs
    (compositor=0x7ffff7431640 <compositor>, surface=0x5555558dc030, op=<optimized out>, source=<optimized out>, glyphs=0x7fffffffa5f0, num_glyphs=1, scaled_font=0x55555563bd30, clip=0x5555558d0f00) at ../cairo/src/cairo-compositor.c:292
#9  0x00007ffff73b2af9 in _cairo_xlib_surface_glyphs
    (_surface=<optimized out>, op=CAIRO_OPERATOR_OVER, source=0x7fffffffa2a0, glyphs=0x7fffffffa5f0, num_glyphs=1, scaled_font=0x55555563bd30, clip=0x5555558d0f00)
    at ../cairo/src/cairo-xlib-surface.c:1665
#10 0x00007ffff737a37c in _cairo_surface_show_text_glyphs
    (surface=0x5555558dc030, op=CAIRO_OPERATOR_OVER, source=0x7fffffffa2a0, utf8=0x0, utf8_len=<optimized out>, glyphs=0x7fffffffa5f0, num_glyphs=<optimized out>, clusters=0x0, num_clusters=<optimized out>, cluster_flags=0, scaled_font=0x55555563bd30, clip=0x5555558d0f00) at ../cairo/src/cairo-surface.c:2920
#11 0x00007ffff733604a in _cairo_gstate_show_text_glyphs (gstate=0x555555631a00, glyphs=<optimized out>, num_glyphs=<optimized out>, info=0x0)
    at ../cairo/src/cairo-gstate.c:2077
#12 0x00007ffff73878d6 in cairo_show_glyphs (num_glyphs=1, glyphs=0x7fffffffb690, cr=0x55555564f990) at ../cairo/src/cairo.c:3670
#13 cairo_show_glyphs (cr=0x55555564f990, glyphs=glyphs@entry=0x7fffffffb690, num_glyphs=num_glyphs@entry=1) at ../cairo/src/cairo.c:3650
#14 0x00007ffff7e3583c in pango_cairo_renderer_show_text_glyphs
    (renderer=renderer@entry=0x55555563cb90, text=text@entry=0x0, text_len=text_len@entry=0, glyphs=glyphs@entry=0x5555557250a0, clusters=clusters@entry=0x0, num_clusters=num_clusters@entry=0, backward=0, font=0x5555558009f0, x=0, y=380928) at ../pango/pango/pangocairo-render.c:495
#15 0x00007ffff7e35aac in pango_cairo_renderer_draw_glyph_item
    (renderer=0x55555563cb90, text=0x55555581a1c0 "e", glyph_item=<optimized out>, x=<optimized out>, y=<optimized out>) at ../pango/pango/pangocairo-render.c:540
#16 0x00007ffff72d51d3 in pango_renderer_draw_glyph_item
    (renderer=renderer@entry=0x55555563cb90, text=text@entry=0x55555581a1c0 "e", glyph_item=glyph_item@entry=0x555555724780, x=x@entry=0, y=y@entry=380928)
    at ../pango/pango/pango-renderer.c:856
#17 0x00007ffff72ddf0a in pango_renderer_draw_layout_line (renderer=renderer@entry=0x55555563cb90, line=line@entry=0x5555557a0de0, x=0, y=380928)
    at ../pango/pango/pango-renderer.c:691
#18 0x00007ffff72de5b9 in pango_renderer_draw_layout (renderer=renderer@entry=0x55555563cb90, layout=layout@entry=0x55555563c9b0, x=x@entry=0, y=y@entry=0)
    at ../pango/pango/pango-renderer.c:201
#19 0x00007ffff7e36687 in _pango_cairo_do_layout (do_path=0, layout=0x55555563c9b0, cr=0x55555564f990) at ../pango/pango/pangocairo-render.c:1007
#20 pango_cairo_show_layout (cr=0x55555564f990, layout=0x55555563c9b0) at ../pango/pango/pangocairo-render.c:1139
#21 0x0000555555557cce in redraw (draw=0x5555555dd210, cr=0x55555564f990, data=0x0) at sm.c:161
--Type <RET> for more, q to quit, c to continue without paging--
#22 0x00007ffff7687c89 in _gtk_marshal_BOOLEAN__BOXEDv
    (closure=0x5555557b9b10, return_value=0x7fffffffcc10, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x5555555e54f0) at gtk/gtkmarshalers.c:130
#23 0x00007ffff79261fc in gtk_widget_draw_marshallerv
    (closure=0x5555557b9b10, return_value=0x7fffffffcc10, instance=0x5555555dd210, args=0x7fffffffccc0, marshal_data=0x0, n_params=1, param_types=0x5555555e54f0)
    at ../gtk/gtk/gtkwidget.c:979
#24 0x00007ffff727711c in _g_closure_invoke_va
    (param_types=<optimized out>, n_params=<optimized out>, args=0x7fffffffccc0, instance=<optimized out>, return_value=<optimized out>, closure=0x5555557b9b10)
    at ../glib/gobject/gclosure.c:895
#25 g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffccc0)
    at ../glib/gobject/gsignal.c:3456
#26 0x00007ffff7277204 in g_signal_emit (instance=instance@entry=0x5555555dd210, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3606
#27 0x00007ffff7935993 in gtk_widget_draw_internal (widget=0x5555555dd210, cr=0x55555564f990, clip_to_size=<optimized out>) at ../gtk/gtk/gtkwidget.c:7077
#28 0x00007ffff770775e in gtk_container_propagate_draw (container=container@entry=0x5555558825c0, child=0x5555555dd210, cr=cr@entry=0x55555564f990)
    at ../gtk/gtk/gtkcontainer.c:3854
#29 0x00007ffff7707886 in gtk_container_draw (widget=0x5555558825c0, cr=0x55555564f990) at ../gtk/gtk/gtkcontainer.c:3674
#30 0x00007ffff76b5611 in gtk_box_draw_contents
    (gadget=<optimized out>, cr=<optimized out>, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>, unused=0x0) at ../gtk/gtk/gtkbox.c:453
#31 0x00007ffff77080e1 in gtk_css_custom_gadget_draw
    (gadget=<optimized out>, cr=<optimized out>, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>) at ../gtk/gtk/gtkcsscustomgadget.c:159
#32 0x00007ffff7713cdc in gtk_css_gadget_draw (gadget=0x5555557e14f0, cr=0x55555564f990) at ../gtk/gtk/gtkcssgadget.c:885
#33 0x00007ffff76b5b15 in gtk_box_draw (widget=<optimized out>, cr=<optimized out>) at ../gtk/gtk/gtkbox.c:462
#34 0x00007ffff793587a in gtk_widget_draw_internal (widget=0x5555558825c0, cr=0x55555564f990, clip_to_size=<optimized out>) at ../gtk/gtk/gtkwidget.c:7084
#35 0x00007ffff770775e in gtk_container_propagate_draw (container=container@entry=0x555555614280, child=0x5555558825c0, cr=cr@entry=0x55555564f990)
    at ../gtk/gtk/gtkcontainer.c:3854
#36 0x00007ffff7707886 in gtk_container_draw (widget=0x555555614280, cr=0x55555564f990) at ../gtk/gtk/gtkcontainer.c:3674
#37 0x00007ffff793587a in gtk_widget_draw_internal (widget=0x555555614280, cr=0x55555564f990, clip_to_size=<optimized out>) at ../gtk/gtk/gtkwidget.c:7084
#38 0x00007ffff7941f63 in gtk_widget_render (widget=0x555555614280, window=0x55555559d5c0, region=<optimized out>) at ../gtk/gtk/gtkwidget.c:17610
#39 0x00007ffff77e2fbb in gtk_main_do_event (event=<optimized out>) at ../gtk/gtk/gtkmain.c:1844
#40 gtk_main_do_event (event=<optimized out>) at ../gtk/gtk/gtkmain.c:1691
#41 0x00007ffff7e92cc3 in _gdk_event_emit (event=0x7fffffffd1f0) at ../gtk/gdk/gdkevents.c:73
#42 _gdk_event_emit (event=0x7fffffffd1f0) at ../gtk/gdk/gdkevents.c:67
#43 0x00007ffff7e9a882 in _gdk_window_process_updates_recurse_helper (window=0x55555559d5c0, expose_region=<optimized out>) at ../gtk/gdk/gdkwindow.c:3874
#44 0x00007ffff7e9f1ac in gdk_window_process_updates_internal (window=0x55555559d5c0) at ../gtk/gdk/gdkwindow.c:4020
#45 0x00007ffff7e9f3b1 in gdk_window_process_updates_with_mode (window=<optimized out>, recurse_mode=<optimized out>) at ../gtk/gdk/gdkwindow.c:4215
#46 0x00007ffff727711c in _g_closure_invoke_va
    (param_types=<optimized out>, n_params=<optimized out>, args=0x7fffffffd490, instance=<optimized out>, return_value=<optimized out>, closure=0x55555589b8d0)
    at ../glib/gobject/gclosure.c:895
#47 g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd490)
    at ../glib/gobject/gsignal.c:3456
#48 0x00007ffff7277204 in g_signal_emit (instance=instance@entry=0x5555555dd330, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3606
#49 0x00007ffff7e968b1 in _gdk_frame_clock_emit_paint (frame_clock=0x5555555dd330) at ../gtk/gdk/gdkframeclock.c:657
#50 gdk_frame_clock_paint_idle (data=0x5555555dd330) at ../gtk/gdk/gdkframeclockidle.c:597
#51 0x00007ffff7e836ae in gdk_threads_dispatch (data=0x5555557246a0) at ../gtk/gdk/gdk.c:769
#52 0x00007ffff715c0a2 in g_timeout_dispatch (source=0x555555815d10, callback=<optimized out>, user_data=<optimized out>) at ../glib/glib/gmain.c:5007
#53 0x00007ffff715b87b in g_main_dispatch (context=0x5555555d0e40) at ../glib/glib/gmain.c:3444
#54 g_main_context_dispatch (context=0x5555555d0e40) at ../glib/glib/gmain.c:4162
--Type <RET> for more, q to quit, c to continue without paging--
#55 0x00007ffff71b2279 in g_main_context_iterate.constprop.0 (context=0x5555555d0e40, block=1, dispatch=1, self=<optimized out>) at ../glib/glib/gmain.c:4238
#56 0x00007ffff715addf in g_main_loop_run (loop=0x555555787880) at ../glib/glib/gmain.c:4438
#57 0x00007ffff77d8e9f in gtk_main () at ../gtk/gtk/gtkmain.c:1329
#58 0x0000555555558cee in main (argc=1, argv=0x7fffffffd998) at sm.c:450

relevant lines:

#20 pango_cairo_show_layout (cr=0x55555564f990, layout=0x55555563c9b0) at ../pango/pango/pangocairo-render.c:1139
#21 0x0000555555557cce in redraw (draw=0x5555555dd210, cr=0x55555564f990, data=0x0) at sm.c:161
(...)
#57 0x00007ffff77d8e9f in gtk_main () at ../gtk/gtk/gtkmain.c:1329
#58 0x0000555555558cee in main (argc=1, argv=0x7fffffffd998) at sm.c:450

Both of them are pretty generic calls though :/

luto commented 6 months ago

Update! sm no longer crashes on the letter e, but fails to redraw. It seems unresponsive, but actually works, just doesn't refresh the window to show the current text. Using e as a letter other than the 1st works. Capital E also works.

For each e, the following warnings show up:

(sm:53160): Gtk-WARNING **: 21:32:51.390: drawing failure for widget 'GtkDrawingArea': error occurred in libfreetype
(sm:53160): Gtk-WARNING **: 21:32:51.391: drawing failure for widget 'GtkBox': error occurred in libfreetype
(sm:53160): Gtk-WARNING **: 21:32:51.391: drawing failure for widget 'GtkWindow': error occurred in libfreetype

any hits? 😅

nomeata commented 6 months ago

Maybe freetype crashes due to the large font size? Does it also happen with a smaller window

luto commented 6 months ago

Oh, you actually got it! My screen is 3840x2160 and that is apparently too big for libfreetype or sm or the combination to handle.

luto commented 6 months ago

Just a note on the new title, for repro, at least on my machine, this still only happens with the letter e (and on a large screen).

luto commented 6 months ago

Ha, only happens with the DejaVuSans.ttf: "DejaVu Sans" "Book" font, which is the default on my system. Other fonts like -n arial work fine. I finally got a workaround then.

nomeata commented 6 months ago

Great! I just hope that it’s a bug in one of the libraries and I’m not the one to be blamed :-)