| OLD | NEW |
| (Empty) |
| 1 Index file: | |
| 2 version: 2.1 | |
| 3 entries: 3 | |
| 4 current id: 1 | |
| 5 last crash: 1 | |
| 6 head 0: 0x90000002 | |
| 7 tail 0: 0x90000002 | |
| 8 size 0: 0x1 | |
| 9 head 1: 0x90000001 <---- | |
| 10 tail 1: 0x90000000 | |
| 11 size 1: 0x2 | |
| 12 transaction: 0x0 | |
| 13 ------------------------- | |
| 14 | |
| 15 Entry at 0xa0010002 | |
| 16 hash: 0x687d1422 | |
| 17 next entry: 0x0 | |
| 18 rankings: 0x90000000 | |
| 19 key length: 13 | |
| 20 key: "the first key" | |
| 21 key addr: 0x0 | |
| 22 reuse count: 1 | |
| 23 ---------- | |
| 24 | |
| 25 Rankings at 0x90000000 | |
| 26 next: 0x90000000 | |
| 27 prev: 0x90000001 | |
| 28 entry: 0xa0010002 | |
| 29 dirty: 0 | |
| 30 ---------- | |
| 31 | |
| 32 Entry at 0xa0010003 | |
| 33 hash: 0x4a70620e | |
| 34 next entry: 0x0 | |
| 35 rankings: 0x90000001 | |
| 36 key length: 14 | |
| 37 key: "the second key" | |
| 38 key addr: 0x0 | |
| 39 reuse count: 0 <---- list 0 | |
| 40 ---------- | |
| 41 | |
| 42 Rankings at 0x90000001 | |
| 43 next: 0x90000000 | |
| 44 prev: 0x90000001 <----- head | |
| 45 entry: 0xa0010003 | |
| 46 dirty: 1 <----- This was actually inserted on list 1 | |
| 47 ---------- | |
| 48 | |
| 49 Entry at 0xa0010004 | |
| 50 hash: 0x63909ecb | |
| 51 next entry: 0x0 | |
| 52 rankings: 0x90000002 | |
| 53 key length: 14 | |
| 54 key: "some other key" | |
| 55 key addr: 0x0 | |
| 56 reuse count: 0 | |
| 57 ---------- | |
| 58 | |
| 59 Rankings at 0x90000002 | |
| 60 next: 0x90000002 | |
| 61 prev: 0x90000002 | |
| 62 entry: 0xa0010004 | |
| 63 dirty: 0 | |
| 64 ---------- | |
| 65 | |
| 66 ================================ | |
| 67 | |
| 68 Generated with: | |
| 69 | |
| 70 SetNewEviction(); | |
| 71 SetMaxSize(20 * 1024 * 1024); | |
| 72 InitCache(); | |
| 73 const char* kName1 = "the first key"; | |
| 74 const char* kName2 = "the second key"; | |
| 75 disk_cache::Entry* entry; | |
| 76 ASSERT_EQ(net::OK, CreateEntry(kName1, &entry)); | |
| 77 entry->Close(); | |
| 78 ASSERT_EQ(net::OK, CreateEntry(kName2, &entry)); | |
| 79 entry->Close(); | |
| 80 ASSERT_EQ(net::OK, CreateEntry("some other key", &entry)); | |
| 81 entry->Close(); | |
| 82 | |
| 83 ASSERT_EQ(net::OK, OpenEntry(kName1, &entry)); | |
| 84 entry->Close(); | |
| 85 | |
| 86 ASSERT_EQ(net::OK, OpenEntry(kName2, &entry)); | |
| 87 | |
| 88 Set a breakpoint on that last line, and when the entry is moved from one list to
another, crash the process: | |
| 89 | |
| 90 rankings_->Remove(entry->rankings(), Rankings::NO_USE); | |
| 91 rankings_->Insert(entry->rankings(), false, Rankings::LOW_USE); | |
| 92 entry->entry()->Store(); <---- crash
here | |
| OLD | NEW |