Hello,

I just noticed that Apache 2.0.49 seems to segfault if you try to start
it with NO Listen directive.  Previously, in 2.0.48 for example, it
would error out nicely saying "no listening sockets available, shutting
down".  In either case, Apache doesn't start of course, but displaying
an error message and not generating a core file is obviously much nicer.

Here is some gdb output....

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 22599)]
0x08094993 in ap_listen_open (pool=0x80c9888, port=0) at listen.c:338
338         if (ap_listeners->next) {
(gdb) bt
#0  0x08094993 in ap_listen_open (pool=0x80c9888, port=0) at
listen.c:338
#1  0x08094a88 in ap_setup_listeners (s=0x80ce670) at listen.c:372
#2  0x08086528 in prefork_open_logs (p=0x80cb890, plog=0x8103970,
ptemp=0x8105978, s=0x80ce670) at prefork.c:1129
#3  0x08086fc5 in ap_run_open_logs (pconf=0x80cb890, plog=0x8103970,
ptemp=0x8105978, s=0x80ce670) at config.c:142
#4  0x0808cd6c in main (argc=1, argv=0xbffff444) at main.c:558
#5  0x42017589 in __libc_start_main () from /lib/i686/libc.so.6

Here's the supper simple diff that seems to fix this:

338c338
<     if (ap_listeners->next) {
---
>     if ((ap_listeners) && (ap_listeners->next)) {


...the problem is just that "ap_listeners" is being dereference, but it
is in fact NULL.

Thanks,
Michael Corcoran.

Reply via email to