You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2009/07/13 17:10:52 UTC

DO NOT REPLY [Bug 47519] New: APR segfaults in apr_pollset_add()

https://issues.apache.org/bugzilla/show_bug.cgi?id=47519

           Summary: APR segfaults in apr_pollset_add()
           Product: APR
           Version: HEAD
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: klausman@gentoo.org


Here's the gdb backtrace:

Starting program: /usr/sbin/apache2 -D DEFAULT_VHOST -D NAGIOS -D SSL -D
SSL_DEFAULT_VHOST -D PHP5 -d /usr/lib64/apache2 -f /etc/apache2/httpd.conf -X
[Thread debugging using libthread_db enabled]
[New Thread 0x7fe603c03740 (LWP 6379)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fe603c03740 (LWP 6379)]
0x00007fe602982c5d in apr_pollset_add (pollset=0x0, descriptor=0x7fff0bc1bd30)
at poll/unix/epoll.c:170
170        if (pollset->flags & APR_POLLSET_NOCOPY) {
gdb> where
#0  0x00007fe602982c5d in apr_pollset_add (pollset=0x0,
descriptor=0x7fff0bc1bd30) at poll/unix/epoll.c:170
#1  0x0000000000456788 in child_main (child_num_arg=0) at prefork.c:532
#2  0x0000000000456abc in make_child (s=0x21a1590, slot=0) at prefork.c:698
#3  0x0000000000457044 in ap_mpm_run (_pconf=0x2069c00, plog=0x207b900,
s=0x21a1590) at prefork.c:974
#4  0x0000000000426555 in main (argc=16, argv=0x7fff0bc1c048) at main.c:740
gdb> bt full
#0  0x00007fe602982c5d in apr_pollset_add (pollset=0x0,
descriptor=0x7fff0bc1bd30) at poll/unix/epoll.c:170
    ev = {events = 1, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}
    ret = -1
    elem = (pfd_elem_t *) 0x0
    rv = 0
#1  0x0000000000456788 in child_main (child_num_arg=0) at prefork.c:532
    pfd = {p = 0x0, desc_type = APR_POLL_SOCKET, reqevents = 1, rtnevents = 0,
desc = {f = 0x21a0b80, s = 0x21a0b80}, client_data = 0x21a0b40}
    ptrans = (apr_pool_t *) 0x2113220
    allocator = (apr_allocator_t *) 0x2113cc0
    status = 0
    i = 1
    lr = (ap_listen_rec *) 0x21a0b40
    pollset = (apr_pollset_t *) 0x0
    sbh = (ap_sb_handle_t *) 0x20afde0
    bucket_alloc = (apr_bucket_alloc_t *) 0x7fff20000000
    last_poll_idx = 0
#2  0x0000000000456abc in make_child (s=0x21a1590, slot=0) at prefork.c:698
    pid = 0
#3  0x0000000000457044 in ap_mpm_run (_pconf=0x2069c00, plog=0x207b900,
s=0x21a1590) at prefork.c:974
    index = 0
    remaining_children_to_start = 197246576
    rv = 0
#4  0x0000000000426555 in main (argc=16, argv=0x7fff0bc1c048) at main.c:740
    c = 88 'X'
    configtestonly = 0
    confname = 0x7fff0bc1c762 "/etc/apache2/httpd.conf"
    def_server_root = 0x7fff0bc1c74c "/usr/lib64/apache2"
    temp_error_log = 0x0
    error = 0x0
    process = (process_rec *) 0x2069bd0
    server_conf = (server_rec *) 0x21a1590
    pglobal = (apr_pool_t *) 0x2069680
    pconf = (apr_pool_t *) 0x2069c00
    plog = (apr_pool_t *) 0x207b900
    ptemp = (apr_pool_t *) 0x21a14e0
    pcommands = (apr_pool_t *) 0x2069cb0
    opt = (apr_getopt_t *) 0x207b6e0
    rv = 0
    mod = (module **) 0x66d6e0
    optarg = 0x0
    signal_server = (apr_OFN_ap_signal_server_t *) 0

In strace, just before the SEGV happens, I see weird calls like this:

syscall_291(0x80000, 0x2, 0x17ae0b8, 0x7ffffe557600, 0x1d0, 0, 0x2, 0x2, 0x2,
0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2,
0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 <unfinished ...>

The syscall then resumes and a SEGV is triggered.

At first I suspected this to be a dupe of bug 46467 since I ran 2.6.25.4, but
an update to 2.6.29.5 didn't help. CONFIG_EPOLL is "y".

So I backdated from apr-1.3.6 to -1.3.5 and the problem went away.

Versions involved:
apache 2.2.11-r2
apr 1.3.6 (1.3.5 does not have this problem)
apr-util 1.3.8
kernel 2.6.29.5 (2.6.25.4 behaves likewise)
glibc 2.9_p20081201

ulimits:
# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 38911
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 38911
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519


Peter Poeml <po...@suse.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |poeml@suse.de




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519





--- Comment #3 from Chetan Reddy <ch...@gmail.com>  2009-07-13 10:39:33 PST ---
Created an attachment (id=23971)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23971)
add check for epoll_create1 function

I had reported this bug on the mailing list. Here is a patch to apr that fixed
the issue for me.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519


Bojan Smojver <bo...@rexursive.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |FIXED




--- Comment #9 from Bojan Smojver <bo...@rexursive.com>  2009-07-17 16:16:56 PST ---
Fixed in trunk, 1.4.x and 1.3.x.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519





--- Comment #2 from Tobias Klausmann <kl...@gentoo.org>  2009-07-13 09:40:31 PST ---
That other bug says this should be fixed on the kernel side in 2.6.28.4.
Wouldn't that indicate that it shouldn't happen with the kernel I used, either?
Please clarify.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519





--- Comment #6 from Tobias Klausmann <kl...@gentoo.org>  2009-07-14 01:32:04 PST ---
(In reply to comment #5)
> (In reply to comment #0)
> > In strace, just before the SEGV happens, I see weird calls like this:
> > 
> > syscall_291(0x80000, 0x2, 0x17ae0b8, 0x7ffffe557600, 0x1d0, 0, 0x2, 0x2, 0x2,
> > 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2,
> > 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 <unfinished ...>
> 
> Does the strace show the return code or errno of this syscall? It works for me
> with the Debian 2.6.29 kernel and glibc 2.9 on i386:
> 
> SYS_329(0x80000, 0, 0xb7f134f8, 0, 0x99b98e8) = 18
> epoll_ctl(18, EPOLL_CTL_ADD, 10, {EPOLLIN, {u32=164579440, u64=164579440}}) = 0
> ...
> 
> (syscall 291 is epoll_create1 on x86_64, 329 is epoll_create1 on i386)

$ strace  /usr/sbin/apache2 -D DEFAULT_VHOST -D NAGIOS -D SSL -D
SSL_DEFAULT_VHOST -D PHP5 -d /usr/lib64/apache2 -f /etc/apache2/httpd.conf -X
[... lots of output ...]
write(2, "POOL DEBUG: [30349/13978117091923"..., 122) = 122
syscall_291(0x80000, 0x2, 0x26c0e50, 0x7fff5f0b6f20, 0x262b100, 0xe0, 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) = -1
(errno 38)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

I'll give the patch a shot in a moment.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519


Bojan Smojver <bo...@rexursive.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEEDINFO
                 CC|                            |bojan@rexursive.com




--- Comment #8 from Bojan Smojver <bo...@rexursive.com>  2009-07-15 18:46:22 PST ---
The fix for this (i.e. Chetan's patch), plus better detection of dup3 and
accept4 have been committed to trunk. Please test and if all is well, it will
be backported to 1.4.x and 1.3.x.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519


Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |




--- Comment #4 from Ruediger Pluem <rp...@apache.org>  2009-07-13 11:53:13 PST ---
(In reply to comment #2)
> That other bug says this should be fixed on the kernel side in 2.6.28.4.
> Wouldn't that indicate that it shouldn't happen with the kernel I used, either?
> Please clarify.

My fault I did not read your report completly. So yes, this should happen with
a newer kernel. Maybe it is the issue mentioned by Chetan Reddy.
Could you please test his patch?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519


Stefan Fritsch <sf...@sfritsch.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sf@sfritsch.de




--- Comment #5 from Stefan Fritsch <sf...@sfritsch.de>  2009-07-13 14:37:18 PST ---
(In reply to comment #0)
> In strace, just before the SEGV happens, I see weird calls like this:
> 
> syscall_291(0x80000, 0x2, 0x17ae0b8, 0x7ffffe557600, 0x1d0, 0, 0x2, 0x2, 0x2,
> 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2,
> 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 <unfinished ...>

Does the strace show the return code or errno of this syscall? It works for me
with the Debian 2.6.29 kernel and glibc 2.9 on i386:

SYS_329(0x80000, 0, 0xb7f134f8, 0, 0x99b98e8) = 18
epoll_ctl(18, EPOLL_CTL_ADD, 10, {EPOLLIN, {u32=164579440, u64=164579440}}) = 0
...

(syscall 291 is epoll_create1 on x86_64, 329 is epoll_create1 on i386)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Re: DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by Rainer Jung <ra...@kippdata.de>.
Hi RĂ¼diger,

On 13.07.2009 18:03, bugzilla@apache.org wrote:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=47519
> 
> 
> Ruediger Pluem <rp...@apache.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |RESOLVED
>          Resolution|                            |DUPLICATE
> 
> 
> 
> 
> --- Comment #1 from Ruediger Pluem <rp...@apache.org>  2009-07-13 09:03:24 PST ---
> 
> 
> *** This bug has been marked as a duplicate of bug 46467 ***

Did you notice his comment:

-------------------- 8>< -------------------------
At first I suspected this to be a dupe of bug 46467 since I ran
2.6.25.4, but an update to 2.6.29.5 didn't help. CONFIG_EPOLL is "y".

So I backdated from apr-1.3.6 to -1.3.5 and the problem went away.
-------------------- 8>< -------------------------

Regards,

Rainer

DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519


Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




--- Comment #1 from Ruediger Pluem <rp...@apache.org>  2009-07-13 09:03:24 PST ---


*** This bug has been marked as a duplicate of bug 46467 ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519


Chetan Reddy <ch...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chetanreddy@gmail.com




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47519] APR segfaults in apr_pollset_add()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47519





--- Comment #7 from Tobias Klausmann <kl...@gentoo.org>  2009-07-14 01:49:25 PST ---
That patch makes the wholething work. No more segfaults and Apache works as
expected.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org