[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [Bug 1240669] Re: sd_init() generates SIGSEGV when passed N
From: |
Devin Boyer |
Subject: |
[Qemu-devel] [Bug 1240669] Re: sd_init() generates SIGSEGV when passed NULL |
Date: |
Tue, 22 Oct 2013 01:23:56 -0000 |
Fixed with commit 794cbc26eb94ce13c75d105eea9ff0afff56e2c2.
** Changed in: qemu
Status: New => Fix Committed
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1240669
Title:
sd_init() generates SIGSEGV when passed NULL
Status in QEMU:
Fix Committed
Bug description:
Ran into a bug following the following tutorial:
http://balau82.wordpress.com/2010/03/10/u-boot-for-arm-on-qemu/
I built QEMU from a clone of master and became stuck at the beginning
part of the tutorial where only u-boot.bin is exectuted.
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=4f8a066b5fc254eeaabbbde56ba4f5b29cc68fdf
See the modifications to sd.c specifically.
When sd_init (sd.c) is called from pl181_init(), bs is potentially null:
s->card = sd_init(dinfo ? dinfo->bdrv : NULL, false);
sd_init():
SDState *sd_init(BlockDriverState *bs, bool is_spi)
{
SDState *sd;
if (bdrv_is_read_only(bs)) {
fprintf(stderr, "sd_init: Cannot use read-only drive\n");
return NULL;
}
sd = (SDState *) g_malloc0(sizeof(SDState));
sd->buf = qemu_blockalign(bs, 512);
sd->spi = is_spi;
sd->enable = true;
sd_reset(sd, bs);
if (sd->bdrv) {
bdrv_attach_dev_nofail(sd->bdrv, sd);
bdrv_set_dev_ops(sd->bdrv, &sd_block_ops, sd);
}
vmstate_register(NULL, -1, &sd_vmstate, sd);
return sd;
}
Line 497 calls bdrv_is_read_only(bs) (from block.c)and this generates a
SEGSIGV.
int bdrv_is_read_only(BlockDriverState *bs)
{
return bs->read_only;
}
Checking out tag v1.6.1 reverted the problem. Thanks!
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1240669/+subscriptions
- [Qemu-devel] [PATCH_v2 0/9] target-openrisc: Corrections and speed improvements, Sebastian Macke, 2013/10/21
- [Qemu-devel] [PATCH_v2 1/9] target-openrisc: Speed up move instruction, Sebastian Macke, 2013/10/21
- [Qemu-devel] [PATCH_v2 2/9] target-openrisc: Remove unnecessary code generated by jump instructions, Sebastian Macke, 2013/10/21
- [Qemu-devel] [PATCH_v2 4/9] target-openrisc: Correct wrong epcr register in interrupt handler, Sebastian Macke, 2013/10/21
- [Qemu-devel] [PATCH_v2 3/9] target-openrisc: Remove executable flag for every page, Sebastian Macke, 2013/10/21
- [Qemu-devel] [PATCH_v2 6/9] target-openrisc: Correct memory bounds checking for the tlb buffers, Sebastian Macke, 2013/10/21
- [Qemu-devel] [PATCH_v2 7/9] target-openrisc: Separate branch flag from Supervision register, Sebastian Macke, 2013/10/21
- [Qemu-devel] [PATCH_v2 5/9] openrisc-timer: Reduce overhead, Separate clock update functions, Sebastian Macke, 2013/10/21
- [Qemu-devel] [PATCH_v2 8/9] target-openrisc: Complete remove of npc and ppc variables, Sebastian Macke, 2013/10/21
- [Qemu-devel] [PATCH_v2 9/9] target-openrisc: Correct carry flag check of l.addc and l.addic test cases, Sebastian Macke, 2013/10/21