On 2 April 2016 at 23:15, Liviu Ionescu <i...@livius.net> 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