From: Liviu Ionescu <ilg@livius.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined
Date: Sun, 3 Apr 2016 01:15:53 +0300 [thread overview]
Message-ID: <B870215E-CF53-41BD-A4C3-E944B00495E9@livius.net> (raw)
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.
Normally an assert would be enough, but I don't know exactly which of your asserts better fit here, so I would abstain from submitting a patch.
Regards,
Liviu
next reply other threads:[~2016-04-02 22:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-02 22:15 Liviu Ionescu [this message]
2016-04-03 12:28 ` [Qemu-devel] segmentation fault in object.c:type_initialize_interface() if interface not defined Peter Maydell
2016-04-03 15:40 ` Liviu Ionescu
2016-04-03 16:43 ` Peter Maydell
2016-04-03 16:57 ` Liviu Ionescu
2016-04-03 17:01 ` Peter Maydell
2016-04-03 17:56 ` Liviu Ionescu
2016-04-03 21:30 ` Peter Maydell
2016-04-03 21:42 ` Liviu Ionescu
2016-04-03 21:59 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B870215E-CF53-41BD-A4C3-E944B00495E9@livius.net \
--to=ilg@livius.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.