1 Index file: 2 magic: c103cac3 3 version: 2.0 4 entries: 2 <---- there is an extra entry on the lru. 5 total bytes: 47 6 last file number: 0 7 current id: 3 8 table length: 65536 9 last crash: 1 10 experiment: 0 11 head 0: 0x90000000 12 tail 0: 0x90000001 13 size 0: 0x0 14 head 1: 0x0 15 tail 1: 0x0 16 size 1: 0x0 17 head 2: 0x0 18 tail 2: 0x0 19 size 2: 0x0 20 head 3: 0x0 21 tail 3: 0x0 22 size 3: 0x0 23 head 4: 0x0 24 tail 4: 0x0 25 size 4: 0x0 26 transaction: 0x0 27 operation: 0 28 operation list: 0 29 ------------------------- 30 31 Block file: data_0 32 magic: c104cac3 33 version: 2.0 34 file id: 0 35 next file id: 0 36 entry size: 36 37 current entries: 2 38 max entries: 1024 39 updating: 0 40 empty sz 1: 0 41 empty sz 2: 1 42 empty sz 3: 0 43 empty sz 4: 255 44 user 0: 0x0 45 user 1: 0x0 46 user 2: 0x0 47 user 3: 0x0 48 ------------------------- 49 50 Block file: data_1 51 magic: c104cac3 52 version: 2.0 53 file id: 1 54 next file id: 0 55 entry size: 256 56 current entries: 4 57 max entries: 1024 58 updating: 0 59 empty sz 1: 0 60 empty sz 2: 1 61 empty sz 3: 0 62 empty sz 4: 254 63 user 0: 0x0 64 user 1: 0x0 65 user 2: 0x0 66 user 3: 0x0 67 ------------------------- 68 69 Block file: data_2 70 magic: c104cac3 71 version: 2.0 72 file id: 2 73 next file id: 0 74 entry size: 1024 75 current entries: 0 76 max entries: 0 77 updating: 0 78 empty sz 1: 0 79 empty sz 2: 0 80 empty sz 3: 0 81 empty sz 4: 0 82 user 0: 0x0 83 user 1: 0x0 84 user 2: 0x0 85 user 3: 0x0 86 ------------------------- 87 88 Block file: data_3 89 magic: c104cac3 90 version: 2.0 91 file id: 3 92 next file id: 0 93 entry size: 4096 94 current entries: 0 95 max entries: 0 96 updating: 0 97 empty sz 1: 0 98 empty sz 2: 0 99 empty sz 3: 0 100 empty sz 4: 0 101 user 0: 0x0 102 user 1: 0x0 103 user 2: 0x0 104 user 3: 0x0 105 ------------------------- 106 107 Entry at 0xa0010002 108 hash: 0xc24ac438 109 next entry: 0x0 110 rankings: 0x90000000 111 key length: 13 112 key: "The first key" 113 key addr: 0x0 114 reuse count: 0 115 refetch count: 0 116 state: 0 117 data size 0: 20 118 data addr 0: 0xa0010005 119 data size 1: 0 120 data addr 1: 0x0 121 data size 2: 0 122 data addr 2: 0x0 123 data size 3: 0 124 data addr 3: 0x0 125 ---------- 126 127 Rankings at 0x90000000 128 next: 0x90000001 129 prev: 0x90000000 130 entry: 0xa0010002 131 dirty: 0 132 pointer: 0x0 133 134 ================================ 135 136 Generated with: (see steps on the bug 69135) 137 138 SetMask(0x1); // 2-entry table. 139 SetMaxSize(0x3000); // 12 kB. 140 InitCache(); 141 142 std::string key1("The first key"); 143 std::string key2("The Second key"); 144 std::string key3("The third key"); 145 disk_cache::Entry* entry; 146 147 ASSERT_EQ(net::OK, CreateEntry(key1, &entry)); 148 entry->Close(); 149 ASSERT_EQ(net::OK, CreateEntry(key2, &entry)); 150 entry->Close(); 151 ASSERT_EQ(net::OK, CreateEntry(key3, &entry)); 152 entry->Close(); 153 154 const int kSize = 20; 155 ASSERT_EQ(net::OK, OpenEntry(key1, &entry)); 156 scoped_refptr<net::IOBuffer> buf = new net::IOBuffer(kSize); 157 memset(buf->data(), 0, kSize); 158 EXPECT_EQ(kSize, WriteData(entry, 0, 0, buf, kSize, false)); 159 entry->Close(); 160 161 ASSERT_EQ(net::OK, OpenEntry(key2, &entry)); <--- 1st crash. 162 ASSERT_NE(net::OK, OpenEntry(key2, &entry)); <--- 2nd crash. * 163 164 ASSERT_EQ(net::OK, DoomEntry(key3)); 165 166 (*) and trick the code into deleting the dirty flag.