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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
|
qemu-io crashes with SIGABRT and Assertion `c->entries[i].offset != 0' failed
git is at HEAD a93ece47fd9edbd4558db24300056c9a57d3bcd4
This is on ppc64le architecture.
Re-production steps:
1. Copy the attached files named backing_img.file and test.img to a directory
2. And customize the following command to point to the above directory and run the same.
/usr/bin/qemu-io <path to>/test.img -c "write 1352192 1707520"
3.Output of the above command.
qemu-io: block/qcow2-cache.c:411: qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed.
Aborted (core dumped)
from gdb:
(gdb) bt
#0 0x00003fff833eeff0 in raise () from /lib64/libc.so.6
#1 0x00003fff833f136c in abort () from /lib64/libc.so.6
#2 0x00003fff833e4c44 in __assert_fail_base () from /lib64/libc.so.6
#3 0x00003fff833e4d34 in __assert_fail () from /lib64/libc.so.6
#4 0x000000001006a594 in qcow2_cache_entry_mark_dirty (bs=0x2e886f60, c=0x2e879700, table=0x3fff81200000) at block/qcow2-cache.c:411
#5 0x0000000010056154 in alloc_refcount_block (bs=0x2e886f60, cluster_index=2, refcount_block=0x3fff80cff808) at block/qcow2-refcount.c:417
#6 0x0000000010057520 in update_refcount (bs=0x2e886f60, offset=1048576, length=524288, addend=1, decrease=false, type=QCOW2_DISCARD_NEVER)
at block/qcow2-refcount.c:834
#7 0x0000000010057dc8 in qcow2_alloc_clusters_at (bs=0x2e886f60, offset=1048576, nb_clusters=1) at block/qcow2-refcount.c:1032
#8 0x00000000100636d8 in do_alloc_cluster_offset (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cff9e0, nb_clusters=0x3fff80cff9d8)
at block/qcow2-cluster.c:1221
#9 0x0000000010063afc in handle_alloc (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cffab0, bytes=0x3fff80cffab8, m=0x3fff80cffb60)
at block/qcow2-cluster.c:1324
#10 0x0000000010064178 in qcow2_alloc_cluster_offset (bs=0x2e886f60, offset=1572864, bytes=0x3fff80cffb4c, host_offset=0x3fff80cffb58, m=0x3fff80cffb60)
at block/qcow2-cluster.c:1511
#11 0x000000001004d3f4 in qcow2_co_pwritev (bs=0x2e886f60, offset=1572864, bytes=1486848, qiov=0x3fffc85f0bf0, flags=0) at block/qcow2.c:1919
#12 0x00000000100a9648 in bdrv_driver_pwritev (bs=0x2e886f60, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=16) at block/io.c:898
#13 0x00000000100ab630 in bdrv_aligned_pwritev (child=0x2e8927f0, req=0x3fff80cffdd8, offset=1352192, bytes=1707520, align=1, qiov=0x3fffc85f0bf0, flags=16)
at block/io.c:1440
#14 0x00000000100ac4ac in bdrv_co_pwritev (child=0x2e8927f0, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/io.c:1691
#15 0x000000001008da0c in blk_co_pwritev (blk=0x2e879410, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/block-backend.c:1085
#16 0x000000001008db68 in blk_write_entry (opaque=0x3fffc85f0c08) at block/block-backend.c:1110
#17 0x00000000101aa444 in coroutine_trampoline (i0=780753552, i1=0) at util/coroutine-ucontext.c:79
#18 0x00003fff83402b9c in makecontext () from /lib64/libc.so.6
#19 0x0000000000000000 in ?? ()
(gdb) bt full
#0 0x00003fff833eeff0 in raise () from /lib64/libc.so.6
No symbol table info available.
#1 0x00003fff833f136c in abort () from /lib64/libc.so.6
No symbol table info available.
#2 0x00003fff833e4c44 in __assert_fail_base () from /lib64/libc.so.6
No symbol table info available.
#3 0x00003fff833e4d34 in __assert_fail () from /lib64/libc.so.6
No symbol table info available.
#4 0x000000001006a594 in qcow2_cache_entry_mark_dirty (bs=0x2e886f60, c=0x2e879700, table=0x3fff81200000) at block/qcow2-cache.c:411
i = 0
__PRETTY_FUNCTION__ = "qcow2_cache_entry_mark_dirty"
#5 0x0000000010056154 in alloc_refcount_block (bs=0x2e886f60, cluster_index=2, refcount_block=0x3fff80cff808) at block/qcow2-refcount.c:417
s = 0x2e893210
refcount_table_index = 0
ret = 0
new_block = 0
blocks_used = 72057594818669408
meta_offset = 1572863
#6 0x0000000010057520 in update_refcount (bs=0x2e886f60, offset=1048576, length=524288, addend=1, decrease=false, type=QCOW2_DISCARD_NEVER)
at block/qcow2-refcount.c:834
block_index = 268870408
refcount = 780741808
cluster_index = 2
table_index = 0
s = 0x2e893210
start = 1048576
last = 1048576
cluster_offset = 1048576
refcount_block = 0x3fff81200000
old_table_index = -1
ret = 16383
#7 0x0000000010057dc8 in qcow2_alloc_clusters_at (bs=0x2e886f60, offset=1048576, nb_clusters=1) at block/qcow2-refcount.c:1032
s = 0x2e893210
cluster_index = 3
refcount = 0
i = 1
ret = 0
__PRETTY_FUNCTION__ = "qcow2_alloc_clusters_at"
#8 0x00000000100636d8 in do_alloc_cluster_offset (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cff9e0, nb_clusters=0x3fff80cff9d8)
at block/qcow2-cluster.c:1221
ret = 780743184
s = 0x2e893210
#9 0x0000000010063afc in handle_alloc (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cffab0, bytes=0x3fff80cffab8, m=0x3fff80cffb60)
at block/qcow2-cluster.c:1324
s = 0x2e893210
l2_index = 4
l2_table = 0x0
entry = 0
nb_clusters = 1
ret = 0
---Type <return> to continue, or q <return> to quit---
keep_old_clusters = false
alloc_cluster_offset = 1048576
__PRETTY_FUNCTION__ = "handle_alloc"
requested_bytes = 17960562528
avail_bytes = -2133853344
nb_bytes = 16383
old_m = 0x100000000
#10 0x0000000010064178 in qcow2_alloc_cluster_offset (bs=0x2e886f60, offset=1572864, bytes=0x3fff80cffb4c, host_offset=0x3fff80cffb58, m=0x3fff80cffb60)
at block/qcow2-cluster.c:1511
s = 0x2e893210
start = 2097152
remaining = 962560
cluster_offset = 1048576
cur_bytes = 962560
ret = 0
__PRETTY_FUNCTION__ = "qcow2_alloc_cluster_offset"
#11 0x000000001004d3f4 in qcow2_co_pwritev (bs=0x2e886f60, offset=1572864, bytes=1486848, qiov=0x3fffc85f0bf0, flags=0) at block/qcow2.c:1919
s = 0x2e893210
offset_in_cluster = 0
ret = 0
cur_bytes = 1486848
cluster_offset = 524288
hd_qiov = {iov = 0x2e858660, niov = 1, nalloc = 1, size = 220672}
bytes_done = 220672
cluster_data = 0x0
l2meta = 0x0
__PRETTY_FUNCTION__ = "qcow2_co_pwritev"
#12 0x00000000100a9648 in bdrv_driver_pwritev (bs=0x2e886f60, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=16) at block/io.c:898
drv = 0x102036f0 <bdrv_qcow2>
sector_num = 780706080
nb_sectors = 3069122264
ret = -203160320
__PRETTY_FUNCTION__ = "bdrv_driver_pwritev"
#13 0x00000000100ab630 in bdrv_aligned_pwritev (child=0x2e8927f0, req=0x3fff80cffdd8, offset=1352192, bytes=1707520, align=1, qiov=0x3fffc85f0bf0, flags=16)
at block/io.c:1440
bs = 0x2e886f60
drv = 0x102036f0 <bdrv_qcow2>
waited = false
ret = 0
end_sector = 5976
bytes_remaining = 1707520
max_transfer = 2147483647
__PRETTY_FUNCTION__ = "bdrv_aligned_pwritev"
#14 0x00000000100ac4ac in bdrv_co_pwritev (child=0x2e8927f0, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/io.c:1691
bs = 0x2e886f60
req = {bs = 0x2e886f60, offset = 1352192, bytes = 1707520, type = BDRV_TRACKED_WRITE, serialising = false, overlap_offset = 1352192,
overlap_bytes = 1707520, list = {le_next = 0x0, le_prev = 0x2e88a1d8}, co = 0x2e895a90, wait_queue = {entries = {sqh_first = 0x0,
sqh_last = 0x3fff80cffe20}}, waiting_for = 0x0}
align = 1
head_buf = 0x0
---Type <return> to continue, or q <return> to quit---
tail_buf = 0x0
local_qiov = {iov = 0x3fff80cffdb0, niov = -2133852688, nalloc = 16383, size = 1352192}
use_local_qiov = false
ret = 0
__PRETTY_FUNCTION__ = "bdrv_co_pwritev"
#15 0x000000001008da0c in blk_co_pwritev (blk=0x2e879410, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/block-backend.c:1085
ret = 0
bs = 0x2e886f60
#16 0x000000001008db68 in blk_write_entry (opaque=0x3fffc85f0c08) at block/block-backend.c:1110
rwco = 0x3fffc85f0c08
#17 0x00000000101aa444 in coroutine_trampoline (i0=780753552, i1=0) at util/coroutine-ucontext.c:79
arg = {p = 0x2e895a90, i = {780753552, 0}}
self = 0x2e895a90
co = 0x2e895a90
#18 0x00003fff83402b9c in makecontext () from /lib64/libc.so.6
No symbol table info available.
#19 0x0000000000000000 in ?? ()
No symbol table info available.
Will attach the 'image_fuzzer' images.
On Wed 01 Nov 2017 07:13:08 AM CET, Thomas Huth wrote:
> On 30.10.2017 15:43, R.Nageswara Sastry wrote:
>> Public bug reported:
>>
>> git is at HEAD a93ece47fd9edbd4558db24300056c9a57d3bcd4
>> This is on ppc64le architecture.
>>
>> Re-production steps:
>>
>> 1. Copy the attached files named backing_img.file and test.img to a directory
>> 2. And customize the following command to point to the above directory and run the same.
>> /usr/bin/qemu-io <path to>/test.img -c "write 1352192 1707520"
>>
>> 3.Output of the above command.
>> qemu-io: block/qcow2-cache.c:411: qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed.
>> Aborted (core dumped)
>>
>> from gdb:
>> (gdb) bt
>> #0 0x00003fff833eeff0 in raise () from /lib64/libc.so.6
>> #1 0x00003fff833f136c in abort () from /lib64/libc.so.6
>> #2 0x00003fff833e4c44 in __assert_fail_base () from /lib64/libc.so.6
>> #3 0x00003fff833e4d34 in __assert_fail () from /lib64/libc.so.6
>> #4 0x000000001006a594 in qcow2_cache_entry_mark_dirty (bs=0x2e886f60, c=0x2e879700, table=0x3fff81200000) at block/qcow2-cache.c:411
>> #5 0x0000000010056154 in alloc_refcount_block (bs=0x2e886f60, cluster_index=2, refcount_block=0x3fff80cff808) at block/qcow2-refcount.c:417
>> #6 0x0000000010057520 in update_refcount (bs=0x2e886f60, offset=1048576, length=524288, addend=1, decrease=false, type=QCOW2_DISCARD_NEVER)
>> at block/qcow2-refcount.c:834
>> #7 0x0000000010057dc8 in qcow2_alloc_clusters_at (bs=0x2e886f60, offset=1048576, nb_clusters=1) at block/qcow2-refcount.c:1032
>> #8 0x00000000100636d8 in do_alloc_cluster_offset (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cff9e0, nb_clusters=0x3fff80cff9d8)
>> at block/qcow2-cluster.c:1221
>> #9 0x0000000010063afc in handle_alloc (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cffab0, bytes=0x3fff80cffab8, m=0x3fff80cffb60)
>> at block/qcow2-cluster.c:1324
>> #10 0x0000000010064178 in qcow2_alloc_cluster_offset (bs=0x2e886f60, offset=1572864, bytes=0x3fff80cffb4c, host_offset=0x3fff80cffb58, m=0x3fff80cffb60)
>> at block/qcow2-cluster.c:1511
>> #11 0x000000001004d3f4 in qcow2_co_pwritev (bs=0x2e886f60, offset=1572864, bytes=1486848, qiov=0x3fffc85f0bf0, flags=0) at block/qcow2.c:1919
>> #12 0x00000000100a9648 in bdrv_driver_pwritev (bs=0x2e886f60, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=16) at block/io.c:898
>> #13 0x00000000100ab630 in bdrv_aligned_pwritev (child=0x2e8927f0, req=0x3fff80cffdd8, offset=1352192, bytes=1707520, align=1, qiov=0x3fffc85f0bf0, flags=16)
>> at block/io.c:1440
>> #14 0x00000000100ac4ac in bdrv_co_pwritev (child=0x2e8927f0, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/io.c:1691
>> #15 0x000000001008da0c in blk_co_pwritev (blk=0x2e879410, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/block-backend.c:1085
>> #16 0x000000001008db68 in blk_write_entry (opaque=0x3fffc85f0c08) at block/block-backend.c:1110
>> #17 0x00000000101aa444 in coroutine_trampoline (i0=780753552, i1=0) at util/coroutine-ucontext.c:79
>> #18 0x00003fff83402b9c in makecontext () from /lib64/libc.so.6
>> #19 0x0000000000000000 in ?? ()
>> (gdb) bt full
>> #0 0x00003fff833eeff0 in raise () from /lib64/libc.so.6
>> No symbol table info available.
>> #1 0x00003fff833f136c in abort () from /lib64/libc.so.6
>> No symbol table info available.
>> #2 0x00003fff833e4c44 in __assert_fail_base () from /lib64/libc.so.6
>> No symbol table info available.
>> #3 0x00003fff833e4d34 in __assert_fail () from /lib64/libc.so.6
>> No symbol table info available.
>> #4 0x000000001006a594 in qcow2_cache_entry_mark_dirty (bs=0x2e886f60, c=0x2e879700, table=0x3fff81200000) at block/qcow2-cache.c:411
>> i = 0
>> __PRETTY_FUNCTION__ = "qcow2_cache_entry_mark_dirty"
>> #5 0x0000000010056154 in alloc_refcount_block (bs=0x2e886f60, cluster_index=2, refcount_block=0x3fff80cff808) at block/qcow2-refcount.c:417
>> s = 0x2e893210
>> refcount_table_index = 0
>> ret = 0
>> new_block = 0
>> blocks_used = 72057594818669408
>> meta_offset = 1572863
>> #6 0x0000000010057520 in update_refcount (bs=0x2e886f60, offset=1048576, length=524288, addend=1, decrease=false, type=QCOW2_DISCARD_NEVER)
>> at block/qcow2-refcount.c:834
>> block_index = 268870408
>> refcount = 780741808
>> cluster_index = 2
>> table_index = 0
>> s = 0x2e893210
>> start = 1048576
>> last = 1048576
>> cluster_offset = 1048576
>> refcount_block = 0x3fff81200000
>> old_table_index = -1
>> ret = 16383
>> #7 0x0000000010057dc8 in qcow2_alloc_clusters_at (bs=0x2e886f60, offset=1048576, nb_clusters=1) at block/qcow2-refcount.c:1032
>> s = 0x2e893210
>> cluster_index = 3
>> refcount = 0
>> i = 1
>> ret = 0
>> __PRETTY_FUNCTION__ = "qcow2_alloc_clusters_at"
>> #8 0x00000000100636d8 in do_alloc_cluster_offset (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cff9e0, nb_clusters=0x3fff80cff9d8)
>> at block/qcow2-cluster.c:1221
>> ret = 780743184
>> s = 0x2e893210
>> #9 0x0000000010063afc in handle_alloc (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cffab0, bytes=0x3fff80cffab8, m=0x3fff80cffb60)
>> at block/qcow2-cluster.c:1324
>> s = 0x2e893210
>> l2_index = 4
>> l2_table = 0x0
>> entry = 0
>> nb_clusters = 1
>> ret = 0
>> ---Type <return> to continue, or q <return> to quit---
>> keep_old_clusters = false
>> alloc_cluster_offset = 1048576
>> __PRETTY_FUNCTION__ = "handle_alloc"
>> requested_bytes = 17960562528
>> avail_bytes = -2133853344
>> nb_bytes = 16383
>> old_m = 0x100000000
>> #10 0x0000000010064178 in qcow2_alloc_cluster_offset (bs=0x2e886f60, offset=1572864, bytes=0x3fff80cffb4c, host_offset=0x3fff80cffb58, m=0x3fff80cffb60)
>> at block/qcow2-cluster.c:1511
>> s = 0x2e893210
>> start = 2097152
>> remaining = 962560
>> cluster_offset = 1048576
>> cur_bytes = 962560
>> ret = 0
>> __PRETTY_FUNCTION__ = "qcow2_alloc_cluster_offset"
>> #11 0x000000001004d3f4 in qcow2_co_pwritev (bs=0x2e886f60, offset=1572864, bytes=1486848, qiov=0x3fffc85f0bf0, flags=0) at block/qcow2.c:1919
>> s = 0x2e893210
>> offset_in_cluster = 0
>> ret = 0
>> cur_bytes = 1486848
>> cluster_offset = 524288
>> hd_qiov = {iov = 0x2e858660, niov = 1, nalloc = 1, size = 220672}
>> bytes_done = 220672
>> cluster_data = 0x0
>> l2meta = 0x0
>> __PRETTY_FUNCTION__ = "qcow2_co_pwritev"
>> #12 0x00000000100a9648 in bdrv_driver_pwritev (bs=0x2e886f60, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=16) at block/io.c:898
>> drv = 0x102036f0 <bdrv_qcow2>
>> sector_num = 780706080
>> nb_sectors = 3069122264
>> ret = -203160320
>> __PRETTY_FUNCTION__ = "bdrv_driver_pwritev"
>> #13 0x00000000100ab630 in bdrv_aligned_pwritev (child=0x2e8927f0, req=0x3fff80cffdd8, offset=1352192, bytes=1707520, align=1, qiov=0x3fffc85f0bf0, flags=16)
>> at block/io.c:1440
>> bs = 0x2e886f60
>> drv = 0x102036f0 <bdrv_qcow2>
>> waited = false
>> ret = 0
>> end_sector = 5976
>> bytes_remaining = 1707520
>> max_transfer = 2147483647
>> __PRETTY_FUNCTION__ = "bdrv_aligned_pwritev"
>> #14 0x00000000100ac4ac in bdrv_co_pwritev (child=0x2e8927f0, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/io.c:1691
>> bs = 0x2e886f60
>> req = {bs = 0x2e886f60, offset = 1352192, bytes = 1707520, type = BDRV_TRACKED_WRITE, serialising = false, overlap_offset = 1352192,
>> overlap_bytes = 1707520, list = {le_next = 0x0, le_prev = 0x2e88a1d8}, co = 0x2e895a90, wait_queue = {entries = {sqh_first = 0x0,
>> sqh_last = 0x3fff80cffe20}}, waiting_for = 0x0}
>> align = 1
>> head_buf = 0x0
>> ---Type <return> to continue, or q <return> to quit---
>> tail_buf = 0x0
>> local_qiov = {iov = 0x3fff80cffdb0, niov = -2133852688, nalloc = 16383, size = 1352192}
>> use_local_qiov = false
>> ret = 0
>> __PRETTY_FUNCTION__ = "bdrv_co_pwritev"
>> #15 0x000000001008da0c in blk_co_pwritev (blk=0x2e879410, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/block-backend.c:1085
>> ret = 0
>> bs = 0x2e886f60
>> #16 0x000000001008db68 in blk_write_entry (opaque=0x3fffc85f0c08) at block/block-backend.c:1110
>> rwco = 0x3fffc85f0c08
>> #17 0x00000000101aa444 in coroutine_trampoline (i0=780753552, i1=0) at util/coroutine-ucontext.c:79
>> arg = {p = 0x2e895a90, i = {780753552, 0}}
>> self = 0x2e895a90
>> co = 0x2e895a90
>> #18 0x00003fff83402b9c in makecontext () from /lib64/libc.so.6
>> No symbol table info available.
>> #19 0x0000000000000000 in ?? ()
>> No symbol table info available.
>
> Can you also reproduce this on x86, or is it specific to ppc64?
I can actually reproduce it myself, I'll take a look.
Berto
On Wed 01 Nov 2017 09:55:21 AM CET, Alberto Garcia wrote:
> On Wed 01 Nov 2017 07:13:08 AM CET, Thomas Huth wrote:
>> On 30.10.2017 15:43, R.Nageswara Sastry wrote:
>>> Public bug reported:
>>>
>>> git is at HEAD a93ece47fd9edbd4558db24300056c9a57d3bcd4
>>> This is on ppc64le architecture.
>>>
>>> Re-production steps:
>>>
>>> 1. Copy the attached files named backing_img.file and test.img to a directory
>>> 2. And customize the following command to point to the above directory and run the same.
>>> /usr/bin/qemu-io <path to>/test.img -c "write 1352192 1707520"
>>>
>>> 3.Output of the above command.
>>> qemu-io: block/qcow2-cache.c:411: qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed.
>>> Aborted (core dumped)
>>>
>>> from gdb:
>>> (gdb) bt
>>> #0 0x00003fff833eeff0 in raise () from /lib64/libc.so.6
>>> #1 0x00003fff833f136c in abort () from /lib64/libc.so.6
>>> #2 0x00003fff833e4c44 in __assert_fail_base () from /lib64/libc.so.6
>>> #3 0x00003fff833e4d34 in __assert_fail () from /lib64/libc.so.6
>>> #4 0x000000001006a594 in qcow2_cache_entry_mark_dirty (bs=0x2e886f60, c=0x2e879700, table=0x3fff81200000) at block/qcow2-cache.c:411
>>> #5 0x0000000010056154 in alloc_refcount_block (bs=0x2e886f60, cluster_index=2, refcount_block=0x3fff80cff808) at block/qcow2-refcount.c:417
>>> #6 0x0000000010057520 in update_refcount (bs=0x2e886f60, offset=1048576, length=524288, addend=1, decrease=false, type=QCOW2_DISCARD_NEVER)
>>> at block/qcow2-refcount.c:834
>>> #7 0x0000000010057dc8 in qcow2_alloc_clusters_at (bs=0x2e886f60, offset=1048576, nb_clusters=1) at block/qcow2-refcount.c:1032
>>> #8 0x00000000100636d8 in do_alloc_cluster_offset (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cff9e0, nb_clusters=0x3fff80cff9d8)
>>> at block/qcow2-cluster.c:1221
>>> #9 0x0000000010063afc in handle_alloc (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cffab0, bytes=0x3fff80cffab8, m=0x3fff80cffb60)
>>> at block/qcow2-cluster.c:1324
>>> #10 0x0000000010064178 in qcow2_alloc_cluster_offset (bs=0x2e886f60, offset=1572864, bytes=0x3fff80cffb4c, host_offset=0x3fff80cffb58, m=0x3fff80cffb60)
>>> at block/qcow2-cluster.c:1511
>>> #11 0x000000001004d3f4 in qcow2_co_pwritev (bs=0x2e886f60, offset=1572864, bytes=1486848, qiov=0x3fffc85f0bf0, flags=0) at block/qcow2.c:1919
>>> #12 0x00000000100a9648 in bdrv_driver_pwritev (bs=0x2e886f60, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=16) at block/io.c:898
>>> #13 0x00000000100ab630 in bdrv_aligned_pwritev (child=0x2e8927f0, req=0x3fff80cffdd8, offset=1352192, bytes=1707520, align=1, qiov=0x3fffc85f0bf0, flags=16)
>>> at block/io.c:1440
>>> #14 0x00000000100ac4ac in bdrv_co_pwritev (child=0x2e8927f0, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/io.c:1691
>>> #15 0x000000001008da0c in blk_co_pwritev (blk=0x2e879410, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/block-backend.c:1085
>>> #16 0x000000001008db68 in blk_write_entry (opaque=0x3fffc85f0c08) at block/block-backend.c:1110
>>> #17 0x00000000101aa444 in coroutine_trampoline (i0=780753552, i1=0) at util/coroutine-ucontext.c:79
>>> #18 0x00003fff83402b9c in makecontext () from /lib64/libc.so.6
>>> #19 0x0000000000000000 in ?? ()
>>> (gdb) bt full
>>> #0 0x00003fff833eeff0 in raise () from /lib64/libc.so.6
>>> No symbol table info available.
>>> #1 0x00003fff833f136c in abort () from /lib64/libc.so.6
>>> No symbol table info available.
>>> #2 0x00003fff833e4c44 in __assert_fail_base () from /lib64/libc.so.6
>>> No symbol table info available.
>>> #3 0x00003fff833e4d34 in __assert_fail () from /lib64/libc.so.6
>>> No symbol table info available.
>>> #4 0x000000001006a594 in qcow2_cache_entry_mark_dirty (bs=0x2e886f60, c=0x2e879700, table=0x3fff81200000) at block/qcow2-cache.c:411
>>> i = 0
>>> __PRETTY_FUNCTION__ = "qcow2_cache_entry_mark_dirty"
>>> #5 0x0000000010056154 in alloc_refcount_block (bs=0x2e886f60, cluster_index=2, refcount_block=0x3fff80cff808) at block/qcow2-refcount.c:417
>>> s = 0x2e893210
>>> refcount_table_index = 0
>>> ret = 0
>>> new_block = 0
>>> blocks_used = 72057594818669408
>>> meta_offset = 1572863
>>> #6 0x0000000010057520 in update_refcount (bs=0x2e886f60, offset=1048576, length=524288, addend=1, decrease=false, type=QCOW2_DISCARD_NEVER)
>>> at block/qcow2-refcount.c:834
>>> block_index = 268870408
>>> refcount = 780741808
>>> cluster_index = 2
>>> table_index = 0
>>> s = 0x2e893210
>>> start = 1048576
>>> last = 1048576
>>> cluster_offset = 1048576
>>> refcount_block = 0x3fff81200000
>>> old_table_index = -1
>>> ret = 16383
>>> #7 0x0000000010057dc8 in qcow2_alloc_clusters_at (bs=0x2e886f60, offset=1048576, nb_clusters=1) at block/qcow2-refcount.c:1032
>>> s = 0x2e893210
>>> cluster_index = 3
>>> refcount = 0
>>> i = 1
>>> ret = 0
>>> __PRETTY_FUNCTION__ = "qcow2_alloc_clusters_at"
>>> #8 0x00000000100636d8 in do_alloc_cluster_offset (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cff9e0, nb_clusters=0x3fff80cff9d8)
>>> at block/qcow2-cluster.c:1221
>>> ret = 780743184
>>> s = 0x2e893210
>>> #9 0x0000000010063afc in handle_alloc (bs=0x2e886f60, guest_offset=2097152, host_offset=0x3fff80cffab0, bytes=0x3fff80cffab8, m=0x3fff80cffb60)
>>> at block/qcow2-cluster.c:1324
>>> s = 0x2e893210
>>> l2_index = 4
>>> l2_table = 0x0
>>> entry = 0
>>> nb_clusters = 1
>>> ret = 0
>>> ---Type <return> to continue, or q <return> to quit---
>>> keep_old_clusters = false
>>> alloc_cluster_offset = 1048576
>>> __PRETTY_FUNCTION__ = "handle_alloc"
>>> requested_bytes = 17960562528
>>> avail_bytes = -2133853344
>>> nb_bytes = 16383
>>> old_m = 0x100000000
>>> #10 0x0000000010064178 in qcow2_alloc_cluster_offset (bs=0x2e886f60, offset=1572864, bytes=0x3fff80cffb4c, host_offset=0x3fff80cffb58, m=0x3fff80cffb60)
>>> at block/qcow2-cluster.c:1511
>>> s = 0x2e893210
>>> start = 2097152
>>> remaining = 962560
>>> cluster_offset = 1048576
>>> cur_bytes = 962560
>>> ret = 0
>>> __PRETTY_FUNCTION__ = "qcow2_alloc_cluster_offset"
>>> #11 0x000000001004d3f4 in qcow2_co_pwritev (bs=0x2e886f60, offset=1572864, bytes=1486848, qiov=0x3fffc85f0bf0, flags=0) at block/qcow2.c:1919
>>> s = 0x2e893210
>>> offset_in_cluster = 0
>>> ret = 0
>>> cur_bytes = 1486848
>>> cluster_offset = 524288
>>> hd_qiov = {iov = 0x2e858660, niov = 1, nalloc = 1, size = 220672}
>>> bytes_done = 220672
>>> cluster_data = 0x0
>>> l2meta = 0x0
>>> __PRETTY_FUNCTION__ = "qcow2_co_pwritev"
>>> #12 0x00000000100a9648 in bdrv_driver_pwritev (bs=0x2e886f60, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=16) at block/io.c:898
>>> drv = 0x102036f0 <bdrv_qcow2>
>>> sector_num = 780706080
>>> nb_sectors = 3069122264
>>> ret = -203160320
>>> __PRETTY_FUNCTION__ = "bdrv_driver_pwritev"
>>> #13 0x00000000100ab630 in bdrv_aligned_pwritev (child=0x2e8927f0, req=0x3fff80cffdd8, offset=1352192, bytes=1707520, align=1, qiov=0x3fffc85f0bf0, flags=16)
>>> at block/io.c:1440
>>> bs = 0x2e886f60
>>> drv = 0x102036f0 <bdrv_qcow2>
>>> waited = false
>>> ret = 0
>>> end_sector = 5976
>>> bytes_remaining = 1707520
>>> max_transfer = 2147483647
>>> __PRETTY_FUNCTION__ = "bdrv_aligned_pwritev"
>>> #14 0x00000000100ac4ac in bdrv_co_pwritev (child=0x2e8927f0, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/io.c:1691
>>> bs = 0x2e886f60
>>> req = {bs = 0x2e886f60, offset = 1352192, bytes = 1707520, type = BDRV_TRACKED_WRITE, serialising = false, overlap_offset = 1352192,
>>> overlap_bytes = 1707520, list = {le_next = 0x0, le_prev = 0x2e88a1d8}, co = 0x2e895a90, wait_queue = {entries = {sqh_first = 0x0,
>>> sqh_last = 0x3fff80cffe20}}, waiting_for = 0x0}
>>> align = 1
>>> head_buf = 0x0
>>> ---Type <return> to continue, or q <return> to quit---
>>> tail_buf = 0x0
>>> local_qiov = {iov = 0x3fff80cffdb0, niov = -2133852688, nalloc = 16383, size = 1352192}
>>> use_local_qiov = false
>>> ret = 0
>>> __PRETTY_FUNCTION__ = "bdrv_co_pwritev"
>>> #15 0x000000001008da0c in blk_co_pwritev (blk=0x2e879410, offset=1352192, bytes=1707520, qiov=0x3fffc85f0bf0, flags=BDRV_REQ_FUA) at block/block-backend.c:1085
>>> ret = 0
>>> bs = 0x2e886f60
>>> #16 0x000000001008db68 in blk_write_entry (opaque=0x3fffc85f0c08) at block/block-backend.c:1110
>>> rwco = 0x3fffc85f0c08
>>> #17 0x00000000101aa444 in coroutine_trampoline (i0=780753552, i1=0) at util/coroutine-ucontext.c:79
>>> arg = {p = 0x2e895a90, i = {780753552, 0}}
>>> self = 0x2e895a90
>>> co = 0x2e895a90
>>> #18 0x00003fff83402b9c in makecontext () from /lib64/libc.so.6
>>> No symbol table info available.
>>> #19 0x0000000000000000 in ?? ()
>>> No symbol table info available.
>>
>> Can you also reproduce this on x86, or is it specific to ppc64?
I'm working on a fix, I'll send the patch later today.
Berto
The attached image is corrupted and QEMU doesn't handle it correctly.
Here are the fixes for this and other related problems:
https://lists.gnu.org/archive/html/qemu-block/2017-11/msg00010.html
Fix has been merged here:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=6bf45d59f98c898b7d79
|