libvirt/src/node_device
Roman Bogorodskiy 6114807477 tests: fix segfault in objecteventtest
Test 12 from objecteventtest (createXML add event) segaults on FreeBSD
with bus error.

At some point it calls testNodeDeviceDestroy() from the test driver. And
it fails when it tries to unlock the device in the "out:" label of this
function.

Unlocking fails because the previous step was a call to
virNodeDeviceObjRemove from conf/node_device_conf.c. This function
removes the given device from the device list and cleans up the object,
including destroying of its mutex. However, it does not nullify the pointer
that was given to it.

As a result, we end up in testNodeDeviceDestroy() here:

 out:
    if (obj)
        virNodeDeviceObjUnlock(obj);

And instead of skipping this, we try to do Unlock and fail because of
malformed mutex.

Change virNodeDeviceObjRemove to use double pointer and set pointer to
NULL.
2016-08-29 13:51:56 +03:00
..
node_device_driver.c node_device: implement node device lifecycle event APIs 2016-08-02 09:52:00 -04:00
node_device_driver.h node_device: implement node device lifecycle event APIs 2016-08-02 09:52:00 -04:00
node_device_hal.c tests: fix segfault in objecteventtest 2016-08-29 13:51:56 +03:00
node_device_hal.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
node_device_linux_sysfs.c pci: Fix virPCIGetPhysicalFunction()'s callers 2016-05-25 10:38:01 +02:00
node_device_linux_sysfs.h node_device: new functions to get sriov/iommu info from sysfs 2015-05-18 10:31:58 -04:00
node_device_udev.c tests: fix segfault in objecteventtest 2016-08-29 13:51:56 +03:00
node_device_udev.h Remove PROPERTY_* constants 2016-06-07 12:53:37 +02:00