Re: [PATCH v2 01/15] virmock: Initialize both symbols in VIR_MOCK_REAL_INIT_ALT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 07, 2019 at 10:29:11AM +0100, Michal Privoznik wrote:
> It may happen that both symbols are present. Especially when
> chaining mocks. For instance if a test is using virpcimock and
> then both stat and __xstat would be present in the address space
> as virpcimock implements both. Then, if the test would try to use
> say virfilewrapper (which again uses VIR_MOCK_REAL_INIT_ALT() to
> init real_stat and real___xstat) it would find stat() from
> virpcimock and stop there. The virfilewrapper.c:real___xstat
> wouldn't be initialized and thus it may result in a segfault.
> 
> The reason for segfault is that sys/stat.h may redefine stat() to
> call __xstat().
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  tests/virmock.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>

This looks independant of the series so can just be pushed

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux