This commit is truly horrible.
We want to run ASan with leak checking enabled in CI so we can catch
memory leaks before they're introduced. This works well with Pixman, and
with NIR-only drivers like iris or Panfrost.
But when we run under llvmpipe - which we do under CI - we start failing
because:
- Mesa pulls in llvmpipe via dlopen
- llvmpipe pulls in LLVM itself via DT_NEEDED
- initialising LLVM's global type/etc systems performs thread-local
allocations
- llvmpipe can't free those allocations since the application might
also be using LLVM
- Weston stops using GL and destroys all GL objects, leading to Mesa
unloading llvmpipe like it should
- with everything disappearing from the process's vmap, ASan can no
longer keep track of still-reachable pointers
- tests fail because LLVM is 'leaking'
Usually, an alternative is to LD_PRELOAD a shim which overrides
dlclose() to be a no-op. This is not usable here, because when
$LD_PRELOAD is not empty and ASan is not first in it, ASan immediately
errors out. Prepending ASan doesn't work, because we run our tests
through Meson (which also invokes Ninja), leading to LSan exploding
over CPython and Ninja, which is not what we're interested in.
It would be possible to inject _both_ ASan and a dlclose-does-nothing
shim DSO into the LD_PRELOAD environment for every test, but that seems
even worse, especially as Meson strongly discourages globbing for random
files in the root.
So, here we are, doing what we can: finding where swrast_dri.so (aka
llvmpipe) lives, stashing that in an environment variable, and
deliberately leaking a dlopen handle which we never close to ensure that
neither llvmpipe nor LLVM leave our process's address space before we
exit.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Unfortunately just adding suppressions isn't enough; the build of Expat
we have in our CI system does not have frame pointers, so ASan's fast
unwinder can't see through it. This means that the suppressions we've
added won't be taken into account.
For now, disable the fast unwinder for the Xwayland test only. Disabling
it globally is not practical as it massively increases the per-test
runtime, so here (to avoid polluting the build system), we use a
per-test wrapper to selectively choose the unwinder.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Add VGEM to the Linux image that runs in the CI. There are tests that we
plan to add in the future that need this.
This brings a complication, as we already have VKMS in the image. The
order in which DRM devices are loaded is not always the same, so the
node they receive is non-deterministic. Until now we were sure that VKMS
(the virtual device we use to run the DRM-backend tests in the CI) would
be in "/dev/dri/card0", but now we can't be sure. To deal with this
problem we find the node of each device using a one-liner shell script.
This commit also updates the documentation section that describes
specificities of DRM-backend tests in our test suite.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This was previously introduced with commit '.gitlab.ci: Enable debug for
libsteat and for the DRM backend' in order to figure out another CI
issue we were seeing.
Unfortunatelly, not keeping the return value after the tests ran it
would silently make the entire CI succeed when it should actually fail.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Pekka Paalanen <pekka.paalanen@collabora.com>
As the drm-smoke test randomly reports having the connector disabled,
and with it libseat reports setMaster errors, this enables DRM backend
debug messages for the kernel, and for libseat in an attempt to
track down the issue, whenever it might happen again.
These are pretty harmless, in terms of data being generated as we only
have a single DRM test using VKMS, and the libseat debug message aren't
that verbose, so we're safe keeping them for the time being.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Instead of manually waiting for the seatd socket to come up, use
seatd-launch.
Add /usr/local/bin to PATH to avoid having to specify the whole
path to seatd-launch.
Signed-off-by: Simon Ser <contact@emersion.fr>
Running under ASan introduces a good amount of overhead. Using the Meson
test wrapper rather than invoking a Ninja target lets us set a timeout
multiplier, which we smash up pretty high to account for this overhead
and prevent some of the larger tests from hitting timeout.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Use address sanitizer to catch use-after-free and other errors when
running the test suite.
Leak detection is disabled, because currently there are too many leaks,
making almost all tests fail otherwise.
The atexit=1 is for verifying that ASan was actually used.
The default 128 MB of RAM in the qemu machine leads to oom-killer
killing most tests, so bump the memory size to 1 GB.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
While the commonly used Weston launchers are weston-launch and launcher-logind,
the direct backend was used in CI out of convenience, and due to logind being a
bit cumbersome to get to work in a CI environment.
The new libseat launcher can be used with seatd as well as logind. seatd is easy
to start in a CI environment, allowing us to test the libseat launcher codepath
instead of the less user relevant direct launcher.
This also prepares us for the future intended removal of non-libseat launchers.
Signed-off-by: Kenny Levinsen <kl@kl.wtf>
In order to run DRM-backend tests, a DRM-device is needed. As we
do not necessarily have control of the hardware that is going to
run our tests in GitLab CI, DRM-backend tests were being skipped.
This patch add support to run the tests using VKMS (virtual KMS).
To achieve this, virtualization is needed, as we need to run a
custom kernel during the CI job. We've decided to go with virtme,
as it is simpler to setup and works good for our use case.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>