errorpage.c

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Thu, 18 Apr 2002 12:33:26 +0300

 Seems that parseConfigFile is called before errorInitialize initialises
 internal errorpages, and squid fails on configured errorpage parsing.
 seems that got broken together with change from:
  Revision 1.18, Wed Apr 3 08:55:03 2002 UTC (2 weeks, 1 day ago) by squidadm
  Revision 1.15.4.3.2.1, Mon Apr 1 23:15:39 2002 UTC (2 weeks, 2 days ago) by hno

 Henrik, you lately looked into deny_info_url stuff, you probably know
 best how to handle this.

(gdb) info bre
Num Type Disp Enb Address What
1 breakpoint keep y 0x0806d7c3 in errorInitialize at errorpage.c:108
(gdb) run
Starting program: /usr/local/squid/dev/cvs/HEAD/src/./squid -f /usr/local/squid/etc/ads.conf -z

Program received signal SIGSEGV, Segmentation fault.
0xdfb7cf2c in strcmp () from /usr/lib/libc.so.1
(gdb) bt
#0 0xdfb7cf2c in strcmp () from /usr/lib/libc.so.1
#1 0x806dc76 in errorPageId (page_name=0x82faaba "privatedenied.err") at errorpage.c:224
#2 0x806dcc0 in errorReservePageId (page_name=0x82faaba "privatedenied.err") at errorpage.c:234
#3 0x804d50f in aclParseDenyInfoLine (head=0x82b42e8) at acl.c:948
#4 0x8059d1d in parse_line (buff=0x82faab0 "deny_info") at cf_parser.h:619
#5 0x8053b09 in parseConfigFile (file_name=0x82b4b08 "/usr/local/squid/etc/ads.conf") at cache_cf.c:298
#6 0x808b404 in main (argc=4, argv=0x80478ec) at main.c:638
(gdb) l
219 for (i = 0; i < ERR_MAX; i++) {
220 if (strcmp(err_type_str[i], page_name) == 0)
221 return i;
222 }
223 for (i = 0; i < ErrorDynamicPages.count; i++) {
224 if (strcmp(((ErrorDynamicPageInfo *) ErrorDynamicPages.items[i - ERR_MAX])->page_name, page_name) == 0)
225 return i + ERR_MAX;
226 }
227 return ERR_NONE;
228 }

(gdb) p ErrorDynamicPages
$16 = {capacity = 16, count = 1, items = 0x82feb08}

(gdb) p /d ERR_MAX
$18 = 32
(gdb) p i
$21 = 0

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Microlink Online
 Tel: 6501 731, Fax: 6501 725
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Thu Apr 18 2002 - 03:40:47 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:12 MST