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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
graphic: 0.951
assembly: 0.943
instruction: 0.941
device: 0.932
boot: 0.929
semantic: 0.927
KVM: 0.897
socket: 0.896
mistranslation: 0.885
other: 0.883
vnc: 0.873
network: 0.848
qemu-img: crash on check of an image with large value in the 'size' header field
The qemu-img crashes on the next command:
qemu-img check test_image
'test_image' can be found in the attachment. It's a fuzzed test image with the qcow2 image header only. Suppositional cause of the failure is the value of 'size' header field set to maximum uint_64 value.
System information:
qemu.git: 6baa963f4dcc2118
Host: Linux 3.14.7-200.fc20.x86_64 #1 SMP Wed Jun 11 22:38:05 UTC 2014 x86_64 GNU/Linux
The bug description missed qemu-img error:
(process:12283): GLib-ERROR **: gmem.c:110: failed to allocate 18446744059294601304 bytes
On Thu, Jun 19, 2014 at 07:19:55PM -0000, Maria Kustova wrote:
> The bug description missed qemu-img error:
>
> (process:12283): GLib-ERROR **: gmem.c:110: failed to allocate
> 18446744059294601304 bytes
Thanks, there has been recent work by Kevin Wolf to handle memory
allocation failures gracefully without terminating QEMU. This sounds
like a candidate for g_try_malloc() and friends.
Does the following patch series solve the problem?
https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01275.html
Stefan
Am 24.06.2014 um 15:19 hat M.Kustova geschrieben:
> On Mon, Jun 23, 2014 at 12:02 PM, Stefan Hajnoczi <email address hidden> wrote:
> > On Thu, Jun 19, 2014 at 07:19:55PM -0000, Maria Kustova wrote:
> >> The bug description missed qemu-img error:
> >>
> >> (process:12283): GLib-ERROR **: gmem.c:110: failed to allocate
> >> 18446744059294601304 bytes
> >
> > Thanks, there has been recent work by Kevin Wolf to handle memory
> > allocation failures gracefully without terminating QEMU. This sounds
> > like a candidate for g_try_malloc() and friends.
> >
> > Does the following patch series solve the problem?
> > https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01275.html
>
> These patches are conflicting with current master. So I can't test
> them as they are.
>
> Do you have a developer repository or branch containing these patches,
> so I could test it on the pre-release base?
I'm just about to send a new version, I'll keep you CCed there.
Kevin
Am 25.06.2014 um 11:32 hat M.Kustova geschrieben:
> On Tue, Jun 24, 2014 at 7:36 PM, Kevin Wolf <email address hidden> wrote:
> > Am 24.06.2014 um 15:19 hat M.Kustova geschrieben:
> >> On Mon, Jun 23, 2014 at 12:02 PM, Stefan Hajnoczi <email address hidden> wrote:
> >> > On Thu, Jun 19, 2014 at 07:19:55PM -0000, Maria Kustova wrote:
> >> >> The bug description missed qemu-img error:
> >> >>
> >> >> (process:12283): GLib-ERROR **: gmem.c:110: failed to allocate
> >> >> 18446744059294601304 bytes
> >> >
> >> > Thanks, there has been recent work by Kevin Wolf to handle memory
> >> > allocation failures gracefully without terminating QEMU. This sounds
> >> > like a candidate for g_try_malloc() and friends.
> >> >
> >> > Does the following patch series solve the problem?
> >> > https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01275.html
> >>
> >> These patches are conflicting with current master. So I can't test
> >> them as they are.
> >>
> >> Do you have a developer repository or branch containing these patches,
> >> so I could test it on the pre-release base?
> >
> > I'm just about to send a new version, I'll keep you CCed there.
>
> "[PATCH v4 21/21] qcow2: Return useful error code in refcount_init()"
> is still broken for the current master.
In which way? I can cleanly apply the whole patch series on master (even
tried applying the emails from my inbox to be sure).
Kevin
Am 25.06.2014 um 11:54 hat M.Kustova geschrieben:
> On Wed, Jun 25, 2014 at 1:42 PM, Kevin Wolf <email address hidden> wrote:
> > Am 25.06.2014 um 11:32 hat M.Kustova geschrieben:
> >> On Tue, Jun 24, 2014 at 7:36 PM, Kevin Wolf <email address hidden> wrote:
> >> > Am 24.06.2014 um 15:19 hat M.Kustova geschrieben:
> >> >> On Mon, Jun 23, 2014 at 12:02 PM, Stefan Hajnoczi <email address hidden> wrote:
> >> >> > On Thu, Jun 19, 2014 at 07:19:55PM -0000, Maria Kustova wrote:
> >> >> >> The bug description missed qemu-img error:
> >> >> >>
> >> >> >> (process:12283): GLib-ERROR **: gmem.c:110: failed to allocate
> >> >> >> 18446744059294601304 bytes
> >> >> >
> >> >> > Thanks, there has been recent work by Kevin Wolf to handle memory
> >> >> > allocation failures gracefully without terminating QEMU. This sounds
> >> >> > like a candidate for g_try_malloc() and friends.
> >> >> >
> >> >> > Does the following patch series solve the problem?
> >> >> > https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01275.html
> >> >>
> >> >> These patches are conflicting with current master. So I can't test
> >> >> them as they are.
> >> >>
> >> >> Do you have a developer repository or branch containing these patches,
> >> >> so I could test it on the pre-release base?
> >> >
> >> > I'm just about to send a new version, I'll keep you CCed there.
> >>
> >> "[PATCH v4 21/21] qcow2: Return useful error code in refcount_init()"
> >> is still broken for the current master.
> >
> > In which way? I can cleanly apply the whole patch series on master (even
> > tried applying the emails from my inbox to be sure).
>
> Beginning from line #49 in master:
>
> if (s->refcount_table_size > 0) {
> BLKDBG_EVENT(bs->file, BLKDBG_REFTABLE_LOAD);
> ret = bdrv_pread(bs->file, s->refcount_table_offset,
>
> The patch:
>
> if (s->refcount_table_size > 0) {^M
> if (s->refcount_table == NULL) {^M
> + ret = -ENOMEM;^M
> goto fail;^M
> }^M
> BLKDBG_EVENT(bs->file, BLKDBG_REFTABLE_LOAD);^M
> ret = bdrv_pread(bs->file, s->refcount_table_offset,^M
>
> At least master version doesn't have this condition.
It is code added in patch 11 of the same series.
Kevin
The series fixed the crash, but qemu-img started to produce the confusing output:
$ qemu-img check test_image
ERROR: I/O error in check_refcounts_l1
No errors were found on the image.
QEMU nowadays seems to report "Check failed: Cannot allocate memory" ... so I assume that is OK and we can now close this bug?
[Expired for QEMU because there has been no activity for 60 days.]
Have the same proble: qemu-img: Check failed: Cannot allocate memory
|