Subject: bug#62291: 30.0.50; PGTK copy + paste to other app problem

From: Andrew Tropin <[email-masked]>
Date: Tue, 21 Mar 2023 13:10:12 +0400

On 2023-03-20 20:36, Po Lu wrote:

> Andrew Tropin <[email-masked]> writes:
>
>> #0  0x00007ffff71a9424 in signal_emit_unlocked_R.isra.0 () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
>> #1  0x00007ffff71af21b in g_signal_emit_valist () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
>> #2  0x00007ffff71af722 in g_signal_emit () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
>> #3  0x00007ffff719b884 in g_object_dispatch_properties_changed () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
>> #4  0x00007ffff719d834 in g_object_notify_by_pspec () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
>> #5  0x00007ffff79afbcd in ?? () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgtk-3.so.0
>> #6  0x00007ffff79de357 in ?? () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgtk-3.so.0
>> #7  0x00007ffff71974af in g_closure_invoke () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
>> #8  0x00007ffff71a89e9 in signal_emit_unlocked_R.isra.0 () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
>> #9  0x00007ffff71aed65 in g_signal_emit_valist () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
>> #10 0x00007ffff71af722 in g_signal_emit () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
>> #11 0x00007ffff798ac04 in ?? () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgtk-3.so.0
>> #12 0x00007ffff784b37a in gtk_main_do_event () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgtk-3.so.0
>> #13 0x00007ffff7ef23c5 in ?? () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgdk-3.so.0
>> #14 0x00007ffff7f4f352 in ?? () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgdk-3.so.0
>> #15 0x00007ffff70a34cb in g_main_context_dispatch () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libglib-2.0.so.0
>> #16 0x000000000064c548 in pgtk_read_socket ()
>> #17 0x0000000000515762 in gobble_input ()
>> #18 0x0000000000515b85 in unblock_input_to ()
>> #19 0x0000000000516a38 in timer_check ()
>> #20 0x0000000000516f75 in readable_events ()
>> #21 0x0000000000517138 in get_input_pending ()
>> #22 0x000000000051beb8 in detect_input_pending_run_timers ()
>> #23 0x00000000005f40c8 in wait_reading_process_output ()
>> #24 0x0000000000437bd0 in sit_for ()
>> #25 0x000000000051ea0f in read_char ()
>> #26 0x000000000051f2ed in read_key_sequence ()
>> #27 0x0000000000520f12 in command_loop_1 ()
>> #28 0x0000000000596757 in internal_condition_case ()
>> #29 0x000000000050d13a in command_loop_2 ()
>> #30 0x00000000005966b1 in internal_catch ()
>> #31 0x000000000050d0df in command_loop ()
>> #32 0x0000000000513f43 in recursive_edit_1 ()
>> #33 0x00000000005142ba in Frecursive_edit ()
>> #34 0x000000000042d022 in main ()
>
> Thanks.  What this says is that GDK has emitted an event, which is being
> dispatched to what it thinks is a widget, but either the widget's signal
> handler or the widget itself is invalid, causing GObject to crash during
> signal dispatch.
>
> Would you please install debuginfo for libgdk-3.so.0, libgtk-3.so.0 and
> libgobject-2.0.so.0 (I'm not sure how to this in the GuixSD) and try to
> figure out what event is causing the crash?
>
> I suggest going up to frame #12 and typing:
>
>   (gdb) p *event
>
> after the debuginfo is installed and loaded by GDB.

Sorry for the long response, I was figuring out some GDB settings :)

For the record and maybe future readers, my ~/.gdbinit:
--8<---------------cut here---------------start------------->8---
# Tell GDB where to look for separate debugging files.
guile
(use-modules (gdb))
(execute (string-append "set debug-file-directory "
                        (string-join
                          (filter file-exists?
                                  (append
                                    (if (getenv "GDB_DEBUG_FILE_DIRECTORY")
                                      (list (getenv "GDB_DEBUG_FILE_DIRECTORY"))
                                      '())
                                    (list "~/.guix-home/profile/lib/debug"
                                          "~/.guix-profile/lib/debug"
                                          "/run/current-system/profile/lib/debug")))
                          ":")))
end

# Authorize extensions found in the store, such as the
# pretty-printers of libstdc++.
set auto-load safe-path /gnu/store/*/lib
set history filename ~/.cache/gdb_history
set history save on
--8<---------------cut here---------------end--------------->8---

I run gdb the following way:

guix shell gdb glib:debug gtk+:debug emacs-next-pgtk \
--with-debug-info=emacs-next-pgtk -- \
gdb --args sh -c 'exec emacs -Q'

The result I got:
--8<---------------cut here---------------start------------->8---
#0  0x00007ffff71a9424 in signal_emit_unlocked_R.isra.0 () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
#1  0x00007ffff71af21b in g_signal_emit_valist () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
#2  0x00007ffff71af722 in g_signal_emit () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
#3  0x00007ffff719b884 in g_object_dispatch_properties_changed () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
#4  0x00007ffff719d834 in g_object_notify_by_pspec () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
#5  0x00007ffff79afbcd in ?? () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgtk-3.so.0
#6  0x00007ffff79de357 in ?? () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgtk-3.so.0
#7  0x00007ffff71974af in g_closure_invoke () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
#8  0x00007ffff71a89e9 in signal_emit_unlocked_R.isra.0 () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
#9  0x00007ffff71aed65 in g_signal_emit_valist () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
#10 0x00007ffff71af722 in g_signal_emit () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libgobject-2.0.so.0
#11 0x00007ffff798ac04 in ?? () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgtk-3.so.0
#12 0x00007ffff784b37a in gtk_main_do_event () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgtk-3.so.0
#13 0x00007ffff7ef23c5 in ?? () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgdk-3.so.0
#14 0x00007ffff7f4f352 in ?? () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgdk-3.so.0
#15 0x00007ffff70a34cb in g_main_context_dispatch () from /gnu/store/ginkhx2irsi4qwkpnnwg4r30h7jwhi62-glib-2.70.2/lib/libglib-2.0.so.0
#16 0x000000000064c548 in pgtk_read_socket (terminal=<optimized out>, hold_quit=0x7fffffffba00) at pgtkterm.c:3840
#17 pgtk_read_socket (terminal=<optimized out>, hold_quit=0x7fffffffba00) at pgtkterm.c:3819
#18 0x0000000000515762 in gobble_input () at keyboard.c:7416
#19 0x0000000000515b85 in handle_async_input () at keyboard.c:7647
#20 process_pending_signals () at keyboard.c:7661
#21 unblock_input_to (level=0) at keyboard.c:7676
#22 unblock_input_to (level=<optimized out>) at keyboard.c:7670
#23 0x0000000000516a38 in unblock_input () at keyboard.c:7695
#24 timer_check () at keyboard.c:4741
#25 0x0000000000516f75 in readable_events (flags=flags@entry=1) at keyboard.c:3523
#26 0x0000000000517138 in get_input_pending (flags=flags@entry=1) at keyboard.c:7366
#27 0x000000000051beb8 in detect_input_pending_run_timers (do_display=do_display@entry=true) at keyboard.c:10896
#28 0x00000000005f40c8 in wait_reading_process_output (time_limit=time_limit@entry=30, nsecs=nsecs@entry=0, read_kbd=read_kbd@entry=-1, do_display=do_display@entry=true, 
    wait_for_cell=wait_for_cell@entry=0x0, wait_proc=wait_proc@entry=0x0, just_wait_proc=<optimized out>) at process.c:5779
#29 0x0000000000437bd0 in sit_for (timeout=timeout@entry=0x7a, reading=reading@entry=true, display_option=display_option@entry=1) at dispnew.c:6256
#30 0x000000000051ea0f in read_char (commandflag=1, map=0xdecb23, prev_event=0x0, used_mouse_menu=0x7fffffffc55b, end_time=0x0) at lisp.h:759
#31 0x000000000051f2ed in read_key_sequence (keybuf=<optimized out>, prompt=0x0, dont_downcase_last=<optimized out>, can_return_switch_frame=true, fix_current_buffer=true, 
    prevent_redisplay=<optimized out>) at keyboard.c:10073
#32 0x0000000000520f12 in command_loop_1 () at lisp.h:1164
--Type <RET> for more, q to quit, c to continue without paging--
#33 0x0000000000596757 in internal_condition_case (bfun=bfun@entry=0x520d40 <command_loop_1>, handlers=handlers@entry=0x90, hfun=hfun@entry=0x514390 <cmd_error>) at eval.c:1474
#34 0x000000000050d13a in command_loop_2 (handlers=handlers@entry=0x90) at keyboard.c:1124
#35 0x00000000005966b1 in internal_catch (tag=tag@entry=0xfea0, func=func@entry=0x50d120 <command_loop_2>, arg=arg@entry=0x90) at eval.c:1197
#36 0x000000000050d0df in command_loop () at lisp.h:1164
#37 0x0000000000513f43 in recursive_edit_1 () at keyboard.c:711
#38 0x00000000005142ba in Frecursive_edit () at keyboard.c:794
#39 0x000000000042d022 in main (argc=<optimized out>, argv=<optimized out>) at emacs.c:2529
(gdb) frame 12
#12 0x00007ffff784b37a in gtk_main_do_event () from /gnu/store/1y2rd23xx129v1y0qglijws0s208aj8p-gtk+-3.24.30/lib/libgtk-3.so.0
(gdb) p *event
No symbol "event" in current context.
(gdb) p *event<TAB>
event_arm_timer                                        event_head                                             event_queue_insert_if_intersect_below_current_y[part]
event_callback                                         event_inotify_data_drop                                event_queue_t
event_check                                            event_insert_if_intersect_below_current_y              event_source_type_table
event_dispatch                                         event_kind                                             event_to_kboard
event_free[part]                                       event_listeners                                        event_unmask_signal_data
event_free_inode_data                                  event_log_delays                                       eventfd
event_free_inotify_data                                event_make_inode_data                                  eventfd@got[plt]
event_free_signal_data                                 event_make_inotify_data                                eventfd@plt
event_funcs                                            event_make_signal_data                                 eventfd_read
event_gc_inode_data                                    event_next_pending                                     eventfd_write
event_gc_signal_data                                   event_prepare                                          
event_get_clock_data                                   event_q 
--8<---------------cut here---------------end--------------->8---

It complains `No symbol "event" in current context.`, am I did something
wrong?

-- 
Best regards,
Andrew Tropin