Gtk4 DropTargetAsync dumping Core on trying to read drop

,

On Linux Fedora 35 using Gtk4.

Code-

this.gridDropController.connect('drop', (actor, drop, x, y) => {
        drop.read_async(['x-special/gnome-icon-list'], GLib.PRIORITY_DEFAULT, null, (dropactor, task) => {
            log (dropactor);
            log (task);
            let success = dropactor.read_finish(task);
            log(success[0]);
            log(success[1]);
            drop.finish(Gdk.DragAction.COPY);
        });
    });

Gjs-Message: 09:14:52.683: JS LOG: [object instance wrapper GType:GdkWaylandDrop jsobj@0x33c4ad3693d0 native@0x7f7d44104090]
Gjs-Message: 09:14:52.683: JS LOG: [object instance wrapper GIName:Gio.Task jsobj@0x33c4ad369460 native@0x7f7d3c005250]
munmap_chunk(): invalid pointer
Aborted (core dumped)

Everything appears to be correct in the code…
I can read the Gdk4 clipboard contents in a similar fashion with the similar code without problems with the Gio.AsyncTask…

Any suggestions?

Would you be able to post a standalone example code? It’s hard to figure out what is going on here if we can’t run the example.

Thank you for helping out.

I will try and write a small seperate program to try and show what
happens.

I am currently porting Desktop Icons NG extension to Gtk4, most of it
is working fine. I would like to use the async call as I can then query
any mime type, currently I am querying for a Gstring. The relevant code
is here-
Draft: Gtk4 Port: Intial Port (!265) · Merge requests · Sergio Costas / Desktop Icons NG · GitLab.

It happens every time I try and move a file from Nautilus and drop it
on the container, the dropcontrollerAsncy is attached to the container.
I get the munmap error. In fact it has crashed Nautilus as well.

Since I was developing on Fedora Virtual Machine in Gnome Boxes, there
is a stack trace that was automatically created for the nautilus crash
and is linked here-
https://retrace.fedoraproject.org/faf/problems/bthash/?bth=827625d1d76e58893f4890c855686c566fe925b5

1 Like
                                                           #0  0x0000564d6ca3d15f nautilus_file_operations_move (nautilus + 0x7415f)
                                                           #1  0x00007f0fc808350f g_task_thread_pool_thread (libgio-2.0.so.0 + 0xb150f)
                                                           #2  0x00007f0fc8d36114 g_thread_pool_thread_proxy.lto_priv.0 (libglib-2.0.so.0 + 0x82114)
                                                           #3  0x00007f0fc8d33842 g_thread_proxy (libglib-2.0.so.0 + 0x7f842)
                                                           #4  0x00007f0fc7b01a87 start_thread (libc.so.6 + 0x8da87)
                                                           #5  0x00007f0fc7b86640 __clone3 (libc.so.6 + 0x112640)
                                                           
                                                           Stack trace of thread 127462:
                                                           #0  0x00007f0fc7b7973f __poll (libc.so.6 + 0x10573f)
                                                           #1  0x00007f0fc8d5e19c g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xaa19c)
                                                           #2  0x00007f0fc8d06933 g_main_context_iteration (libglib-2.0.so.0 + 0x52933)
                                                           #3  0x00007f0fc8d06981 glib_worker_main (libglib-2.0.so.0 + 0x52981)
                                                           #4  0x00007f0fc8d33842 g_thread_proxy (libglib-2.0.so.0 + 0x7f842)
                                                           #5  0x00007f0fc7b01a87 start_thread (libc.so.6 + 0x8da87)
                                                           #6  0x00007f0fc7b86640 __clone3 (libc.so.6 + 0x112640)
                                                           
                                                           #5  0x00007f0fc7b86640 __clone3 (libc.so.6 + 0x112640)
                                                           
                                                           Stack trace of thread 127462:
                                                           #0  0x00007f0fc7b7973f __poll (libc.so.6 + 0x10573f)
                                                           #1  0x00007f0fc8d5e19c g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xaa19c)
                                                           #2  0x00007f0fc8d06933 g_main_context_iteration (libglib-2.0.so.0 + 0x52933)
                                                           #3  0x00007f0fc8d06981 glib_worker_main (libglib-2.0.so.0 + 0x52981)
                                                           #3  0x00007f0fc8d06981 glib_worker_main (libglib-2.0.so.0 + 0x52981)
                                                           #4  0x00007f0fc8d33842 g_thread_proxy (libglib-2.0.so.0 + 0x7f842)
                                                           #5  0x00007f0fc7b01a87 start_thread (libc.so.6 + 0x8da87)
                                                           #6  0x00007f0fc7b86640 __clone3 (libc.so.6 + 0x112640)
                                                           
                                                           Stack trace of thread 127467:
                                                           #0  0x00007f0fc7b7ee6d syscall (libc.so.6 + 0x10ae6d)
                                                           #1  0x00007f0fc8d59343 g_cond_wait (libglib-2.0.so.0 + 0xa5343)
                                                           #2  0x00007f0fc8cd908b g_async_queue_pop_intern_unlocked (libglib-2.0.so.0 + 0x2508b)
                                                           #3  0x00007f0fc8d360e7 g_thread_pool_thread_proxy.lto_priv.0 (libglib-2.0.so.0 + 0x820e7)
                                                           #4  0x00007f0fc8d33842 g_thread_proxy (libglib-2.0.so.0 + 0x7f842)
                                                           #5  0x00007f0fc7b01a87 start_thread (libc.so.6 + 0x8da87)
                                                           #6  0x00007f0fc7b86640 __clone3 (libc.so.6 + 0x112640)
                                                           
                                                           Stack trace of thread 127469:
                                                           #0  0x00007f0fc7b7973f __poll (libc.so.6 + 0x10573f)
                                                           #1  0x00007f0fc8d5e19c g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xaa19c)
                                                           #2  0x00007f0fc8d06933 g_main_context_iteration (libglib-2.0.so.0 + 0x52933)
                                                           #3  0x00007f0fc21633ed dconf_gdbus_worker_thread (libdconfsettings.so + 0x73ed)
                                                           #4  0x00007f0fc8d33842 g_thread_proxy (libglib-2.0.so.0 + 0x7f842)
                                                           #5  0x00007f0fc7b01a87 start_thread (libc.so.6 + 0x8da87)
                                                           #6  0x00007f0fc7b86640 __clone3 (libc.so.6 + 0x112640)
                                                           
                                                           Stack trace of thread 127464:
                                                           #0  0x00007f0fc7b7973f __poll (libc.so.6 + 0x10573f)
                                                           #1  0x00007f0fc8d5e19c g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xaa19c)
                                                           #2  0x00007f0fc8d08853 g_main_loop_run (libglib-2.0.so.0 + 0x54853)
                                                           #3  0x00007f0fc80e5c0a gdbus_shared_thread_func.lto_priv.0 (libgio-2.0.so.0 + 0x113c0a)
                                                           #4  0x00007f0fc8d33842 g_thread_proxy (libglib-2.0.so.0 + 0x7f842)
                                                           #5  0x00007f0fc7b01a87 start_thread (libc.so.6 + 0x8da87)
                                                           #6  0x00007f0fc7b86640 __clone3 (libc.so.6 + 0x112640)
                                                           
                                                           Stack trace of thread 127442:
                                                           #0  0x00007f0fc7b7973f __poll (libc.so.6 + 0x10573f)
                                                           #1  0x00007f0fc8d5e19c g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xaa19c)
                                                           #2  0x00007f0fc8d06933 g_main_context_iteration (libglib-2.0.so.0 + 0x52933)
                                                           #3  0x00007f0fc80b13d5 g_application_run (libgio-2.0.so.0 + 0xdf3d5)
                                                           #4  0x0000564d6ca092dc main (nautilus + 0x402dc)
                                                           #5  0x00007f0fc7aa1560 __libc_start_call_main (libc.so.6 + 0x2d560)
                                                           #6  0x00007f0fc7aa160c __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x2d60c)
                                                           #7  0x0000564d6ca09365 _start (nautilus + 0x40365)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.