After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725440 - plugin blocks all operation when there is a network problem
plugin blocks all operation when there is a network problem
Status: RESOLVED OBSOLETE
Product: gnome-settings-daemon
Classification: Core
Component: printers
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2014-03-01 12:59 UTC by misc
Modified: 2019-03-20 11:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do not block because of authentication (1.71 KB, patch)
2015-04-15 13:32 UTC, Marek Kašík
committed Details | Review

Description misc 2014-03-01 12:59:40 UTC
So here is how the problem can be fiarly reliably reproduced:

I use my laptop at work and at home, with suspend to memory, I often end with gnome-setting-daemon being block. Among various symptoms, keyboard shortcut do not work ( like increase the luminosity, launch a specific software ).

Upon investigation, i found that g-s-d is blocked on this :

  • #0 poll
    at ../sysdeps/unix/syscall-template.S line 81
  • #1 poll
    at /usr/include/bits/poll2.h line 46
  • #2 httpAddrConnect2
    at http-addrlist.c line 243
  • #3 httpReconnect2
    at http.c line 2726
  • #4 cupsSendRequest
    at request.c line 732
  • #5 cupsDoIORequest
    at request.c line 235
  • #6 cupsDoRequest
    at request.c line 328
  • #7 process_new_notifications
    at gsd-print-notifications-manager.c line 888
  • #8 g_timeout_dispatch
    at gmain.c line 4451
  • #9 g_main_dispatch
    at gmain.c line 3066
  • #10 g_main_context_dispatch
    at gmain.c line 3642
  • #11 g_main_context_iterate
    at gmain.c line 3713
  • #12 g_main_loop_run
    at gmain.c line 3907
  • #13 gtk_main
    at gtkmain.c line 1158
  • #14 main
    at main.c line 471

My analysis is that cupsDoRequest is synchronous, and if it cannot connect to the cups server ( cups.emea.example.org, in my case ), it wait around 30 seconds, but block the rest of the process.

To test, that's quite easy, add a cups server

$ cat /etc/cups/client.conf 
Servername cups.emea.example.org

Then block the access to the server, either by having the server blocking, or just nullrouting the address ( or block on the firewall).

In my case, this happen when i am connected to the entreprise LAN, and then suspend the laptop and unsuspend it at home. The connectivity to the cups server is no longer working until I start the corporate VPN.
Comment 1 Christophe Fergeau 2015-04-09 08:27:57 UTC
Interestingly, I've started seeing something similar after upgrading to GNOME 3.16/fedora 22. I don't think I hit this issue in the past. Backtrace is different, but symptoms are the same, and imo backtrace is similar enough (cups blocked during a read() call):

Thread 1 (Thread 0x7f2124473980 (LWP 2561))

  • #0 read
    at ../sysdeps/unix/syscall-template.S line 81
  • #1 _cupsGetPassword
    at /usr/include/bits/unistd.h line 44
  • #2 _cupsGetPassword
    at usersys.c line 730
  • #3 cupsDoAuthentication
    at auth.c line 202
  • #4 cupsGetResponse
    at request.c line 443
  • #5 cupsDoIORequest
    at request.c line 250
  • #6 cupsDoRequest
    at request.c line 312
  • #7 process_new_notifications
    at gsd-print-notifications-manager.c line 889
  • #8 g_timeout_dispatch
    at gmain.c line 4545
  • #9 g_main_context_dispatch
    at gmain.c line 3122
  • #10 g_main_context_dispatch
    at gmain.c line 3737
  • #11 g_main_context_iterate
    at gmain.c line 3808
  • #12 g_main_loop_run
    at gmain.c line 4002
  • #13 gtk_main
    at gtkmain.c line 1219
  • #14 main
    at main.c line 427

Comment 2 Christophe Fergeau 2015-04-09 11:27:37 UTC
Actually, must be a different bug as I just hit it after a fresh reboot without any network changes.
Comment 3 Marek Kašík 2015-04-15 13:32:56 UTC
Created attachment 301630 [details] [review]
Do not block because of authentication

(In reply to Christophe Fergeau from comment #2)
> Actually, must be a different bug as I just hit it after a fresh reboot
> without any network changes.

Hi,

this is really a different bug. The problem is that the CUPS server you have in your /etc/cups/client.conf requests authentication when getting new notifications. Unfortunately, I don't have a correct solution right now but I've prepared a quick patch which at least prevents print-notifications plugin from blocking whole g-s-d because of the sync password prompt by setting a password callback which always returns NULL (it cancels the authentication).

The password prompt is shown on the background only so there is no change for users except that g-s-d is not blocked with the patch.

The original bug should be already fixed, I'll check that.

Regards

Marek
Comment 4 Bastien Nocera 2015-04-15 13:59:54 UTC
Review of attachment 301630 [details] [review]:

::: plugins/print-notifications/gsd-print-notifications-manager.c
@@ +1308,3 @@
         manager->priv->printing_printers = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 
+        cupsSetPasswordCB2 (password_cb, NULL);

Can you add a little comment above that that it is a temporary measure?
Comment 5 Marek Kašík 2015-04-15 14:22:08 UTC
Comment on attachment 301630 [details] [review]
Do not block because of authentication

(In reply to Bastien Nocera from comment #4)
> Review of attachment 301630 [details] [review] [review]:
> 
> ::: plugins/print-notifications/gsd-print-notifications-manager.c
> @@ +1308,3 @@
>          manager->priv->printing_printers = g_hash_table_new_full
> (g_str_hash, g_str_equal, g_free, NULL);
>  
> +        cupsSetPasswordCB2 (password_cb, NULL);
> 
> Can you add a little comment above that that it is a temporary measure?

Thank you for the review. I've added the comment there and pushed it to master and gnome-3-14 branches.
Comment 6 Marek Kašík 2015-04-16 16:07:22 UTC
(In reply to Marek Kašík from comment #3)
> The original bug should be already fixed, I'll check that.

It is not fixed, but I don't want to check connection to the remote server every time we want to call a CUPS command. Maybe another thread would be a solution as Christophe suggested to me.
Comment 7 Christophe Fergeau 2017-03-20 10:32:36 UTC
Fwiw, just had this issue with gnome-settings-daemon 3.22.1, similar backtrace to the one in the initial comment (from main() to  cupsSendRequest()). This happened when I pulled the laptop off the docking station (which cut down the wired ethernet connection).
Comment 8 GNOME Infrastructure Team 2019-03-20 11:16:01 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/243.