Adding LPD printer freezes gnome-cups-add

Bug #60576 reported by Gustavo Carneiro
2
Affects Status Importance Assigned to Milestone
gnome-cups-manager (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

1. Run gnome-cups-add
2. Select LPD printer type
3. Fill in the hostname and queue fields
4. Press the Next button

At this point the program freezes. Gdb shows this backtrace:

(gdb) thread apply all bt

Thread 7 (Thread 1098918224 (LWP 11537)):
#0 0x00002b430659ead7 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#1 0x00002b4306bed93e in SNMP_socket::call ()
   from /usr/lib64/libgnomecupsui-1.0.so.1
#2 0x0000000041801e70 in ?? ()
#3 0x00002b4306cfea40 in std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> >::_Rep::_S_empty_rep_storage ()
   from /usr/lib64/libgnomecupsui-1.0.so.1
#4 0x0000000041801eb0 in ?? ()
#5 0x00002b4306cfea80 in pending_m () from /usr/lib64/libgnomecupsui-1.0.so.1
#6 0x000000000083f868 in ?? ()
#7 0x000000000083a640 in ?? ()
#8 0x00000000450ab823 in ?? ()
#9 0x0000000000000000 in ?? ()

Thread 6 (Thread 1090525520 (LWP 11536)):
#0 0x00002b430659e8e6 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#1 0x00002b4306bef716 in joiner () from /usr/lib64/libgnomecupsui-1.0.so.1
#2 0x0000000000000000 in ?? ()

---Type <return> to continue, or q <return> to quit---
Thread 5 (Thread 1082132816 (LWP 11535)):
#0 0x00002b4306dc5a22 in __select_nocancel () from /lib/libc.so.6
#1 0x00002b4306bed30a in receiver () from /usr/lib64/libgnomecupsui-1.0.so.1
#2 0x00002b430659de9b in pthread_mutex_unlock () from /lib/libpthread.so.0
#3 0x0000000000000000 in ?? ()

Thread 1 (Thread 47566922710528 (LWP 11492)):
#0 0x00002b430659c6c5 in pthread_join () from /lib/libpthread.so.0
#1 0x00002b4306bef5f9 in SNMP_sessions_done ()
   from /usr/lib64/libgnomecupsui-1.0.so.1
#2 0x0000000041802950 in ?? ()
#3 0x00002b4306a2e4c0 in ?? ()
#4 0x000000000081e740 in ?? ()
#5 0x00002b4306bdf185 in get_snmp_printers ()
   from /usr/lib64/libgnomecupsui-1.0.so.1
#6 0x00002b430323d610 in gnome_ice_init () from /usr/lib64/libgnomeui-2.so.0
#7 0x00002b4306d6f77d in *__GI___libc_malloc () from /lib/libc.so.6
#8 0x00002b43030ebcb2 in _dl_make_stack_executable ()
   from /lib64/ld-linux-x86-64.so.2
#9 0x00002b4306be45b1 in gcups_connection_selector_queue_guess ()
   from /usr/lib64/libgnomecupsui-1.0.so.1
#10 0x00000000005c1290 in ?? ()
#11 0x00002b43030ebcb2 in _dl_make_stack_executable ()
---Type <return> to continue, or q <return> to quit---
   from /lib64/ld-linux-x86-64.so.2
#12 0x00000000004036b3 in ?? ()
#13 0x0000000000000040 in ?? ()
#14 0x00007fffa79cdd30 in ?? ()
#15 0x0000000000541470 in ?? ()
#16 0x0000000000403aa0 in ?? ()
#17 0x00000000005bf040 in ?? ()
#18 0x0000000000403ab8 in ?? ()
#19 0x00000000006ab1f0 in ?? ()
#20 0x00007fffa79cdd30 in ?? ()
#21 0x00000000006ab1f0 in ?? ()
#22 0x00002b430323d66d in gnome_ice_init () from /usr/lib64/libgnomeui-2.so.0
#23 0x00000000ffffffff in ?? ()
#24 0x00000000006ab1f0 in ?? ()
#25 0x00007fffa79cdc00 in ?? ()
#26 0x0000000000000000 in ?? ()

Revision history for this message
Gustavo Carneiro (gjc) wrote :

The backtrace already suggested, but I could not believe it.. It seems gnome-cups-add is being incredibly stupid and sending out SNMP request forever, essentially disregarding the ICMP reports flowing back from the LPR server, as the attached screenshot shows.

And gnome-cups-add is already very lucky that it receives ICMP errors; It could happen that the SNMP packets would be silently discarded by a firewall! Really, gnome-cups-add should not SNMP-probe the print server for more than a couple of seconds.

PS: a friend of mine got this same problem on a Dapper system. I'm on Edgy. I didn't make this analysis on her system, but I suspect the same problem because the symptoms are the same.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

For easy discovering and addition of network printers use the new facilities of CUPS 1.2.

Make sure that the SNMP backend is used (this is an SNMP network auto-scan tool, for sure exits after around 3 or 4 seconds):

sudo ln -s /usr/lib/cups/backend-available/snmp /usr/lib/cups/backend/

(I suggest that this is set by default, on Mandriva it never broke anything for me and also no user complained about it)

Then use the web interface of CUPS

https://localhost:631/

and click on "Administration". After some seconds your not yet configured network printers should be listed and you only need to click "Add this printer" and follow the instructions on the following screens. If asked for log in and password enter your log in and password (or of any privileged user).

Or use the command line:

sudo lpinfo -v

to see the auto-detected URI of your printer and then

sudo lpadmin -p <queue name> -E -v <URI> -P <PPD file>

gnome-cups-manager is not maintained upstream any more, if someone here is still hacking on it, have a look at the source code of the SNMP backend of CUPS 1.2, or let the gnome-cups-manager simply call this backend instead of doing the dirty work by itself.

Perhaps the web interface of CUPS should be listed in the Administration menu of the desktop.

Revision history for this message
Sebastian Rode (sebastian-ro-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. Can you try with latest Ubuntu release? Thanks in advance.

Changed in gnome-cups-manager:
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.