Bug 53265 - segfault when call ap_log_rerror
Summary: segfault when call ap_log_rerror
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.4.1
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-18 19:39 UTC by hy93
Modified: 2012-05-18 19:47 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hy93 2012-05-18 19:39:57 UTC
We had an Apache module we wrote which works fine in Apache 2.2.*. But it generated segfault when loaded in Apache 2.4.1. After some debugging, We found the segfault was caused by calling ap_log_rerror. In Apache server/log.c, in function do_errorlog_default,  it tried to access info->r->useragent_addr->port which generated segfault. Here is our code:

static void cuwa_register_hooks(apr_pool_t *p)
{
...

ap_hook_create_request(cuwa_create_request, NULL, NULL, APR_HOOK_MIDDLE);

...

}
static int cuwa_create_request(request_rec *r)
{
    ....
    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,"message");

    if (!r->main && !r->prev)
    {
        ap_add_input_filter_handle(cuwa_filter_handle, NULL, r, r->connection);
    }

    return OK;
}
Comment 1 Eric Covener 2012-05-18 19:46:03 UTC
http://svn.apache.org/viewvc?view=revision&revision=1334344

Will be released in 2.4.3

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