summaryrefslogtreecommitdiff
path: root/chromium/net/data/cache_tests/bad_rankings3/contents.txt
blob: d85287b555d583aa53d57412d1debcf324fc057b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Index file:
version: 2.1
entries: 3
current id: 1
last crash: 1
head 0: 0x90000002
tail 0: 0x90000002
size 0: 0x1
head 1: 0x90000001             <----
tail 1: 0x90000000
size 1: 0x2
transaction: 0x0
-------------------------

Entry at 0xa0010002
hash: 0x687d1422
next entry: 0x0
rankings: 0x90000000
key length: 13
key: "the first key"
key addr: 0x0
reuse count: 1
----------

Rankings at 0x90000000
next: 0x90000000
prev: 0x90000001
entry: 0xa0010002
dirty: 0
----------

Entry at 0xa0010003
hash: 0x4a70620e
next entry: 0x0
rankings: 0x90000001
key length: 14
key: "the second key"
key addr: 0x0
reuse count: 0                 <---- list 0
----------

Rankings at 0x90000001
next: 0x90000000
prev: 0x90000001               <----- head
entry: 0xa0010003
dirty: 1                       <----- This was actually inserted on list 1
----------

Entry at 0xa0010004
hash: 0x63909ecb
next entry: 0x0
rankings: 0x90000002
key length: 14
key: "some other key"
key addr: 0x0
reuse count: 0
----------

Rankings at 0x90000002
next: 0x90000002
prev: 0x90000002
entry: 0xa0010004
dirty: 0
----------

================================

Generated with:

  SetNewEviction();
  SetMaxSize(20 * 1024 * 1024);
  InitCache();
  const char* kName1 = "the first key";
  const char* kName2 = "the second key";
  disk_cache::Entry* entry;
  ASSERT_EQ(net::OK, CreateEntry(kName1, &entry));
  entry->Close();
  ASSERT_EQ(net::OK, CreateEntry(kName2, &entry));
  entry->Close();
  ASSERT_EQ(net::OK, CreateEntry("some other key", &entry));
  entry->Close();

  ASSERT_EQ(net::OK, OpenEntry(kName1, &entry));
  entry->Close();

  ASSERT_EQ(net::OK, OpenEntry(kName2, &entry));

Set a breakpoint on that last line, and when the entry is moved from one list to another, crash the process:

  rankings_->Remove(entry->rankings(), Rankings::NO_USE);
  rankings_->Insert(entry->rankings(), false, Rankings::LOW_USE);
  entry->entry()->Store();                                           <---- crash here