| Summary: | Proftpd possible segfault on amd64 with mod_delay on | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Phattanon Duangdara <phattanon> |
| Component: | [OLD] Server | Assignee: | Gustavo Felisberto (RETIRED) <humpback> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | amd64, blizzy-keyword-gentoo_bugs3.075080, empirical.humanist, sgtphou |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | AMD64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
Patch to skip mod_delay and delaytable if mod_delay is off
proftpd-1.2.10-r3.ebuild |
||
|
Description
Phattanon Duangdara
2004-12-20 10:07:08 UTC
Is may caused by unexists of /var/run/proftpd/proftpd.delay dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - ROOT PRIVS at main.c:1011 dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - SETUP PRIVS at main.c:1016 dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - FTP session requested from unknown class dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - performing module session initializations dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - mod_delay/0.4: opening DelayTable '/var/run/proftpd/proftpd.delay' dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - ROOT PRIVS at mod_delay.c:655 dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - FS: using system open() dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - RELINQUISH PRIVS at mod_delay.c:657 dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - mod_delay/0.4: warning: unable to open DelayTable '/var/run/proftpd/proftpd.delay': No such file or directory dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - ProFTPD terminating (signal 11) dekdoi.64hosting.com (ppp-61.91.71.33.revip.asianet.co.th[61.91.71.33]) - FTP session closed. Problems cause with mod_delay. Reporting to upstream. http://bugs.proftpd.org/show_bug.cgi?id=2540 Need to update very soon if i get patch and i will post here. There seems to be two bugs here. One related to mod_delay on amd64 and the other due to no /var/run/proftpd/proftpd.delay. I have a question. If you deactivate mod_delay the server will start ok right? I tested on a x86 system with mod_delay activated and even if i delete the scoreboard file it will be created by the server on startup. After I test sometimes later. Deactivate mod_delay using 'DelayEngine off' not cause anything to change. There are still have problems when proftpd.delay not exists. It seems to be bugs of mod_delay, NOT amd64 platform. (I don't have time to do strace) I know that patch was submitted to proftpd CVS. Proftpd ebuilds should update soon. I experienced the exact problem of the bug reporter (using the -r1 ebuild), also on amd64 (dual Opterons), right down to the segfault kernel messages. When I moved /var/run/proftpd/proftpd.delay out of the way and restarted the server, everything came back up normally, including a newly created .delay file. I'm waiting to see if the problem reoccurs after running a few hours. Created attachment 47806 [details, diff]
Patch to skip mod_delay and delaytable if mod_delay is off
Comment on attachment 47806 [details, diff]
Patch to skip mod_delay and delaytable if mod_delay is off
Patch from proftpd bugs #2540 (Already committed to proftpd CVS)
I later found What cause sometimes unproduceable bugs here after I try stracing proftpd with DelayEngine On. I think mod_delay have no bugs here but kernel mmap.
I don't know why this unsafe and cause Segfault, so It cannot lock proftpd.delay and segfault.
4167 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2a96476ca0) = 4207
4167 close(1 <unfinished ...>
4207 rt_sigprocmask(SIG_UNBLOCK, [USR1 USR2 TERM CHLD], <unfinished ...>
4167 <... close resumed> ) = 0
4207 <... rt_sigprocmask resumed> NULL, 8) = 0
4167 close(7 <unfinished ...>
4207 close(4 <unfinished ...>
4167 <... close resumed> ) = 0
4207 <... close resumed> ) = 0
4167 rt_sigprocmask(SIG_UNBLOCK, [USR1 USR2 TERM CHLD], <unfinished ...>
4207 close(0 <unfinished ...>
4167 <... rt_sigprocmask resumed> NULL, 8) = 0
4207 <... close resumed> ) = 0
4167 fcntl(0, F_GETFL <unfinished ...>
4207 rt_sigaction(SIGUSR1, {0x408690, [USR1], SA_RESTART|0x4000000}, <unfinished ...>
4167 <... fcntl resumed> ) = 0x802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE)
4207 <... rt_sigaction resumed> {SIG_DFL}, 8) = 0
4167 fcntl(0, F_SETFL, O_RDWR) = 0
4167 lstat("/etc/shutmsg", 0x7fbfffeb10) = -1 ENOENT (No such file or directory)
4167 select(5, [0 4], NULL, NULL, {30, 0} <unfinished ...>
4207 rt_sigaction(SIGUSR2, {0x408670, [USR2], SA_RESTART|0x4000000}, {0x408670, [USR2], SA_RESTART|0x4000000}, 8) = 0
4207 rt_sigaction(SIGCHLD, {SIG_DFL}, {0x408830, [CHLD], SA_RESTART|0x4000000}, 8) = 0
4207 rt_sigaction(SIGHUP, {SIG_IGN}, {0x408650, [HUP], SA_RESTART|0x4000000}, 8) = 0
4207 close(4294967295) = -1 EBADF (Bad file descriptor)
4207 getsockname(1, {sa_family=AF_INET, sin_port=htons(21), sin_addr=inet_addr("127.0.0.1")}, [42949672976]) = 0
4207 getpeername(1, {sa_family=AF_INET, sin_port=htons(37857), sin_addr=inet_addr("127.0.0.1")}, [42949672976]) = 0
4207 dup2(1, 0) = 0
4207 setsockopt(1, SOL_SOCKET, SO_KEEPALIVE, [26866497905229824], 4) = 0
4207 getsockopt(1, SOL_SOCKET, SO_SNDBUF, [17179919884], [4]) = 0
4207 setsockopt(0, SOL_SOCKET, SO_KEEPALIVE, [26866497905229824], 4) = 0
4207 getsockopt(0, SOL_SOCKET, SO_RCVBUF, [87520], [4]) = 0
4207 fcntl(0, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE)
4207 fcntl(0, F_SETFL, O_RDWR) = 0
4207 fcntl(1, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE)
4207 fcntl(1, F_SETFL, O_RDWR) = 0
4207 rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
4207 setresuid(4294967295, 0, 4294967295) = 0
4207 setresgid(4294967295, 0, 4294967295) = 0
4207 close(4294967295) = -1 EBADF (Bad file descriptor)
4207 socket(PF_FILE, SOCK_DGRAM, 0) = 4
4207 fcntl(4, F_SETFD, FD_CLOEXEC) = 0
4207 connect(4, {sa_family=AF_FILE, path="/dev/log"}, 16) = -1 EPROTOTYPE (Protocol wrong type for socket)
4207 close(4) = 0
4207 socket(PF_FILE, SOCK_STREAM, 0) = 4
4207 fcntl(4, F_SETFD, FD_CLOEXEC) = 0
4207 connect(4, {sa_family=AF_FILE, path="/dev/log"}, 16) = 0
4207 geteuid() = 0
4207 setresgid(4294967295, 410, 4294967295) = 0
4207 setresuid(4294967295, 1033, 4294967295) = 0
4207 rt_sigprocmask(SIG_UNBLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
4207 setsockopt(1, SOL_TCP, TCP_NODELAY, [1], 4) = 0
4207 setsockopt(0, SOL_TCP, TCP_NODELAY, [1], 4) = 0
4207 setsockopt(1, SOL_IP, IP_TOS, [16], 4) = 0
4207 setsockopt(0, SOL_IP, IP_TOS, [16], 4) = 0
4207 close(7 <unfinished ...>
4167 <... select resumed> ) = 1 (in [4], left {29, 999000})
4207 <... close resumed> ) = 0
4167 close(4) = 0
4167 lstat("/etc/shutmsg", 0x7fbfffeb10) = -1 ENOENT (No such file or directory)
4167 select(1, [0], NULL, NULL, {30, 0} <unfinished ...>
4207 open("/etc/hosts", O_RDONLY) = 7
4207 fcntl(7, F_GETFD) = 0
4207 fcntl(7, F_SETFD, FD_CLOEXEC) = 0
4207 fstat(7, {st_mode=S_IFREG|0644, st_size=855, ...}) = 0
4207 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95570000
4207 read(7, "# /etc/hosts: This file describ"..., 4096) = 855
4207 close(7) = 0
4207 munmap(0x2a95570000, 4096) = 0
4207 open("/etc/hosts", O_RDONLY) = 7
4207 fcntl(7, F_GETFD) = 0
4207 fcntl(7, F_SETFD, FD_CLOEXEC) = 0
4207 fstat(7, {st_mode=S_IFREG|0644, st_size=855, ...}) = 0
4207 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95570000
4207 read(7, "# /etc/hosts: This file describ"..., 4096) = 855
4207 close(7) = 0
4207 munmap(0x2a95570000, 4096) = 0
4207 geteuid() = 1033
4207 getegid() = 410
4207 setresuid(4294967295, 0, 4294967295) = 0
4207 setresgid(4294967295, 0, 4294967295) = 0
4207 getuid() = 0
4207 getuid() = 0
4207 setuid(0) = 0
4207 setgid(410) = 0
4207 setresuid(4294967295, 1033, 4294967295) = 0
4207 rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
4207 rt_sigprocmask(SIG_UNBLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
4207 setresuid(4294967295, 0, 4294967295) = 0
4207 setresgid(4294967295, 0, 4294967295) = 0
4207 open("/var/run/proftpd/proftpd.delay", O_RDWR) = 7
4207 geteuid() = 0
4207 setresgid(4294967295, 410, 4294967295) = 0
4207 setresuid(4294967295, 1033, 4294967295) = 0
4207 alarm(0) = 0
4207 alarm(25) = 0
4207 rt_sigaction(SIGALRM, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, NULL, 8) = 0
4207 rt_sigaction(SIGALRM, NULL, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, 8) = 0
4207 rt_sigaction(SIGALRM, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, NULL, 8) = 0
4207 alarm(0) = 25
4207 alarm(25) = 0
4207 setresuid(4294967295, 0, 4294967295) = 0
4207 setresgid(4294967295, 0, 4294967295) = 0
4207 open("/var/run/proftpd/proftpd.scoreboard", O_RDWR|O_CREAT, 0644) = 8
4207 fchmod(8, 0644) = 0
4207 fstat(8, {st_mode=S_IFREG|0644, st_size=32, ...}) = 0
4207 rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
4207 read(8, "\357\276\255\336\0\0\0\0\2\0\4\1\0\0\0\0G\20\0\0\0\0\0"..., 32) = 32
4207 rt_sigprocmask(SIG_UNBLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
4207 geteuid() = 0
4207 setresgid(4294967295, 410, 4294967295) = 0
4207 setresuid(4294967295, 1033, 4294967295) = 0
4207 fcntl(8, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
4207 rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
4207 read(8, "", 536) = 0
4207 lseek(8, 0, SEEK_CUR) = 32
4207 geteuid() = 1033
4207 getegid() = 410
4207 lseek(8, 32, SEEK_SET) = 32
4207 write(8, "o\20\0\0\t\4\0\0\232\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 536) = 536
4207 lseek(8, 32, SEEK_SET) = 32
4207 rt_sigprocmask(SIG_UNBLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
4207 fcntl(8, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
4207 fcntl(8, F_SETLKW, {type=F_WRLCK, whence=SEEK_CUR, start=32, len=536}) = 0
4207 lseek(8, 32, SEEK_SET) = 32
4207 write(8, "o\20\0\0\t\4\0\0\232\1\0\0(none)\0\0\0\0\0\0\0\0\0\0\0"..., 536) = 536
4207 lseek(8, 32, SEEK_SET) = 32
4207 fcntl(8, F_SETLKW, {type=F_UNLCK, whence=SEEK_CUR, start=32, len=536}) = 0
4207 lseek(8, 0, SEEK_CUR) = 32
4207 lseek(8, 32, SEEK_SET) = 32
4207 fcntl(8, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
4207 read(8, "o\20\0\0\t\4\0\0\232\1\0\0(none)\0\0\0\0\0\0\0\0\0\0\0"..., 536) = 536
4207 fcntl(8, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
4207 fcntl(8, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
4207 read(8, "", 536) = 0
4207 fcntl(8, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
4207 lseek(8, 32, SEEK_SET) = 32
4207 rt_sigaction(SIGALRM, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, NULL, 8) = 0
4207 rt_sigaction(SIGALRM, NULL, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, 8) = 0
4207 rt_sigaction(SIGALRM, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, NULL, 8) = 0
4207 alarm(0) = 25
4207 alarm(25) = 0
4207 alarm(0) = 25
4207 alarm(120) = 0
4207 open("/etc/services", O_RDONLY) = 9
4207 fcntl(9, F_GETFD) = 0
4207 fcntl(9, F_SETFD, FD_CLOEXEC) = 0
4207 fstat(9, {st_mode=S_IFREG|0644, st_size=28741, ...}) = 0
4207 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95570000
4207 read(9, "# /etc/services:\n# $Id: services"..., 4096) = 4096
4207 read(9, "tore\ndeos\t\t76/udp\n# private\t77/t"..., 4096) = 4096
4207 close(9) = 0
4207 munmap(0x2a95570000, 4096) = 0
4207 rt_sigaction(SIGALRM, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, NULL, 8) = 0
4207 rt_sigaction(SIGALRM, NULL, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, 8) = 0
4207 rt_sigaction(SIGALRM, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, NULL, 8) = 0
4207 alarm(0) = 120
4207 alarm(10) = 0
4207 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 9
4207 setsockopt(9, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
4207 bind(9, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
4207 getsockname(9, {sa_family=AF_INET, sin_port=htons(37858), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
4207 connect(9, {sa_family=AF_INET, sin_port=htons(113), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
4207 alarm(0) = 10
4207 alarm(120) = 0
4207 close(9) = 0
4207 setsockopt(0, SOL_SOCKET, SO_OOBINLINE, [18458824545402881], 4) = 0
4207 setsockopt(1, SOL_SOCKET, SO_OOBINLINE, [18458858905141249], 4) = 0
4207 fcntl(0, F_SETOWN, 4207) = 0
4207 fcntl(1, F_SETOWN, 4207) = 0
4207 rt_sigaction(SIGALRM, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, NULL, 8) = 0
4207 rt_sigaction(SIGALRM, NULL, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, 8) = 0
4207 rt_sigaction(SIGALRM, {0x40d9b0, [], SA_INTERRUPT|0x4000000}, NULL, 8) = 0
4207 alarm(0) = 120
4207 alarm(120) = 0
4207 select(2, [], [1], NULL, {60, 0}) = 1 (out [1], left {60, 0})
4207 write(1, "220 ProFTPD 1.2.10 Server (64Hos"..., 72) = 72
4207 write(2, "dekdoi.64hosting.com (localhost["..., 66) = 66
4207 select(1, [0], [], NULL, {60, 0}) = 1 (in [0], left {60, 0})
4207 read(0, "USER anonymous\r\n", 1022) = 16
4207 alarm(0) = 120
4207 alarm(120) = 0
4207 close(5) = 0
4207 munmap(0x2a9556c000, 4096) = 0
4207 close(6) = 0
4207 munmap(0x2a9556d000, 4096) = 0
4207 mmap(NULL, 4288, PROT_READ|PROT_WRITE, MAP_SHARED, 7, 0) = 0x2a9556c000
4207 fcntl(7, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=2144}) = 0
4207 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
4207 fcntl(8, F_SETLKW, {type=F_WRLCK, whence=SEEK_CUR, start=32, len=536}) = 0
4207 lseek(8, 32, SEEK_SET) = 32
4207 write(8, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 536) = 536
4207 lseek(8, 32, SEEK_SET) = 32
4207 fcntl(8, F_SETLKW, {type=F_UNLCK, whence=SEEK_CUR, start=32, len=536}) = 0
4207 write(2, "dekdoi.64hosting.com (localhost["..., 78) = 78
4207 write(2, "dekdoi.64hosting.com (localhost["..., 66) = 66
4207 rt_sigaction(SIGSEGV, {SIG_DFL}, {0x408700, [SEGV], SA_RESTART|0x4000000}, 8) = 0
4207 rt_sigreturn(0xb) = 4294967295
4207 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
4167 <... select resumed> ) = ? ERESTARTNOHAND (To be restarted)
4167 --- SIGCHLD (Child exited) @ 0 (0) ---
4167 rt_sigprocmask(SIG_BLOCK, [TERM CHLD], NULL, 8) = 0
4167 wait4(-1, NULL, WNOHANG, NULL) = 4207
4167 wait4(-1, NULL, WNOHANG, NULL) = -1 ECHILD (No child processes)
I am having the same problems though on ~x86. Trying to turn mod_delay off via DelayEngine off results in mod_delay still looking for the DelayTable file, even if you point it somewhere else. Any client connecting immediately has their session terminated, and that session of proftpd segfaults (sig 11). This is in 1.2.10-r1 on ~x86 again, but I figured this info would be useful. This is likely related to this bug: http://bugs.proftpd.org/show_bug.cgi?id=2540 I had to edit the 1.2.10-r2 ebuild to not attempt to build mod_delay to get around the problem. Disabling mod_delay according to the instructions will not work. Again, I am ~x86 but I bet this applies to any arch. Created attachment 51465 [details]
proftpd-1.2.10-r3.ebuild
Can you please test this version? After talking alot to upstream i decided it
is no god to try to backport the new mod_delay to 1.2.10 as the new versions
are being developed against the proftpd cvs, so i decided to remove mod_delay
Wish I could assist, however that machine is production and it has to stay up. Pretty sure all I did was remove :mod_delay somwhere in there, (not at work now). In portage now |