CUPS daemon does not survive "killall -HUP cupsd" #865

Closed
michaelrsweet opened this Issue Aug 23, 2004 · 13 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Aug 23, 2004

Version: 1.1.21
CUPS.org User: till.kamppeter

If I do "killall -HUP cupsd" CUPS dies.

To make it easier to find the cause of the problem I have attached the output file of

strace cupsd -f > ~/cups-1.1.21rc2-killall-HUP-strace.txt 2>&1

While I have run this command I have done

killall -HUP cupsd

in another terminal window. The output shows that CUPS has died with a segmentation fault.

My system is the current Cooker of Mandrakelinux (somewhere between 10.1beta1 and 10.1beta2. Output of "uname -a":

Linux majax.mandrakesoft.com 2.6.8.1-2mdk #1 Wed Aug 18 18:54:04 CEST 2004 i686 Pentium III (Coppermine) unknown GNU/Linux

So it is a 2.6.8 final kernel.

There are two USB and a parallel printer connected and some printers broadcasted in from the network.

Collaborator

michaelrsweet commented Aug 23, 2004

CUPS.org User: till.kamppeter

On another run of CUPS 1.1.21rc2 (normally, as a daemon, without strace), also with "killall -HUP cupsd" applied, I have used the "debug2" log level and obtained the second attached file as /var/log/cups/error_log. The end of the file is the point where cupsd died.

Collaborator

michaelrsweet commented Aug 27, 2004

CUPS.org User: mike

Can you run cupsd in gdb ("run -f") and tell me where it is crashing?

Collaborator

michaelrsweet commented Sep 1, 2004

CUPS.org User: till.kamppeter

For compiling I have removed all Mandrakelinux optimization flags and only put "-ggdb" (I tried also "-g" but with the same result. I also have taken care that the binary files do not get stripped and they are really bigger than the stripped files. But it seems that gdb does not recognize the debugging symbols. See the session below. I also used the "--enable-debug" option when running configure.

It seems that the HUP signal leeds CUPS into an infinte recursion which stops with a segfault when a certain stack or so is full.


[root@majax root]# gdb /usr/sbin/cupsd
GNU gdb 6.1.1-2mdk (Mandrake Linux)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-mandrake-linux-gnu"...(no debugging symbols found)...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run -f
Starting program: /usr/sbin/cupsd -f
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...Detaching after fork from child process 11436.
Detaching after fork from child process 11437.
Detaching after fork from child process 11438.
Detaching after fork from child process 11439.
Detaching after fork from child process 11440.
/usr/lib/cups/backend/nprint: line 103: pqlist: command not found
Detaching after fork from child process 11444.
/usr/lib/cups/backend/pap: line 19: /usr/bin/nbplkup: No such file or directory
Detaching after fork from child process 11447.
Detaching after fork from child process 11448.
Detaching after fork from child process 11451.
Detaching after fork from child process 11456.
unable to connect to socket: Connection refused
Detaching after fork from child process 11457.
Detaching after fork from child process 11458.
Detaching after fork from child process 11459.
Detaching after fork from child process 11460.
Detaching after fork from child process 11463.
Detaching after fork from child process 11464.
Detaching after fork from child process 11465.
Detaching after fork from child process 11470.

Program received signal SIGHUP, Hangup.
0xffffe410 in ?? ()
(gdb) continue
Continuing.
Detaching after fork from child process 11477.
Detaching after fork from child process 11478.
Detaching after fork from child process 11479.
Detaching after fork from child process 11480.
Detaching after fork from child process 11481.
/usr/lib/cups/backend/nprint: line 103: pqlist: command not found
Detaching after fork from child process 11485.
/usr/lib/cups/backend/pap: line 19: /usr/bin/nbplkup: No such file or directory
Detaching after fork from child process 11488.
Detaching after fork from child process 11489.
Detaching after fork from child process 11492.
Detaching after fork from child process 11497.
unable to connect to socket: Connection refused
Detaching after fork from child process 11498.
Detaching after fork from child process 11499.
Detaching after fork from child process 11500.
Detaching after fork from child process 11501.
Detaching after fork from child process 11504.
Detaching after fork from child process 11505.
Detaching after fork from child process 11506.
Detaching after fork from child process 11511.

Program received signal SIGSEGV, Segmentation fault.
0x0805ba3c in ?? ()
(gdb) backtrace
#0 0x0805ba3c in ?? ()
#1 0x402fe7f8 in ?? () from /lib/tls/libc.so.6
#2 0xbffff944 in ?? ()
#3 0xbffff8d0 in ?? ()
#4 0x00000001 in ?? ()
#5 0x41352e14 in ?? ()
#6 0x41352f22 in ?? ()
#7 0x4025df92 in time () from /lib/tls/libc.so.6
#8 0x32582079 in ?? ()
#9 0x00000001 in ?? ()
#10 0x402fe7f8 in ?? () from /lib/tls/libc.so.6
#11 0xbffff8b8 in ?? ()
#12 0x0805ebe1 in ?? ()
#13 0x00000000 in ?? ()
#14 0x00000000 in ?? ()
#15 0x00000000 in ?? ()
#16 0x00000000 in ?? ()
#17 0x0000041f in ?? ()
#18 0x00000066 in ?? ()
#19 0x00000000 in ?? ()
#20 0x00000000 in ?? ()
#21 0x00000000 in ?? ()
#22 0x00000000 in ?? ()
#23 0x00000000 in ?? ()
---Type to continue, or q to quit---
#24 0x00000000 in ?? ()
#25 0x00000000 in ?? ()
#26 0x00000000 in ?? ()
#27 0x00000000 in ?? ()
#28 0x00000000 in ?? ()
#29 0x00000000 in ?? ()
#30 0x00000000 in ?? ()
#31 0x00000000 in ?? ()
#32 0x00000000 in ?? ()
#33 0x00000000 in ?? ()
#34 0x00000000 in ?? ()
#35 0x00000000 in ?? ()
#36 0x00000000 in ?? ()
#37 0x00000000 in ?? ()
#38 0x00000000 in ?? ()
#39 0x00000000 in ?? ()
#40 0x00000000 in ?? ()
[...]
#3414 0x00000000 in ?? ()
#3415 0x00000000 in ?? ()
#3416 0x00000000 in ?? ()
#3417 0x00000000 in ?? ()
#3418 0x00000000 in ?? ()
#3419 0x00000000 in ?? ()
#3420 0x00000000 in ?? ()
#3421 0x00000000 in ?? ()
#3422 0x00000000 in ?? ()
#3423 0x00000000 in ?? ()
#3424 0x00000000 in ?? ()

#3425 0x00000000 in ?? ()
#3426 0x00000000 in ?? ()
#3427 0x00000000 in ?? ()
#3428 0x00000000 in ?? ()
#3429 0x0000003d in ?? ()
#3430 0x0000003d in ?? ()
#3431 0xbfffe924 in ?? ()
---Type to continue, or q to quit---

#3432 0x4000ba89 in _dl_name_match_p (name=0xbffff8d0 "�@", map=0xbffff944)
at dl-misc.c:319
Previous frame inner to this frame (corrupt stack?)

(gdb)

Collaborator

michaelrsweet commented Sep 1, 2004

CUPS.org User: till.kamppeter

Another thing: I am using gcc 3.4.1.

Collaborator

michaelrsweet commented Sep 6, 2004

CUPS.org User: mike

Without function names, the backtrace doesn't do us any good. I haven't been able to duplicate this problem on our systems.

Collaborator

michaelrsweet commented Sep 14, 2004

CUPS.org User: mike

Please let me know if the problem persists in 1.1.21.

Collaborator

michaelrsweet commented Sep 14, 2004

CUPS.org User: till.kamppeter

I have tried 1.1.21 final and the problem is still there.

Till

Collaborator

michaelrsweet commented Sep 14, 2004

CUPS.org User: mike

OK, Till, then we will absolutely need you to compile CUPS with full debugging. I highly recommend NOT creating an RPM and testing from that, but build from source manually and run the uninstalled scheduler/cupsd executable.

Without a backtrace with symbols, it is impossible to determine where or why it is crashing, and I was unable to duplicate the problems on our Red Hat installs with GCC 3.3.x.

Collaborator

michaelrsweet commented Sep 14, 2004

CUPS.org User: till.kamppeter

Now I succeeded to get an unstripped cupsd. The problem was that "make install" always strips all files (using "install -s"), even if one has used "--enable-debug=yes" on the "./configure" command line and "STRIP=:" on all "make" command lines. I suggest to make "make" and "make install" only stripping the executables if "./configure" is called without "--enable-debug", as with "--enable-debug" the user wants to debug and one debugging possibility is running the executables with a debugger.

I finally edited the Makedefs file so that "install" is used without "-s".

Here is the gdb result:


[root@majax root]# gdb --args /usr/sbin/cupsd -f
GNU gdb 6.0-2mdk (Mandrake Linux)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-mandrake-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run
Starting program: /usr/sbin/cupsd -f
Detaching after fork from child process 16003.
Detaching after fork from child process 16004.
Detaching after fork from child process 16005.
Detaching after fork from child process 16006.
Detaching after fork from child process 16007.
/usr/lib/cups/backend/nprint: line 103: pqlist: command not found
Detaching after fork from child process 16011.
/usr/lib/cups/backend/pap: line 19: /usr/bin/nbplkup: No such file or directory
Detaching after fork from child process 16014.
Detaching after fork from child process 16015.
Detaching after fork from child process 16018.
Detaching after fork from child process 16023.
Detaching after fork from child process 16024.
Detaching after fork from child process 16025.
Detaching after fork from child process 16026.
Detaching after fork from child process 16028.
Detaching after fork from child process 16029.
Detaching after fork from child process 16032.
Detaching after fork from child process 16037.

Program received signal SIGHUP, Hangup.
0xffffe410 in ?? ()
(gdb) c
Continuing.
Detaching after fork from child process 16047.
Detaching after fork from child process 16048.
Detaching after fork from child process 16049.
Detaching after fork from child process 16050.
Detaching after fork from child process 16051.
/usr/lib/cups/backend/nprint: line 103: pqlist: command not found
Detaching after fork from child process 16055.
/usr/lib/cups/backend/pap: line 19: /usr/bin/nbplkup: No such file or directory
Detaching after fork from child process 16058.
Detaching after fork from child process 16059.
Detaching after fork from child process 16062.
Detaching after fork from child process 16067.
Detaching after fork from child process 16068.
Detaching after fork from child process 16069.
Detaching after fork from child process 16070.
Detaching after fork from child process 16072.
Detaching after fork from child process 16073.
Detaching after fork from child process 16076.
Detaching after fork from child process 16081.

Program received signal SIGHUP, Hangup.
0xffffe410 in ?? ()
(gdb) c
Continuing.
Detaching after fork from child process 16089.
Detaching after fork from child process 16090.
Detaching after fork from child process 16091.
Detaching after fork from child process 16092.
Detaching after fork from child process 16093.
/usr/lib/cups/backend/nprint: line 103: pqlist: command not found
Detaching after fork from child process 16097.
/usr/lib/cups/backend/pap: line 19: /usr/bin/nbplkup: No such file or directory
Detaching after fork from child process 16100.
Detaching after fork from child process 16101.
Detaching after fork from child process 16104.
Detaching after fork from child process 16109.
Detaching after fork from child process 16110.
Detaching after fork from child process 16111.
Detaching after fork from child process 16112.
Detaching after fork from child process 16114.
Detaching after fork from child process 16115.
Detaching after fork from child process 16118.
Detaching after fork from child process 16123.

Program received signal SIGHUP, Hangup.
0xffffe410 in ?? ()
(gdb) c
Continuing.
Detaching after fork from child process 16131.
Detaching after fork from child process 16132.
Detaching after fork from child process 16133.
Detaching after fork from child process 16134.
Detaching after fork from child process 16135.
/usr/lib/cups/backend/nprint: line 103: pqlist: command not found
Detaching after fork from child process 16139.
/usr/lib/cups/backend/pap: line 19: /usr/bin/nbplkup: No such file or directory
Detaching after fork from child process 16142.
Detaching after fork from child process 16143.
Detaching after fork from child process 16146.
Detaching after fork from child process 16151.
Detaching after fork from child process 16152.
Detaching after fork from child process 16153.
Detaching after fork from child process 16154.
Detaching after fork from child process 16156.
Detaching after fork from child process 16157.
Detaching after fork from child process 16160.
Detaching after fork from child process 16165.

Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/i386/i486/strlen.S:40
40 ../sysdeps/i386/i486/strlen.S: No such file or directory.
in ../sysdeps/i386/i486/strlen.S
Current language: auto; currently asm
(gdb) bt
#0 strlen () at ../sysdeps/i386/i486/strlen.S:40
#1 0x401fcd3e in _IO_vfprintf (s=0xbfffac30,
format=0x8081910 "%x %x ipp://%s:%d/%s/%s "%s" "%s" "%s"\n",
ap=0xbfffad64 "nfo") at vfprintf.c:1517
#2 0x4021a376 in _IO_vsnprintf (ng=0xbfffad4c "#", maxlen=134748432,
format=0x692d6563 <Address 0x692d6563 out of bounds>,
args=0x692d6563 <Address 0x692d6563 out of bounds>) at vsnprintf.c:130
#3 0x402025a2 in __snprintf (s=0x692d6563 <Address 0x692d6563 out of bounds>,
maxlen=1764582755, format=0x692d6563 <Address 0x692d6563 out of bounds>)
at snprintf.c:35
#4 0x0805e143 in SendCUPSBrowse (p=0x80ff1b8) at dirsvc.c:678
#5 0x0805df0c in SendBrowseList () at dirsvc.c:581
#6 0x08060744 in main (argc=2, argv=0xbffff964) at main.c:702

(gdb)

Collaborator

michaelrsweet commented Sep 14, 2004

CUPS.org User: till.kamppeter

I have the following /etc/cups/printers.conf:


Printer configuration file for CUPS v1.1.21rc1

Written by cupsd on Mon 13 Sep 2004 01:40:23 PM EDT

Info BROTHER HL-5040 Location DeviceURI usb://Brother/HL-5040%20series State Idle Accepting Yes JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0

It seems that the problem only appears when there is at least one locally defined print queue.

Collaborator

michaelrsweet commented Sep 15, 2004

CUPS.org User: mike

I'd guess that iface->hostname is not set for some reason; can you do the following:

frame 4
print *iface

and send me the output?

Thanks!

Collaborator

michaelrsweet commented Oct 4, 2004

CUPS.org User: mike

Please try the patch from STR #928 and let me know if that resolves your problems.

Collaborator

michaelrsweet commented Oct 11, 2004

CUPS.org User: till.kamppeter

I have tested the patch and it works now. This bug can be closed.

Thanks to Tim Waugh for the patch.

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment