mirror of https://gitlab.com/qemu-project/qemu
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
![]() When running the bios-tables-test under ASAN we see leaks like this:
Direct leak of 16 byte(s) in 1 object(s) allocated from:
#0 0x5bc58579b00d in calloc (/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/qemu-system-aarch64+0x250400d) (BuildId: 2e27b63dc9ac45f522ced40a17c2a60cc32f1d38)
#1 0x7b4ad90337b1 in g_malloc0 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x637b1) (BuildId: 1eb6131419edb83b2178b682829a6913cf682d75)
#2 0x5bc5861826db in qmp_memory_device_list /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/mem/memory-device.c:307:34
#3 0x5bc587a9edb6 in arm_load_dtb /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/arm/boot.c:656:15
Indirect leak of 28 byte(s) in 2 object(s) allocated from:
#0 0x5bc58579ae23 in malloc (/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/qemu-system-aarch64+0x2503e23) (BuildId: 2e27b63dc9ac45f522ced40a17c2a60cc32f1d38)
#1 0x7b4ad6c8f947 in __vasprintf_internal libio/vasprintf.c:116:16
#2 0x7b4ad9080a52 in g_vasprintf (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0xb0a52) (BuildId: 1eb6131419edb83b2178b682829a6913cf682d75)
#3 0x7b4ad90515e4 in g_strdup_vprintf (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x815e4) (BuildId: 1eb6131419edb83b2178b682829a6913cf682d75)
#4 0x7b4ad9051940 in g_strdup_printf (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x81940) (BuildId: 1eb6131419edb83b2178b682829a6913cf682d75)
#5 0x5bc5885eb739 in object_get_canonical_path /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:2123:19
#6 0x5bc58618dca8 in pc_dimm_md_fill_device_info /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/mem/pc-dimm.c:268:18
#7 0x5bc586182792 in qmp_memory_device_list /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/mem/memory-device.c:310:9
This happens because we declared the MemoryDeviceInfoList *md_list
with g_autofree, which will free the direct memory with g_free() but
doesn't free all the other data structures referenced by it. Instead
what we want is to declare the pointer with g_autoptr(), which will
automatically call the qapi_free_MemoryDeviceInfoList() cleanup
function when the variable goes out of scope.
Fixes:
|
6 days ago | |
---|---|---|
.. | ||
Kconfig | 2 months ago | |
allwinner-a10.c | 5 months ago | |
allwinner-h3.c | 5 months ago | |
allwinner-r40.c | 2 months ago | |
armsse.c | 5 months ago | |
armv7m.c | 5 months ago | |
aspeed.c | 2 months ago | |
aspeed_ast10x0.c | 5 months ago | |
aspeed_ast27x0-fc.c | 4 months ago | |
aspeed_ast27x0-ssp.c | 4 months ago | |
aspeed_ast27x0-tsp.c | 4 months ago | |
aspeed_ast27x0.c | 4 months ago | |
aspeed_ast2400.c | 5 months ago | |
aspeed_ast2600.c | 5 months ago | |
aspeed_eeprom.c | 2 months ago | |
aspeed_eeprom.h | 2 months ago | |
aspeed_soc_common.c | 5 months ago | |
b-l475e-iot01a.c | 5 months ago | |
bananapi_m2u.c | 5 months ago | |
bcm2835_peripherals.c | 5 months ago | |
bcm2836.c | 5 months ago | |
bcm2838.c | 5 months ago | |
bcm2838_peripherals.c | 5 months ago | |
boot.c | 6 days ago | |
collie.c | 5 months ago | |
cubieboard.c | 7 months ago | |
digic.c | 5 months ago | |
digic_boards.c | 5 months ago | |
exynos4_boards.c | 5 months ago | |
exynos4210.c | 5 months ago | |
fby35.c | 4 months ago | |
fsl-imx6.c | 5 months ago | |
fsl-imx6ul.c | 5 months ago | |
fsl-imx7.c | 5 months ago | |
fsl-imx8mp.c | 2 months ago | |
fsl-imx25.c | 5 months ago | |
fsl-imx31.c | 5 months ago | |
highbank.c | 2 months ago | |
imx8mp-evk.c | 5 months ago | |
imx25_pdk.c | 7 months ago | |
integratorcp.c | 5 months ago | |
kzm.c | 5 months ago | |
max78000_soc.c | 2 months ago | |
max78000fthr.c | 2 months ago | |
mcimx6ul-evk.c | 7 months ago | |
mcimx7d-sabre.c | 7 months ago | |
meson.build | 2 months ago | |
microbit.c | 5 months ago | |
mps2-tz.c | 5 months ago | |
mps2.c | 3 months ago | |
mps3r.c | 5 months ago | |
msf2-soc.c | 5 months ago | |
msf2-som.c | 5 months ago | |
musca.c | 5 months ago | |
musicpal.c | 5 months ago | |
netduino2.c | 7 months ago | |
netduinoplus2.c | 7 months ago | |
npcm7xx.c | 2 months ago | |
npcm7xx_boards.c | 5 months ago | |
npcm8xx.c | 3 months ago | |
npcm8xx_boards.c | 4 months ago | |
nrf51_soc.c | 5 months ago | |
olimex-stm32-h405.c | 7 months ago | |
omap1.c | 4 months ago | |
omap_sx1.c | 4 months ago | |
orangepi.c | 5 months ago | |
raspi.c | 5 months ago | |
raspi4b.c | 5 months ago | |
realview.c | 5 months ago | |
sabrelite.c | 7 months ago | |
sbsa-ref.c | 2 months ago | |
smmu-common.c | 2 months ago | |
smmu-internal.h | 6 months ago | |
smmuv3-internal.h | 1 year ago | |
smmuv3.c | 5 months ago | |
stellaris.c | 5 months ago | |
stm32f100_soc.c | 5 months ago | |
stm32f205_soc.c | 1 week ago | |
stm32f405_soc.c | 5 months ago | |
stm32l4x5_soc.c | 5 months ago | |
stm32vldiscovery.c | 7 months ago | |
strongarm.c | 5 months ago | |
strongarm.h | 5 months ago | |
trace-events | 6 months ago | |
trace.h | 5 years ago | |
versatilepb.c | 5 months ago | |
vexpress.c | 5 months ago | |
virt-acpi-build.c | 2 months ago | |
virt.c | 6 days ago | |
xen-pvh.c | 2 months ago | |
xen-stubs.c | 5 months ago | |
xilinx_zynq.c | 5 months ago | |
xlnx-versal-virt.c | 5 months ago | |
xlnx-versal.c | 5 months ago | |
xlnx-zcu102.c | 5 months ago | |
xlnx-zynqmp.c | 5 months ago |