]> Git Repo - qemu.git/commit
hw/cpu/a15mpcore: Fix introspection problem with the a15mpcore_priv device
authorThomas Huth <[email protected]>
Mon, 16 Jul 2018 12:59:22 +0000 (14:59 +0200)
committerPeter Maydell <[email protected]>
Tue, 17 Jul 2018 12:12:49 +0000 (13:12 +0100)
commitfd31701214ccf01c815a29563e6c0e182676d39c
treeb9e3e4ac434d298f66b65f940cd75eda41b6bf0c
parent955cbc6b178fec1f656e702774390c2023798fb7
hw/cpu/a15mpcore: Fix introspection problem with the a15mpcore_priv device

There is a memory management problem when introspecting the a15mpcore_priv
device. It can be seen with valgrind when running QEMU like this:

echo "{'execute':'qmp_capabilities'} {'execute':'device-list-properties'," \
 "'arguments':{'typename':'a15mpcore_priv'}}"\
 "{'execute': 'human-monitor-command', " \
 "'arguments': {'command-line': 'info qtree'}}"  | \
 valgrind -q aarch64-softmmu/qemu-system-aarch64 -M none,accel=qtest -qmp stdio
{"QMP": {"version": {"qemu": {"micro": 50, "minor": 12, "major": 2},
 "package": "build-all"}, "capabilities": []}}
{"return": {}}
{"return": [{"name": "num-cpu", "type": "uint32"}, {"name": "num-irq",
 "type": "uint32"}, {"name": "a15mp-priv-container[0]", "type":
  "child<qemu:memory-region>"}]}
==24978== Invalid read of size 8
==24978==    at 0x618EBA: qdev_print (qdev-monitor.c:686)
==24978==    by 0x618EBA: qbus_print (qdev-monitor.c:719)
[...]

Use the new sysbus_init_child_obj() function to make sure that we get
the reference counting of the child objects right.

Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-id: 1531745974[email protected]
Signed-off-by: Peter Maydell <[email protected]>
hw/cpu/a15mpcore.c
This page took 0.026765 seconds and 4 git commands to generate.