GNOME Bugzilla – Bug 168881
after restarting CUPS IPP printers do not appear again
Last modified: 2008-01-29 13:09:59 UTC
Steps to reproduce: 1. enable browsing in CUPS and set up a remote printer 2. start gnome-cups-manager 3. restart cupsys 4. wait a few seconds, g-c-m crashes with SIGPIPE Stack trace:
+ Trace 56289
Other information: The problem is in libgnomecups/gnome-cups-request.c, request_thread_main(): /* This is a deferred open for the first connection */ if (!request->connection->http) request->connection->http = httpConnectEncrypt (request->connection->server, ippPort(), cupsEncryption()); response = cupsDoRequest (request->connection->http, request->request, request->path); This uses sloppy initialization, so an existing HTTP connection stays open and is reused. After restarting CUPS, the connection is not valid any more, which explains the SIGPIPE. I already tried to do httpClose (request->connection->http); request->connection->http = NULL; after this, to not reuse connections. This helps to survive the crash, but after this the printers don't appear any more in g-c-m (this could very well be an entirely different bug, though). So please either don't reuse connections at all (like I tried with my patch), or intercept SIGPIPE and reconnect when receiving this signal. But since the latter is very Linux/Unix specific, and starting a connection is not _that_ expensive, I would suggest using the first approach. Anyway, do you have any hint how to make g-c-m display new IPP printers after a CUPS restart?
you are seeing a different bug The problem is not the sigpipe, that is not fatal. There was a different bug that has now been fixed in cvs (0.29)
Oh, I just saw that g-c-m only crashes with SIGPIPE when debugging it; sorry for the noise The "different" bug is certainly the NULL pointer in eggiconlist.c (I already fixed that). However, I reopened and renamed this bug because the second part is still an issue: "after restarting cupsys, IPP printers don't appear any more in g-c-m" [..] "do you have any hint how to make g-c-m display new IPP printers after a CUPS restart?" Thanks, Martin
I made an interesting discovery: - I put a printf() in pinter_added_cb(); this is always called correctly after restarting CUPS. - IPP printers indeed appear again after restarting CUPS _if_ there is at least one local printer in addition. - IPP printers do not appear again if there are no local printers.
Created attachment 38239 [details] [review] proposed fix This patch is minimally intrusive (add one line) and safe; however, it is more like a workaround rather than a proper fix for the actual bug. With this patch and the recent egg icon list fix in CVS, g-c-m now works beautifully with cupsys restarts. As an explanation why I make such a fuss about it: in Ubuntu we add a g-c-m interface for enabling/disabling CUPS browsing support, and to make this change effective we need to restart CUPS. Then network printers should immediately be visible in g-c-m.
I'm not seeing any problems in cvs without this patch. When I restart the printer disappears and reappears. There was a problem in gnome-cups-manager where it would only call update if the cupsd restarted, but that was fixed. Are you sure you still need this patch with cvs head ?
Confirmed, CVS HEAD works fine.
Moving all gnome-cups-manager bugs to new product. Filter on Kjartan's spring cleaning.