qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] test-qapi-visit causes clang -fsanitize=undefined warning
@ 2014-03-08 12:39 Peter Maydell
  2014-03-08 14:03 ` Peter Maydell
  2014-03-10 12:21 ` Markus Armbruster
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Maydell @ 2014-03-08 12:39 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Markus Armbruster, Luiz Capitulino

I've noticed that the tests/test-qapi-visit.c code provokes the following
complaint from clang's -fsanitize=undefined undefined-behaviour
checker when you run 'make check':

tests/test-qapi-visit.c:462:33: runtime error: member access within
null pointer of type 'UserDefA' (aka 'struct UserDefA')

which is the line
    visit_type_bool(m, &(*obj)->boolean, "boolean", &err);
in static void visit_type_UserDefA_fields(Visitor *m, UserDefA ** obj,
Error **errp).

It's presumably complaining because we've passed in an obj which
points to NULL (ie *obj == NULL). The callsite in visit_type_UserDefA()
checks for this and doesn't call the visit..fields function. The callsite
in visit_type_UserDefFlatUnion doesn't.

Unfortunately this is all autogenerated C so I'm not sure where exactly
the bug should be fixed. Could one of you have a look at it?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-03-11 12:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-08 12:39 [Qemu-devel] test-qapi-visit causes clang -fsanitize=undefined warning Peter Maydell
2014-03-08 14:03 ` Peter Maydell
2014-03-10  9:45   ` Markus Armbruster
2014-03-10 12:21 ` Markus Armbruster
2014-03-10 12:27   ` Peter Maydell
2014-03-10 13:36     ` Markus Armbruster
2014-03-10 13:41       ` Peter Maydell
2014-03-10 18:21         ` Markus Armbruster
2014-03-11 12:29           ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).