[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interfac
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined |
Date: |
Sun, 3 Apr 2016 13:28:05 +0100 |
On 2 April 2016 at 23:15, Liviu Ionescu <address@hidden> wrote:
> I just updated GNU ARM Eclipse QEMU to 2.5.1 and initially
>I had some problems, main() failed quite early, in the first
> call to `find_default_machine()`.
>
> After several debug sessions, I identified the problem to
> be a null pointer when a referred interface is not defined.
> In my Cortex-M specific configuration, `arm/boot.c` was not
> included in the build, but TYPE_ARM_LINUX_BOOT_IF was referred
> by TYPE_ARM_GIC_COMMON, the parent of my NVIC object.
>
> I guess the problem is in `object.c:type_initialize()`, which
> does not check the pointer returned by:
>
> `TypeImpl *t = type_get_by_name(ti->interfaces[i].typename)`
>
> and calls
>
> `type_initialize_interface(ti, t, t);`
>
> with the null pointers.
Yeah, referring to an interface that doesn't exist is a
program bug (or in this case a build config error, though
since hw/arm/boot.o is in obj-y it should always be built),
but we could assert on it rather than just crashing.
g_assert() will do.
thanks
-- PMM
- [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined, Liviu Ionescu, 2016/04/02
- Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined,
Peter Maydell <=
- Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined, Liviu Ionescu, 2016/04/03
- Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined, Peter Maydell, 2016/04/03
- Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined, Liviu Ionescu, 2016/04/03
- Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined, Peter Maydell, 2016/04/03
- Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined, Liviu Ionescu, 2016/04/03
- Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined, Peter Maydell, 2016/04/03
- Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined, Liviu Ionescu, 2016/04/03
- Re: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined, Peter Maydell, 2016/04/03