You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Magnus M��tt� <n0...@kiruna.se> on 2002/11/11 22:59:11 UTC

Segfault

Hi!

I have no idea if this problem is Apache2 related or PHP related.
Running current CVS of both.

I have no single script to reproduce this, but i have the same
problem with older versions of PHP too, haven't tried with older apache
version thou.

And I don't know if this is the correct way to debug apache, but here's
the output from gdb.


Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 65541 (LWP 3069)]
0x403756d8 in writev () from /lib/libc.so.6
(gdb) bt
#0  0x403756d8 in writev () from /lib/libc.so.6
#1  0x401f5b98 in apr_sendv (sock=0x413818e0, vec=0xbf1ff604, nvec=1, len=0xbf1ff4d0) at sendrecv.c:235
#2  0x080bfa5a in writev_it_all (s=0x413818e0, vec=0xbf1ff604, nvec=1, len=49, nbytes=0xbf1ff55c) at core.c:2695
#3  0x080c0f79 in core_output_filter (f=0x83af890, b=0x83bc790) at core.c:3957
#4  0x080b9de9 in ap_pass_brigade (next=0x83af890, bb=0x83bc790) at util_filter.c:540
#5  0x080744cc in BIO_bucket_flush (bio=0x83b8e50) at ssl_engine_io.c:134
#6  0x08074b81 in ssl_io_filter_Output (f=0x41381dd8, bb=0x8492c40) at ssl_engine_io.c:602
#7  0x080b9de9 in ap_pass_brigade (next=0x41381dd8, bb=0x8492c40) at util_filter.c:540
#8  0x08081d40 in chunk_filter (f=0x83c3038, b=0x8492c40) at http_core.c:260
#9  0x080b9de9 in ap_pass_brigade (next=0x83c3038, bb=0x8492c40) at util_filter.c:540
#10 0x080bbeef in ap_content_length_filter (f=0x842ac48, b=0x8492c40) at protocol.c:1299
#11 0x080b9de9 in ap_pass_brigade (next=0x842ac48, bb=0x8492c40) at util_filter.c:540
#12 0x4058a592 in php_output_filter (f=0x84914f0, bb=0x8492c40) at /mnt/data1/Apps/CVS/PHP/php4/sapi/apache2filter/sapi_apache2.c:483
#13 0x080b9de9 in ap_pass_brigade (next=0x84914f0, bb=0x8491630) at util_filter.c:540
#14 0x080c02f9 in default_handler (r=0x8429fa0) at core.c:3377
#15 0x080af319 in ap_run_handler (r=0x8429fa0) at config.c:194
#16 0x080af863 in ap_invoke_handler (r=0x8429fa0) at config.c:401
#17 0x08085cf6 in ap_process_request (r=0x8429fa0) at http_request.c:288
#18 0x08081dda in ap_process_http_connection (c=0x413819b8) at http_core.c:293
#19 0x080b8188 in ap_run_process_connection (c=0x413819b8) at connection.c:85
#20 0x080b841f in ap_process_connection (c=0x413819b8, csd=0x413818e0) at connection.c:207
#21 0x080ac5ab in process_socket (p=0x413818a8, sock=0x413818e0, my_child_num=0, my_thread_num=2, bucket_alloc=0x82d8200) at worker.c:632
#22 0x080acbb7 in worker_thread (thd=0x8166c40, dummy=0x82d1b78) at worker.c:947
#23 0x401f885e in dummy_worker (opaque=0x8166c40) at thread.c:127
#24 0x4026d048 in pthread_start_thread () from /lib/libpthread.so.0
#25 0x4026d08e in pthread_start_thread_event () from /lib/libpthread.so.0
(gdb) s
Single stepping until exit from function writev,
which has no line number information.
apr_sendv (sock=0x413818e0, vec=0xbf1ff604, nvec=1, len=0xbf1ff4d0) at sendrecv.c:236
warning: Source file is more recent than executable.

236         } while (rv == -1 && errno == EINTR);
(gdb) p rv
$1 = -1
(gdb) p errno
$2 = 4
(gdb) p EINTR
No symbol "EINTR" in current context.


And a full bt:

#0  apr_sendv (sock=0x413818e0, vec=0xbf1ff604, nvec=1, len=0xbf1ff4d0) at sendrecv.c:236
        sock = (apr_socket_t *) 0x413818e0
        rv = -1
        requested_len = 49
        i = -1
#1  0x080bfa5a in writev_it_all (s=0x413818e0, vec=0xbf1ff604, nvec=1, len=49, nbytes=0xbf1ff55c) at core.c:2695
        bytes_written = 0
        rv = -1
        n = 49
        i = 0
#2  0x080c0f79 in core_output_filter (f=0x83af890, b=0x83bc790) at core.c:3957
        nbytes = 49
        nvec_trailers = 0
        vec = {{iov_base = 0x83ba788, iov_len = 49}, {iov_base = 0x40049df8, iov_len = 1094196672}, {iov_base = 0x5, iov_len = 3206542980}, {
    iov_base = 0x5a5a5a5a, iov_len = 1515870810}, {iov_base = 0x5a5a5a5a, iov_len = 1073981917}, {iov_base = 0x840bec0, iov_len = 135089852}, {
    iov_base = 0x5, iov_len = 1073981797}, {iov_base = 0x840bec0, iov_len = 1515870810}, {iov_base = 0x5a5a5a5a, iov_len = 1074182768}, {
    iov_base = 0x82d20d8, iov_len = 0}, {iov_base = 0x5a5a5a5a, iov_len = 1074824154}, {iov_base = 0x40116548, iov_len = 137200128}, {
    iov_base = 0x8492c40, iov_len = 1515870810}, {iov_base = 0x40108901, iov_len = 1074881864}, {iov_base = 0xbf1ff6a4, iov_len = 1074825585}, {
    iov_base = 0x82d83b0, iov_len = 137200128}}
        flen = 0
        last_e = (apr_bucket *) 0x82d83b0
        e = (apr_bucket *) 0x82d83b0
        nvec = 1
        fd = (apr_file_t *) 0x0
        last_merged_bucket = (apr_bucket *) 0x0
        more = (apr_bucket_brigade *) 0x83afce0
        vec_trailers = {{iov_base = 0x80d4ebc, iov_len = 5}, {iov_base = 0x40049df8, iov_len = 5}, {iov_base = 0x0, iov_len = 138460864}, {
    iov_base = 0x83c00fc, iov_len = 0}, {iov_base = 0x10, iov_len = 138217555}, {iov_base = 0x5a5a5a5a, iov_len = 1515870810}, {iov_base = 0x5a5a5a5a,
    iov_len = 1073956605}, {iov_base = 0x840bec0, iov_len = 23}, {iov_base = 0x80d4ebc, iov_len = 5}, {iov_base = 0x0, iov_len = 1515870810}, {
    iov_base = 0x5a5a5a5a, iov_len = 1073956428}, {iov_base = 0x40049df8, iov_len = 138460864}, {iov_base = 0x5, iov_len = 135089852}, {
    iov_base = 0x5a5a5a5a, iov_len = 1515870810}, {iov_base = 0x5a5a5a5a, iov_len = 1073946282}, {iov_base = 0x840bec0, iov_len = 23}}
        foffset = 0
        rv = 49
        c = (conn_rec *) 0x413819b8
        net = (core_net_rec *) 0x83af868
        ctx = (core_output_filter_ctx_t *) 0x83af910
#3  0x080b9de9 in ap_pass_brigade (next=0x83af890, bb=0x83bc790) at util_filter.c:540
        e = (apr_bucket *) 0xffffffff
        next = (ap_filter_t *) 0xbf1ff444
        bb = (apr_bucket_brigade *) 0xbf1ff604
#4  0x080744cc in BIO_bucket_flush (bio=0x83b8e50) at ssl_engine_io.c:134
        bio = (BIO *) 0xffffffff
        b = (BIO_bucket_t *) 0x83ba778
        e = (apr_bucket *) 0xbf1ff444
#5  0x08074b81 in ssl_io_filter_Output (f=0x41381dd8, bb=0x8492c40) at ssl_engine_io.c:602
        bb = (apr_bucket_brigade *) 0x8492c40
        status = 0
        ctx = (SSLFilterRec *) 0x41381dc0
#6  0x080b9de9 in ap_pass_brigade (next=0x41381dd8, bb=0x8492c40) at util_filter.c:540
        e = (apr_bucket *) 0xffffffff
        next = (ap_filter_t *) 0xbf1ff444
        bb = (apr_bucket_brigade *) 0xbf1ff604
#7  0x08081d40 in chunk_filter (f=0x83c3038, b=0x8492c40) at http_core.c:260
        bytes = 0
        eos = (apr_bucket *) 0x82d8360
        flush = (apr_bucket *) 0x0
        chunk_hdr = "ZZZZZZZZÐW<@8\237B\bÀW<@"
        b = (apr_bucket_brigade *) 0x8492c40
        c = (conn_rec *) 0x413819b8
        more = (apr_bucket_brigade *) 0x0
        e = (apr_bucket *) 0x82d82c0
        rv = -1
#8  0x080b9de9 in ap_pass_brigade (next=0x83c3038, bb=0x8492c40) at util_filter.c:540
        e = (apr_bucket *) 0xffffffff
        next = (ap_filter_t *) 0xbf1ff444
        bb = (apr_bucket_brigade *) 0xbf1ff604
#9  0x080bbeef in ap_content_length_filter (f=0x842ac48, b=0x8492c40) at protocol.c:1299
        b = (apr_bucket_brigade *) 0x8492c40
        r = (request_rec *) 0x8429fa0
        ctx = (struct content_length_ctx *) 0x83c2e80
        e = (apr_bucket *) 0x82d8360
        eos = 1
        eblock = APR_NONBLOCK_READ
#10 0x080b9de9 in ap_pass_brigade (next=0x842ac48, bb=0x8492c40) at util_filter.c:540
        e = (apr_bucket *) 0xffffffff
        next = (ap_filter_t *) 0xbf1ff444
        bb = (apr_bucket_brigade *) 0xbf1ff604
#11 0x4058a592 in php_output_filter (f=0x84914f0, bb=0x8492c40) at /mnt/data1/Apps/CVS/PHP/php4/sapi/apache2filter/sapi_apache2.c:483
        ctx = (php_struct *) 0x842b7e8
        b = (apr_bucket *) 0x82d82c0
        conf = (void *) 0x814e8a0
        p = 0x815bdd0 "¸½\025\b"
        tsrm_ls = (void ***) 0x83c05a0
#12 0x080b9de9 in ap_pass_brigade (next=0x84914f0, bb=0x8491630) at util_filter.c:540
        e = (apr_bucket *) 0xffffffff
        next = (ap_filter_t *) 0xbf1ff444
        bb = (apr_bucket_brigade *) 0xbf1ff604
#13 0x080c02f9 in default_handler (r=0x8429fa0) at core.c:3377
        c = (conn_rec *) 0x413819b8
        bb = (apr_bucket_brigade *) 0x8491630
        e = (apr_bucket *) 0x82d8360
        d = (core_dir_config *) 0x842bdc0
        errstatus = 139007540
        fd = (apr_file_t *) 0x8491558
        status = -1
        bld_content_md5 = 137200480
#14 0x080af319 in ap_run_handler (r=0x8429fa0) at config.c:194
        r = (request_rec *) 0x8429fa0
        pHook = (ap_LINK_handler_t *) 0xffffffff
        n = 11
        rv = -1
#15 0x080af863 in ap_invoke_handler (r=0x8429fa0) at config.c:401
        r = (request_rec *) 0x8429fa0
        handler = 0x815bdb8 "application/x-httpd-php"
        p = 0xffffffff <Address 0xffffffff out of bounds>
        result = 0
        old_handler = 0x0
#16 0x08085cf6 in ap_process_request (r=0x8429fa0) at http_request.c:288
        r = (request_rec *) 0x8429fa0
        access_status = -1
#17 0x08081dda in ap_process_http_connection (c=0x413819b8) at http_core.c:293
        c = (conn_rec *) 0x413819b8
        r = (request_rec *) 0x8429fa0
        csd_set = 1
        csd = (apr_socket_t *) 0x413818e0
#18 0x080b8188 in ap_run_process_connection (c=0x413819b8) at connection.c:85
        c = (conn_rec *) 0x413819b8
        pHook = (ap_LINK_process_connection_t *) 0xffffffff
        n = 0
        rv = -1
#19 0x080b841f in ap_process_connection (c=0x413819b8, csd=0x413818e0) at connection.c:207
        c = (conn_rec *) 0x413819b8
        csd = (void *) 0x413818e0
#20 0x080ac5ab in process_socket (p=0x413818a8, sock=0x413818e0, my_child_num=0, my_thread_num=2, bucket_alloc=0x82d8200) at worker.c:632
        p = (apr_pool_t *) 0x413818a8
        sock = (apr_socket_t *) 0x413818e0
        my_child_num = -1088424444
        my_thread_num = -1088424892
        current_conn = (conn_rec *) 0x413819b8
        conn_id = 1094195640
        csd = 16
        sbh = (ap_sb_handle_t *) 0x413819b0
#21 0x080acbb7 in worker_thread (thd=0x8166c40, dummy=0x82d1b78) at worker.c:947
        dummy = (void *) 0xffffffff
        process_slot = 0
        thread_slot = 2
        csd = (apr_socket_t *) 0x413818e0
        bucket_alloc = (apr_bucket_alloc_t *) 0x82d8200
        last_ptrans = (apr_pool_t *) 0x0
        ptrans = (apr_pool_t *) 0x413818a8
        rv = -1
        is_idle = 0
#22 0x401f885e in dummy_worker (opaque=0x8166c40) at thread.c:127
        opaque = (void *) 0xffffffff
#23 0x4026d048 in pthread_start_thread () from /lib/libpthread.so.0
No symbol table info available.
#24 0x4026d08e in pthread_start_thread_event () from /lib/libpthread.so.0
No symbol table info available.


Regards
Magnus Määttä


Re: Segfault

Posted by Magnus M��tt� <n0...@kiruna.se>.
Hi again!

Thanks for the help with gdb. I'm justa newbie on debugging
stuff. After the cont it seems to be a PHP problem anyway.


Regards
Magnus Määttä

On 12 Nov 2002 16:05:27 -0500
Jeff Trawick <tr...@attglobal.net> wrote:

> Magnus Määttä <n0...@kiruna.se> writes:
> 
> > Hi!
> > 
> > I have no idea if this problem is Apache2 related or PHP related.
> > Running current CVS of both.
> > 
> > I have no single script to reproduce this, but i have the same
> > problem with older versions of PHP too, haven't tried with older apache
> > version thou.
> > 
> > And I don't know if this is the correct way to debug apache, but here's
> > the output from gdb.
> > 
> > 
> > Program received signal SIGPIPE, Broken pipe.
> 
> Where is the segfault?
> 
> "Program received signal SIGPIPE" is working as designed.  When you
> hit that in gdb, do "cont" and maybe the segfault is hit after that.
> 
> If the Apache process exits when SIGPIPE is received, then some evil
> code somewhere has reset the required SIGPIPE handling (SIG_IGN).
> 
> -- 
> Jeff Trawick | trawick@attglobal.net
> Born in Roswell... married an alien...
> 

Re: Segfault

Posted by Jeff Trawick <tr...@attglobal.net>.
Magnus Määttä <n0...@kiruna.se> writes:

> Hi!
> 
> I have no idea if this problem is Apache2 related or PHP related.
> Running current CVS of both.
> 
> I have no single script to reproduce this, but i have the same
> problem with older versions of PHP too, haven't tried with older apache
> version thou.
> 
> And I don't know if this is the correct way to debug apache, but here's
> the output from gdb.
> 
> 
> Program received signal SIGPIPE, Broken pipe.

Where is the segfault?

"Program received signal SIGPIPE" is working as designed.  When you
hit that in gdb, do "cont" and maybe the segfault is hit after that.

If the Apache process exits when SIGPIPE is received, then some evil
code somewhere has reset the required SIGPIPE handling (SIG_IGN).

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...