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

Often hangs when called from gnome-software #10

Closed
iainlane opened this issue Jul 24, 2017 · 5 comments
Closed

Often hangs when called from gnome-software #10

iainlane opened this issue Jul 24, 2017 · 5 comments

Comments

@iainlane
Copy link
Contributor

[ Sorry, I don't have a backtrace to hand ]

gnome-software recently introduced support for cancelling long-running plugin operations. That is, when it calls a vfunc on a plugin, if that takes more than x seconds, the request is cancelled. This was added mainly because the snap plugin was behaving badly and hanging, meaning that entire operations were not returning.

Now that's fixed (and this work is soon to be uploaded to Artful), I thought I'd file this bug to track investigations as to /why/ the operations are hanging in the first place.

@iainlane
Copy link
Contributor Author

I think this article about using GMainContext from libraries is relevant. I've implemented some of the recommendations contained in it, and got back to a state where the testsuite is passing. Haven't yet tried it in GNOME Software, but will do tomorrow and then I'll let this issue know what my findings are.

@iainlane
Copy link
Contributor Author

I had this on my desktop!

Thread 7 (Thread 0x7fffcd84e700 (LWP 8978)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff748b75f in g_cond_wait (cond=cond@entry=0x55555587e018, mutex=mutex@entry=0x55555587e010) at ../../../../glib/gthread-posix.c:1395
#2  0x00007ffff7444a30 in g_main_context_wait (context=0x55555587e010, cond=0x55555587e018, mutex=0x55555587e010) at ../../../../glib/gmain.c:3331
#3  0x00007ffff7445ab3 in g_main_loop_run (loop=0x7fffc40525e0) at ../../../../glib/gmain.c:4054
#4  0x00007fffd79d858c in snapd_client_list_one_sync (client=client@entry=0x7fffd80105c0, name=name@entry=0x7fffc405abe0 "anbox-installer", cancellable=cancellable@entry=0x7fffd800c870, error=error@entry=0x0)
    at snapd-client.c:2809
#5  0x00007fffd7bf66c8 in gs_plugin_refine_app (plugin=0x555555a7be80, app=0x7fffc405c000, flags=2097184, cancellable=0x7fffd800c870, error=0x7fffcd84d938) at ../plugins/snap/gs-plugin-snap.c:428
#6  0x00005555555c36f9 in gs_plugin_loader_call_vfunc (helper=helper@entry=0x7fffb807ae00, plugin=plugin@entry=0x555555a7be80, app=app@entry=0x7fffc405c000, list=0x5555586a1740, list@entry=0x0, 
    cancellable=cancellable@entry=0x7fffd800c870, error=error@entry=0x7fffcd84dae8) at ../lib/gs-plugin-loader.c:577
#7  0x00005555555c40e9 in gs_plugin_loader_run_refine_internal (helper=helper@entry=0x7fffb807ae00, list=list@entry=0x5555586a1740, cancellable=cancellable@entry=0x7fffd800c870, 
    error=error@entry=0x7fffcd84dae8) at ../lib/gs-plugin-loader.c:764
#8  0x00005555555c46c0 in gs_plugin_loader_run_refine (helper=helper@entry=0x5555586a1780, list=list@entry=0x5555586a1740, cancellable=cancellable@entry=0x7fffd800c870, error=error@entry=0x7fffcd84dae8)
    at ../lib/gs-plugin-loader.c:898
#9  0x00005555555c59a5 in gs_plugin_loader_process_thread_cb (task=0x7fffc0005ae0, object=<optimised out>, task_data=0x5555586a1780, cancellable=0x7fffd800c870) at ../lib/gs-plugin-loader.c:3105
#10 0x00007ffff70eab2d in g_task_thread_pool_thread (thread_data=0x7fffc0005ae0, pool_data=<optimised out>) at ../../../../gio/gtask.c:1328
#11 0x00007ffff746e07e in g_thread_pool_thread_proxy (data=<optimised out>) at ../../../../glib/gthreadpool.c:307
#12 0x00007ffff746d685 in g_thread_proxy (data=0x55555852c2d0) at ../../../../glib/gthread.c:784
#13 0x00007ffff499b6da in start_thread (arg=0x7fffcd84e700) at pthread_create.c:456
#14 0x00007ffff46d517f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105

@robert-ancell
Copy link
Contributor

Is that backtrace from after you patched it or before?

Yes, the GMainContext stuff is a lot harder than I initially thought. I was discussing it with Allison but that only got half way...

@iainlane
Copy link
Contributor Author

iainlane commented Jul 24, 2017 via email

@robert-ancell
Copy link
Contributor

I'm going to close this assumed fixed with the recent threading changes. Please re-open if not...

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

2 participants