Page 11 of 11

Re: Apache segmentation fault

Posted: Tue Mar 10, 2009 5:53 pm
by mikeshinn
Keep in mind that its not the rules that cause segfaults. A segfault means a memory error in apache - something on your box is causing a memory error in apache. Loading a huge set of rules will cause this to show up sooner, but the rules do not cause this. If you are seeing segfaults something else is going on with the box and it does require attention.

I realize the satisfaction of solving the immediate problem by putting less memory load on apache, but if you are getting segfaults you really need to track down exactly whats causing it. So far we've seen caching modules do this, accelerators, even PHP. In one case, we found a buggy PHP app that would kill a server in 30 minutes flat - with or without modsecurity running.

Re: Apache segmentation fault

Posted: Wed Mar 11, 2009 1:38 pm
by sebas
Any idea on how to identify what is causing the segfaults?

Re: Apache segmentation fault

Posted: Wed Mar 11, 2009 5:36 pm
by mikeshinn
One good tool is mod_whatkilledus:

http://people.apache.org/~trawick

Re: Apache segmentation fault

Posted: Fri Mar 13, 2009 12:10 pm
by hostingguy
I tried that and it didnt compile for me.

I have httpd-2.2.3-13.el5.art

Code: Select all


# wget http://people.apache.org/~trawick/test_char.h
# wget http://people.apache.org/~trawick/mod_whatkilledus.c

# apxs -ci mod_whatkilledus.c
/usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1   -c -o mod_whatkilledus.lo mod_whatkilledus.c && touch mod_whatkilledus.slo
mod_whatkilledus.c:70:2: error: #error Apache must be built with --enable-exception-hook
mod_whatkilledus.c:191: error: expected ')' before '*' token
mod_whatkilledus.c: In function 'wku_register_hooks':
mod_whatkilledus.c:419: warning: implicit declaration of function 'ap_hook_fatal_exception'
mod_whatkilledus.c:419: error: 'wku_fatal_exception' undeclared (first use in this function)
mod_whatkilledus.c:419: error: (Each undeclared identifier is reported only once
mod_whatkilledus.c:419: error: for each function it appears in.)
apxs:Error: Command failed with rc=65536
Did anyone get it to work using the art httpd package ?

Re: Apache segmentation fault

Posted: Fri Mar 13, 2009 12:25 pm
by faris
I imagine it is the ...

Code: Select all

#error Apache must be built with --enable-exception-hook
...that's the killer problem, if you'll forgive the pun.

Faris.

Re: Apache segmentation fault

Posted: Tue Mar 17, 2009 8:22 pm
by sebas
Ok I have mod_whatkilledus in place lets see what it catches.

Thanks.