[libcamera-devel,v1] test: gstreamer: Disable gstreamer registry forks
diff mbox series

Message ID 20210821085233.2997872-1-vedantparanjape160201@gmail.com
State Accepted
Headers show
Series
  • [libcamera-devel,v1] test: gstreamer: Disable gstreamer registry forks
Related show

Commit Message

Vedant Paranjape Aug. 21, 2021, 8:52 a.m. UTC
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.

Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
---
 test/gstreamer/gstreamer_single_stream_test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart Aug. 21, 2021, 1:47 p.m. UTC | #1
Hi Vedant,

Thank you for the patch.

On Sat, Aug 21, 2021 at 02:22:33PM +0530, Vedant Paranjape wrote:
> 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.
> 
> Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
> ---
>  test/gstreamer/gstreamer_single_stream_test.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/gstreamer/gstreamer_single_stream_test.cpp b/test/gstreamer/gstreamer_single_stream_test.cpp
> index 349dcfa4..7b0b7676 100644
> --- a/test/gstreamer/gstreamer_single_stream_test.cpp
> +++ b/test/gstreamer/gstreamer_single_stream_test.cpp
> @@ -52,7 +52,7 @@ protected:
>  #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);

With this, we don't need to skip the test anymore even with gcc 7, as
while the verify_asan_link_order option isn't available in gcc 7, it's
not required anymore with gst_registry_fork_set_enabled().

The commit message needs to be expanded, as it doesn't explain why
gst_registry_fork_set_enabled() can replace verify_asan_link_order=0.

>  
>  		/* Initialize GStreamer */
>  		g_autoptr(GError) errInit = NULL;
Vedant Paranjape Aug. 21, 2021, 2:16 p.m. UTC | #2
Hello Laurent,

On Sat, 21 Aug, 2021, 19:18 Laurent Pinchart, <
laurent.pinchart@ideasonboard.com> wrote:

> Hi Vedant,
>
> Thank you for the patch.
>
> On Sat, Aug 21, 2021 at 02:22:33PM +0530, Vedant Paranjape wrote:
> > 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.
> >
> > Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
> > ---
> >  test/gstreamer/gstreamer_single_stream_test.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/test/gstreamer/gstreamer_single_stream_test.cpp
> b/test/gstreamer/gstreamer_single_stream_test.cpp
> > index 349dcfa4..7b0b7676 100644
> > --- a/test/gstreamer/gstreamer_single_stream_test.cpp
> > +++ b/test/gstreamer/gstreamer_single_stream_test.cpp
> > @@ -52,7 +52,7 @@ protected:
> >  #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);
>
> With this, we don't need to skip the test anymore even with gcc 7, as
> while the verify_asan_link_order option isn't available in gcc 7, it's
> not required anymore with gst_registry_fork_set_enabled().
>

But the test still fails due to memory leaks in Gstreamer. This only fixes
the Asan being loaded after gstreamer.

The commit message needs to be expanded, as it doesn't explain why
> gst_registry_fork_set_enabled() can replace verify_asan_link_order=0.
>

I understand why we need to use verify asan link, but I don't understand
why disabling the child helper process while building the registry makes
sure that Asan is the first DLL to load.
If you could clarify that.

>
> >               /* Initialize GStreamer */
> >               g_autoptr(GError) errInit = NULL;
>
> --
> Regards,
>
> Laurent Pinchart


>
Regards,
*Vedant Paranjape*

Patch
diff mbox series

diff --git a/test/gstreamer/gstreamer_single_stream_test.cpp b/test/gstreamer/gstreamer_single_stream_test.cpp
index 349dcfa4..7b0b7676 100644
--- a/test/gstreamer/gstreamer_single_stream_test.cpp
+++ b/test/gstreamer/gstreamer_single_stream_test.cpp
@@ -52,7 +52,7 @@  protected:
 #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;