[patch] wierd swap path corruption

From: Pawel Worach <pawel.worach@dont-contact.us>
Date: Sat, 06 Sep 2003 20:57:22 +0200

Looks like the swap path gets trashed along the way,
this was triggered by squid -z with debug level above 0.

    - Pawel

WorksForMe(tm) fix, move parseSizeL1L2() after aPath has been duped
to path:
Index: fs/ufs/store_dir_ufs.cc
===================================================================
RCS file: /squid/squid3/src/fs/ufs/store_dir_ufs.cc,v
retrieving revision 1.63
diff -u -r1.63 store_dir_ufs.cc
--- fs/ufs/store_dir_ufs.cc 10 Aug 2003 07:43:42 -0000 1.63
+++ fs/ufs/store_dir_ufs.cc 6 Sep 2003 18:51:54 -0000
@@ -117,11 +117,10 @@
 void
 UFSSwapDir::parse (int anIndex, char *aPath)
 {
- parseSizeL1L2();
-
     index = anIndex;
-
     path = xstrdup(aPath);
+
+ parseSizeL1L2();
 
     /* Initialise replacement policy stuff */
     repl = createRemovalPolicy(Config.replPolicy);

stacktrace:
Program received signal SIGBUS, Bus error.
0x282be4c1 in __vfprintf () from /lib/libc.so.5
(gdb) bt
#0 0x282be4c1 in __vfprintf () from /lib/libc.so.5
#1 0x282bcb5f in strchr () from /lib/libc.so.5
#2 0x282bd233 in __vfprintf () from /lib/libc.so.5
#3 0x282bd166 in vfprintf () from /lib/libc.so.5
#4 0x0807ca5f in _db_print_file (format=0x8139c00 "2003/09/06 20:39:01|
Cache dir '%s' size changed to %d KB\n", args=0x282d9104 "@`\f")
    at debug.cc:127
#5 0x0807ca0c in _db_print (format=0x80f6fc0 "Cache dir '%s' size
changed to %d KB\n") at debug.cc:97
#6 0x080c44fe in UFSSwapDir::parseSizeL1L2() (this=0x80f6fc0) at
ufs/store_dir_ufs.cc:83
#7 0x080c45c4 in UFSSwapDir::parse(int, char*) (this=0x8252000,
anIndex=0, aPath=0x282d8fb0 "ó\217-(") at ufs/store_dir_ufs.cc:120
#8 0x0805d56f in parse_cachedir (swap=0x8221f40) at cache_cf.cc:1406
#9 0x080612eb in parse_line (buff=0x823224a "ufs") at cf_parser.h:591
#10 0x0805bb22 in parseConfigFile (file_name=0x8230160
"/opt/squid/etc/squid.conf") at cache_cf.cc:373
#11 0x080a1fc5 in main (argc=2, argv=0xbfbffb3c) at main.cc:992
#12 0x0804b122 in _start ()
Received on Sat Sep 06 2003 - 12:57:30 MDT

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