segmentation faults

Thomas Schwinge schwinge at nic-nac-project.de
Sun Aug 15 11:55:14 PDT 2004


A couple of days ago I sent the following message to <URL:mailto:cups-bugs at easysw.com> receiving a notice that it is "being held until the list moderator can review it for approval." - that's correct as I'm not subscribed to the list.

As I didn't hear anything from the list's moderator until now I'm posting it again using the web interface on <URL:http://www.cups.org/>.

Original message:
NOTE: I'm not subscribed to the list / newsgroup.


Hello!

I installed CUPS building from source.

With version 1.1.20 I get a segmentation fault as soon as I want to do
anything in the web frontend:

#v+
root at server:/service/cupsd # tai64nlocal < log/main/current
[...]
2004-08-11 20:09:09.258755500 d [11/Aug/2004:20:08:47 +0200] AddCert: adding certificate for pid 0
2004-08-11 20:09:21.038981500 d [11/Aug/2004:20:08:59 +0200] AcceptClient(0x808d928) 0 NumClients = 0
2004-08-11 20:09:21.050624500 D [11/Aug/2004:20:08:59 +0200] AcceptClient() 7 from 192.168.111.111:631.
2004-08-11 20:09:21.062205500 d [11/Aug/2004:20:08:59 +0200] AcceptClient: Adding fd 7 to InputSet...
2004-08-11 20:09:21.073598500 d [11/Aug/2004:20:08:59 +0200] ReadClient() 7, used=0
2004-08-11 20:09:21.077534500 D [11/Aug/2004:20:08:59 +0200] ReadClient() 7 GET / HTTP/1.1
2004-08-11 20:09:21.084324500 d [11/Aug/2004:20:08:59 +0200] decode_auth(0x40287008): Authorization string = "Basic cm9vdDpUZWxlZnVuY2tlbg=="
2004-08-11 20:09:21.085013500 d [11/Aug/2004:20:08:59 +0200] decode_auth() 7 username="root"
2004-08-11 20:09:21.085598500 d [11/Aug/2004:20:08:59 +0200] IsAuthorized: con->uri = "/"
2004-08-11 20:09:21.086168500 d [11/Aug/2004:20:08:59 +0200] FindBest: uri = "/"...
2004-08-11 20:09:21.086733500 d [11/Aug/2004:20:08:59 +0200] FindBest: Location / Limit 7f
2004-08-11 20:09:21.087304500 d [11/Aug/2004:20:08:59 +0200] FindBest: Location /admin Limit 7f
2004-08-11 20:09:21.087870500 d [11/Aug/2004:20:08:59 +0200] FindBest: best = "/"
2004-08-11 20:09:21.095625500 d [11/Aug/2004:20:08:59 +0200] IsAuthorized: auth = 0, satisfy=0...
2004-08-11 20:09:21.097456500 d [11/Aug/2004:20:08:59 +0200] get_file() 7 filename=/package/misc/spf/cups/share/doc/cups/index.html size=1604
2004-08-11 20:09:21.098682500 d [11/Aug/2004:20:08:59 +0200] IsCGI(con=0x40287008, filename="/package/misc/spf/cups/share/doc/cups/index.html", filestats=0xbfff33f0, type=unknown/unknown)
#v-

#v+
root at server:/service/cupsd # strace -f -p `cat supervise/pid`
[...]
time(NULL)                              = 1092247761
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 8
ioctl(8, 0x8912, 0xbfff20fc)            = 0
ioctl(8, 0x8912, 0xbfff20fc)            = 0
ioctl(8, 0x8913, 0x809f270)             = 0
ioctl(8, 0x891b, 0x809f270)             = 0
ioctl(8, 0x8919, 0x809f270)             = 0
ioctl(8, 0x8913, 0x809f290)             = 0
ioctl(8, 0x891b, 0x809f290)             = 0
ioctl(8, 0x8919, 0x809f290)             = 0
ioctl(8, 0x8913, 0x809f2b0)             = 0
ioctl(8, 0x891b, 0x809f2b0)             = 0
ioctl(8, 0x8919, 0x809f2b0)             = 0
close(8)                                = 0
time(NULL)                              = 1092247761
time(NULL)                              = 1092247761
write(3, "d [11/Aug/2004:20:08:59 +0200] I"..., 68) = 68
stat64("/package/misc/spf/cups/share/doc/cups/en/", 0xbfff22a4) = -1 ENOENT (No such file or directory)
stat64("/package/misc/spf/cups/share/doc/cups/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/package/misc/spf/cups/share/doc/cups/index.html", {st_mode=S_IFREG|0644, st_size=1604, ...}) = 0
time(NULL)                              = 1092247761
write(3, "d [11/Aug/2004:20:08:59 +0200] g"..., 112) = 112
open("/package/misc/spf/cups/share/doc/cups/index.html", O_RDONLY) = 8
close(8)                                = 0
time(NULL)                              = 1092247761
write(3, "d [11/Aug/2004:20:08:59 +0200] I"..., 158) = 158
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 29040 detached
#v-

#v+
root at server:/service/cupsd # file core-2004-08-11-18\:09\:21
core-2004-08-11-18:09:21: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, SVR4-style, from 'cupsd'
root at server:/service/cupsd # gdb /package/misc/spf/cups/sbin/cupsd 'core-2004-08-11-18:09:21'
GNU gdb 6.0
[...]
Program terminated with signal 11, Segmentation fault.
Reading symbols from /package/misc/spf/cups-1.1.20-1/spf/zlib/lib/libz.so...done.
Loaded symbols for /package/misc/spf/cups-1.1.20-1/spf/zlib/lib/libz.so
Reading symbols from /package/misc/spf/cups-1.1.20-1/spf/openssl/lib/libssl.so.0.9.7...done.
Loaded symbols for /package/misc/spf/cups-1.1.20-1/spf/openssl/lib/libssl.so.0.9.7
Reading symbols from /package/misc/spf/cups-1.1.20-1/spf/openssl/lib/libcrypto.so.0.9.7...done.
Loaded symbols for /package/misc/spf/cups-1.1.20-1/spf/openssl/lib/libcrypto.so.0.9.7
Reading symbols from /package/misc/spf/cups-1.1.20-1/lib/libcups.so.2...done.
Loaded symbols for /package/misc/spf/cups-1.1.20-1/lib/libcups.so.2
Reading symbols from /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/libnsl.so.1...done.
Loaded symbols for /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/libnsl.so.1
Reading symbols from /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/libcrypt.so.1...done.
Loaded symbols for /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/libcrypt.so.1
Reading symbols from /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/libc.so.6...done.
Loaded symbols for /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/libc.so.6
Reading symbols from /package/misc/spf/openssl-0.9.7d-1/spf/glibc/lib/libdl.so.2...done.
Loaded symbols for /package/misc/spf/openssl-0.9.7d-1/spf/glibc/lib/libdl.so.2
Reading symbols from /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/ld-linux.so.2...done.
Loaded symbols for /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/ld-linux.so.2
Reading symbols from /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/libnss_files.so.2...done.
Loaded symbols for /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/libnss_files.so.2
#0  0x401e6a2c in strcasecmp () from /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/libc.so.6
(gdb) bt
#0  0x401e6a2c in strcasecmp () from /package/misc/spf/cups-1.1.20-1/spf/glibc/lib/libc.so.6
#1  0x080518ed in IsCGI (con=0x40287008, filename=0xbfff3450 "/package/misc/spf/cups/share/doc/cups/index.html", filestats=0xbfff33f0, type=0x0)
    at client.c:699
#2  0x08052d25 in ReadClient (con=0x40287008) at client.c:1322
#3  0x0805fb7b in main (argc=4, argv=0xbffffeb4) at main.c:596
#v-


I installed version 1.1.21rc1 (again building from source).
The said segmentation fault does not occur anymore.

<URL:http://localhost:631/> is served with
'Content-Type: text/plain; charset=utf-8' - that should be 'text/html'
to be rendered as HTML and not get displayed as plain text.
<URL:http://server.schwinge.homeip.net:631/admin/> _is_ served as
'text/html'.

After adding a printer using the web frontend I wanted to configure that
printer and did so using '< Configure Printer >'.
Again I got a segmentation fault after doing my modidications and
selecting '< Continue >':

#v+
root at server:/service/cupsd # tai64nlocal < log/main/current
[...]
2004-08-11 20:32:05.730956500 d [11/Aug/2004:20:31:43 +0200] FindBest: best = "/"
2004-08-11 20:32:05.735592500 d [11/Aug/2004:20:31:43 +0200] IsAuthorized: auth = 0, satisfy=0...
2004-08-11 20:32:05.737380500 d [11/Aug/2004:20:31:43 +0200] get_file: 11 filename=/package/misc/spf/cups-data-0/service/cupsd/root/ppd/HPLJ4L.ppd size=9459
2004-08-11 20:32:05.739648500 d [11/Aug/2004:20:31:43 +0200] IsCGI(con=0x4028c870, filename="/package/misc/spf/cups-data-0/service/cupsd/root/ppd/HPLJ4L.ppd", filestats=0xbfff33e0, type=unknown/unknown)
2004-08-11 20:32:05.740655500 d [11/Aug/2004:20:31:43 +0200] IsCGI: Returning 0...
2004-08-11 20:32:05.742182500 D [11/Aug/2004:20:31:43 +0200] SendFile: 11 file=12
2004-08-11 20:32:05.798987500 d [11/Aug/2004:20:31:43 +0200] SendFile: Adding fd 11 to OutputSet...
2004-08-11 20:32:05.871168500 d [11/Aug/2004:20:31:43 +0200] WriteClient: 11 2048 bytes
2004-08-11 20:32:05.881063500 d [11/Aug/2004:20:31:43 +0200] WriteClient: 11 2048 bytes
2004-08-11 20:32:05.922785500 d [11/Aug/2004:20:31:43 +0200] WriteClient: 11 2048 bytes
2004-08-11 20:32:05.931540500 d [11/Aug/2004:20:31:43 +0200] WriteClient: 11 2048 bytes
2004-08-11 20:32:06.025847500 d [11/Aug/2004:20:31:44 +0200] WriteClient: 11 1267 bytes
2004-08-11 20:32:06.029574500 E [11/Aug/2004:20:31:44 +0200] PID 8079 stopped with status 0!
2004-08-11 20:32:06.030522500 d [11/Aug/2004:20:31:44 +0200] DeleteCert: removing certificate for pid 8079
2004-08-11 20:32:06.034738500 192.168.111.111 - root [11/Aug/2004:20:31:40 +0200] "POST /admin HTTP/1.1" 200 1288
2004-08-11 20:32:06.036486500 d [11/Aug/2004:20:31:44 +0200] WriteClient: Removing fd 7 from OutputSet...
2004-08-11 20:32:06.037442500 d [11/Aug/2004:20:31:44 +0200] WriteClient: Removing fd 10 from InputSet...
2004-08-11 20:32:06.039201500 d [11/Aug/2004:20:31:44 +0200] WriteClient: 7 Closing data file 10.
2004-08-11 20:32:06.040496500 d [11/Aug/2004:20:31:44 +0200] WriteClient: 7 Removing temp file /package/misc/spf/cups-data-0/service/cupsd/spool/00000000
2004-08-11 20:32:06.043200500 d [11/Aug/2004:20:31:44 +0200] ReadClient: 9, used=0, file=-1
2004-08-11 20:32:06.124534500 d [11/Aug/2004:20:31:44 +0200] ReadClient: httpGets returned EOF...
2004-08-11 20:32:06.130370500 D [11/Aug/2004:20:31:44 +0200] CloseClient: 9
2004-08-11 20:32:06.135378500 d [11/Aug/2004:20:31:44 +0200] CloseClient: Removing fd 9 from InputSet and OutputSet...
2004-08-11 20:32:06.139955500 d [11/Aug/2004:20:31:44 +0200] ReadClient: 11, used=0, file=12
2004-08-11 20:32:06.142779500 localhost - - [11/Aug/2004:20:31:43 +0200] "GET /ppd/HPLJ4L.ppd HTTP/1.1" 200 9459
2004-08-11 20:32:06.145026500 d [11/Aug/2004:20:31:44 +0200] WriteClient: Removing fd 11 from OutputSet...
2004-08-11 20:32:06.145985500 d [11/Aug/2004:20:31:44 +0200] WriteClient: 11 Closing data file 12.
2004-08-11 20:32:06.150120500 d [11/Aug/2004:20:31:44 +0200] ReadClient: 11, used=0, file=-1
2004-08-11 20:32:06.152125500 d [11/Aug/2004:20:31:44 +0200] ReadClient: httpGets returned EOF...
2004-08-11 20:32:06.153072500 D [11/Aug/2004:20:31:44 +0200] CloseClient: 11
2004-08-11 20:32:06.154015500 d [11/Aug/2004:20:31:44 +0200] CloseClient: Removing fd 11 from InputSet and OutputSet...
2004-08-11 20:32:07.167142500 d [11/Aug/2004:20:31:45 +0200] select_timeout: 26 seconds to send browse update
#v-

#v+
root at server:/service/cupsd # strace -f -p `cat supervise/pid`
[...]
write(3, "d [11/Aug/2004:20:31:40 +0200] e"..., 63) = 63
time(NULL)                              = 1092249122
write(3, "d [11/Aug/2004:20:31:40 +0200] e"..., 91) = 91
pipe([10, 11])                          = 0
rt_sigprocmask(SIG_BLOCK, [TERM CHLD], [], 8) = 0
fork(Process 8079 attached
)                                  = 8079
[pid  8057] time( <unfinished ...>
[pid  8079] --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
[pid  8057] <... time resumed> NULL)    = 1092249122
[pid  8079] setgid32(30101 <unfinished ...>
[pid  8057] write(3, "d [11/Aug/2004:20:31:40 +0200] A"..., 72 <unfinished ...>
[pid  8079] <... setgid32 resumed> )    = 0
[pid  8057] <... write resumed> )       = 72
[pid  8079] setgroups32(1, [30101] <unfinished ...>
[pid  8057] unlink("/package/misc/spf/cups-data-0/service/cupsd/root/certs/8079") = -1 ENOENT (No such file or directory)
[pid  8057] open("/package/misc/spf/cups-data-0/service/cupsd/root/certs/8079", O_WRONLY|O_CREAT|O_EXCL, 0400) = 12
[pid  8057] fchmod(12, 0400)            = 0
[...]
[pid  8079] close(1022)                 = -1 EBADF (Bad file descriptor)
[pid  8079] close(1023)                 = -1 EBADF (Bad file descriptor)
[pid  8079] umask(077)                  = 022
[pid  8079] rt_sigaction(SIGTERM, {SIG_DFL}, NULL, 8) = 0
[pid  8079] rt_sigaction(SIGCHLD, {SIG_DFL}, NULL, 8) = 0
[pid  8079] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid  8079] execve("/package/misc/spf/cups/lib/cups/cgi-bin/admin.cgi", ["admin.cgi"], [/* 22 vars */]) = 0
[pid  8079] brk(0)                      = 0x8051b0c
[pid  8079] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40012000
[...]
[pid  8079] gettimeofday({1092249125, 975371}, NULL) = 0
[pid  8079] open("/package/misc/spf/cups-data-0/service/cupsd/spool/tmp/411a6625ee20b", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
[pid  8079] open("/package/misc/spf/cups-data-0/service/cupsd/spool/tmp/411a6625a5496", O_RDONLY) = 6
[pid  8079] fcntl64(5, F_GETFL)         = 0x2 (flags O_RDWR)
[pid  8079] fstat64(5, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
[pid  8079] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x402c8000
[pid  8079] _llseek(5, 0, [0], SEEK_CUR) = 0
[pid  8079] fstat64(6, {st_mode=S_IFREG|0600, st_size=9459, ...}) = 0
[pid  8079] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x402c9000
[pid  8079] read(6, "*PPD-Adobe: \"4.3\"\n*%\n*% \"$Id: la"..., 4096) = 4096
[pid  8079] read(6, "lope C5:\t\"<</PageSize[459 649]/I"..., 4096) = 4096
[pid  8079] write(5, "*PPD-Adobe: \"4.3\"\n*%\n*% \"$Id: la"..., 4096) = 4096
[pid  8079] read(6, "rrow: Standard \"(001.006S)\" Stan"..., 4096) = 1267
[pid  8079] write(5, "\t\"<</PageSize[459 649]/ImagingBB"..., 4096) = 4096
[pid  8079] read(6, "", 4096)           = 0
[pid  8079] close(6)                    = 0
[pid  8079] munmap(0x402c9000, 4096)    = 0
[pid  8079] write(5, "andard \"(001.006S)\" Standard ROM"..., 1259) = 1259
[pid  8079] close(5)                    = 0
[pid  8079] munmap(0x402c8000, 4096)    = 0
[pid  8079] close(5)                    = -1 EBADF (Bad file descriptor)
[pid  8079] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 8079 detached
<... send resumed> )                    = 1267
--- SIGCHLD (Child exited) @ 0 (0) ---
sigreturn()                             = ? (mask now [])
time(NULL)                              = 1092249126
write(3, "d [11/Aug/2004:20:31:44 +0200] W"..., 58) = 58
time(NULL)                              = 1092249126
time(NULL)                              = 1092249126
time(NULL)                              = 1092249126
time(NULL)                              = 1092249126
time(NULL)                              = 1092249126
time(NULL)                              = 1092249126
time(NULL)                              = 1092249126
time(NULL)                              = 1092249126
wait4(-1, [WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV && WCOREDUMP(s)], WNOHANG, NULL) = 8079
time(NULL)                              = 1092249126
write(3, "E [11/Aug/2004:20:31:44 +0200] P"..., 63) = 63
time(NULL)                              = 1092249126
write(3, "d [11/Aug/2004:20:31:44 +0200] D"..., 77) = 77
unlink("/package/misc/spf/cups-data-0/service/cupsd/root/certs/8079") = 0
wait4(-1, 0xbfffb940, WNOHANG, NULL)    = -1 ECHILD (No child processes)
select(1024, [0 4 5 7 9 10 11], [7 11], NULL, {1, 0}) = 5 (in [9 10 11], out [7 11], left {1, 0})
read(10, "", 2048)                      = 0
write(8, "192.168.111.111 - root [11/Aug/2"..., 84) = 84
send(7, "0\r\n\r\n", 5, 0)              = 5
time(NULL)                              = 1092249126
write(3, "d [11/Aug/2004:20:31:44 +0200] W"..., 76) = 76
time(NULL)                              = 1092249126
write(3, "d [11/Aug/2004:20:31:44 +0200] W"..., 76) = 76
kill(8079, SIGTERM)                     = -1 ESRCH (No such process)
time(NULL)                              = 1092249126
write(3, "d [11/Aug/2004:20:31:44 +0200] W"..., 68) = 68
close(10)                               = 0
[...]
#v-

#v+
root at server:/service/cupsd # file core-2004-08-11-18\:32\:20
core-2004-08-11-18:32:20: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, SVR4-style, from 'admin.cgi'
root at server:/service/cupsd # gdb /package/misc/spf/cups/lib/cups/cgi-bin/admin.cgi 'core-2004-08-11-18:32:20'
GNU gdb 6.0
[...]
Core was generated by `admin.cgi'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /package/misc/spf/cups-1.1.21rc1-3/lib/libcups.so.2...done.
Loaded symbols for /package/misc/spf/cups-1.1.21rc1-3/lib/libcups.so.2
Reading symbols from /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/libnsl.so.1...done.
Loaded symbols for /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/libnsl.so.1
Reading symbols from /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/libcrypt.so.1...done.
Loaded symbols for /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/libcrypt.so.1
Reading symbols from /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/libc.so.6...done.
Loaded symbols for /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/libc.so.6
Reading symbols from /package/misc/spf/cups-1.1.21rc1-3/spf/openssl/lib/libssl.so.0.9.7...done.
Loaded symbols for /package/misc/spf/cups-1.1.21rc1-3/spf/openssl/lib/libssl.so.0.9.7
Reading symbols from /package/misc/spf/cups-1.1.21rc1-3/spf/openssl/lib/libcrypto.so.0.9.7...done.
Loaded symbols for /package/misc/spf/cups-1.1.21rc1-3/spf/openssl/lib/libcrypto.so.0.9.7
Reading symbols from /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/ld-linux.so.2...done.
Loaded symbols for /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/ld-linux.so.2
Reading symbols from /package/misc/spf/openssl-0.9.7d-1/spf/glibc/lib/libdl.so.2...done.
Loaded symbols for /package/misc/spf/openssl-0.9.7d-1/spf/glibc/lib/libdl.so.2
Reading symbols from /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/libnss_files.so.2...done.
Loaded symbols for /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/libnss_files.so.2
#0  0x400d3d5e in strdup () from /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/libc.so.6
(gdb) bt
#0  0x400d3d5e in strdup () from /package/misc/spf/cups-1.1.21rc1-3/spf/glibc/lib/libc.so.6
#1  0x0804c72c in do_config_printer (http=0x805ca28, language=0x8052608) at admin.c:1292
#2  0x08049b93 in main (argc=1, argv=0xbffffc54) at admin.c:137
#v-


The latest CVS version is not useable (even after fixing
'templates/Makefile'): The web frontend is not working properly.


Do you need any additional information?


Another suggestion:
When specifing '--enable-debug' I'd suggest to remove '-s' from
'INSTALL_BIN' in 'Makedefs.in': There is nearly no use in compiling
debugging information into the executables and stripping them afterwards.


Regards,
 Thomas





More information about the cups mailing list