From patchwork Sat Aug 21 14:41:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 13427 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 13075BD87D for ; Sat, 21 Aug 2021 14:42:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6799868895; Sat, 21 Aug 2021 16:42:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="b1UQjcy1"; dkim-atps=neutral Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 842096025E for ; Sat, 21 Aug 2021 16:42:12 +0200 (CEST) Received: by mail-pj1-x1034.google.com with SMTP id j1so9152569pjv.3 for ; Sat, 21 Aug 2021 07:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PMNJWnJyzUTvcBmB3vK9FpV0+s/r993rcOkFR6rhk00=; b=b1UQjcy1eNNUjo9zw9Lm8SD9+4r+nCmSfiSg7MPgsXpFC/nTxS4cqBSm7crihtAYDq StQIHYVlJo7Xt7RY5DzgtMComnwVp/YwVuFOtHkP/4Az2Q8YYpbc0lBWjTn7sY2qndqb TEkKVYzg8zx9q1o8FpnlcZAQts4OsmC4iZmwjHHK+klgozW8yY7Prz/n1MmKqTqh8OiD ier2miqSxKYLp5hBtJEm6lzWpOI0TG2tlytBk5aA/v9Gi6HNR7yh64IANxr9RfiAJ5LC /W+OcKY4Mu9f/E9I0k6AA0nf7hvK9WqbWp+c8C9APq+4D7TEDSXMbqtPk0m/wMeKaoRl x2NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PMNJWnJyzUTvcBmB3vK9FpV0+s/r993rcOkFR6rhk00=; b=kSaUY/efWYN2eEV8yAvRBpsfYJq6kFIjLKA7b2JIGWH9X8uxr1E/rts+93b+JwPFX5 HGipsjXp2g7OqW/s4alGvK1v/PNO/zAWy4J8GojHFsEil+0Hbik3OBpkGBTJpODopQAX D1GW/UWvXvzOa5+u6VNGeFIO5jkE2IWhVg2ogUMg7qiYfJjoKRHyTtK4cdM0OrMIwLcc 455GokfBBZ4o4AcUaSarEFlWXPlQvB6vGy5rxG0OWQsFdFsgUlFPsyJBsY9VpkV5EWHO A8B2eqdc8ZMUOA9o8Mx69f+UQp2MyLy9U3DBEHcrdbYJ3+REG9TLKLDbTVGwxJG/IYA9 1vIQ== X-Gm-Message-State: AOAM530zbaVR5cx1k37YskOy3/XsvoLD4oRT+nJn8I2o4lUs//SL9szZ kXx8S1xjUSy3VLhCNh1F1vf7i2j2bdIZHA== X-Google-Smtp-Source: ABdhPJyTA4CRnxWFYSb1QrnD1jcLvWVZHHU/2v7sQcxgMqiMYLAltYO2Pg0LVhh+AwHxbPoV7UeHGQ== X-Received: by 2002:a17:90b:3ec3:: with SMTP id rm3mr10005528pjb.7.1629556930663; Sat, 21 Aug 2021 07:42:10 -0700 (PDT) Received: from localhost.localdomain ([110.226.224.21]) by smtp.googlemail.com with ESMTPSA id b20sm10199456pfl.9.2021.08.21.07.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Aug 2021 07:42:10 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Sat, 21 Aug 2021 20:11:45 +0530 Message-Id: <20210821144145.3077223-1-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] test: gstreamer: Disable gstreamer registry forks X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vedant Paranjape Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 DLLs. 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 DLL is loaded. Signed-off-by: Vedant Paranjape --- test/gstreamer/gstreamer_single_stream_test.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/test/gstreamer/gstreamer_single_stream_test.cpp b/test/gstreamer/gstreamer_single_stream_test.cpp index 349dcfa4..80e652eb 100644 --- a/test/gstreamer/gstreamer_single_stream_test.cpp +++ b/test/gstreamer/gstreamer_single_stream_test.cpp @@ -41,18 +41,13 @@ protected: * 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. + * then. Work around this issue by disabling spawning of a + * child helper process when rebuilding the registry. 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. */ -#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;