diff options
author | Vedant Paranjape <vedantparanjape160201@gmail.com> | 2021-08-21 20:11:45 +0530 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-08-26 16:36:14 +0300 |
commit | af1f731f473fd66cb3c6a9764b5204af3ed6bc88 (patch) | |
tree | 3455b80730a349841af7eb431cb80a3333391b96 /test | |
parent | dac58fdd2a84e2e00a90f3c568c57972c0be0b6f (diff) |
test: gstreamer: Disable gstreamer registry forks
ASan needs to be loaded first before gstreamer is loaded. This was not
possible, so verify_asan_link_order was disabled. Better way to tackle
this issue was disabling forks on the gstreamer side.
verify_asan_link_order=0 disables the check on ASan side which checks if
ASan was loaded before any other shared objects. Since, gstreamer spawns
a child helper process while building the registry, we needed to disable
this check. But with gst_registry_fork_set_enabled() it is possible to
disable spawning this child helper process, so this ensures that ASan is
loaded before any other shared object is loaded.
Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/gstreamer/gstreamer_single_stream_test.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/test/gstreamer/gstreamer_single_stream_test.cpp b/test/gstreamer/gstreamer_single_stream_test.cpp index 349dcfa4..4c8d4804 100644 --- a/test/gstreamer/gstreamer_single_stream_test.cpp +++ b/test/gstreamer/gstreamer_single_stream_test.cpp @@ -36,23 +36,16 @@ protected: int init() override { /* - * GStreamer spawns a process to run the gst-plugin-scanner - * helper. If libcamera is compiled with ASan enabled, and as - * GStreamer is most likely not, this will cause the ASan link - * order check to fail when gst-plugin-scanner dlopen()s the - * plugin as many libraries will have already been loaded by - * then. Work around this issue by disabling the link order - * check. This will only affect child processes, as ASan is - * already loaded for this process by the time this code is - * executed, and should thus hopefully be safe. - * - * This option is not available in gcc older than 8, the only - * option in that case is to skip the test. + * GStreamer by default spawns a process to run the + * gst-plugin-scanner helper. If libcamera is compiled with ASan + * enabled, and as GStreamer is most likely not, this causes the + * ASan link order check to fail when gst-plugin-scanner + * dlopen()s the plugin as many libraries will have already been + * loaded by then. Fix this issue by disabling spawning of a + * child helper process when scanning the build directory for + * plugins. */ -#if defined(__SANITIZE_ADDRESS__) && !defined(__clang__) && __GNUC__ < 8 - return TestSkip; -#endif - setenv("ASAN_OPTIONS", "verify_asan_link_order=0", 1); + gst_registry_fork_set_enabled(false); /* Initialize GStreamer */ g_autoptr(GError) errInit = NULL; |