From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 23C084BF9A for ; Mon, 28 Jul 2025 00:35:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 4624A68D73B; Mon, 28 Jul 2025 03:35:17 +0300 (EEST) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 74A9A68CBD2 for ; Mon, 28 Jul 2025 03:35:10 +0300 (EEST) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-60c4521ae2cso6791727a12.0 for ; Sun, 27 Jul 2025 17:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753662909; x=1754267709; darn=ffmpeg.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=sXVZw7MhPOd/KaLwCzhJ84ROhB+Xl4BsO6eq/oYPAn8=; b=nkQ8MbbuTO/S4dPHK2Sjo8NWBpRY+oWTGImsQnWoLmofPVPGwCOSwawo3pBoN1PsEB RqJ/BIX/Mce9N4yDGBj0nnTvL7ygGx4hqvgQXQx0XzLlEQvNHyLxGbqILqJYv3tslYKO Y2DiqkbEXNqSFo2jSbHBvnmGdpWeAQgtk48HLznvtE0ZwEmxEwfwgbRYhAamMTuCeypQ u5ywH8n9NNEQUSTamUDHd4lhee3rTYqW7ibWru1Nn/qnBPso6i2yejj++BQV9nTVtScf 7q24/rOu/eD8dLjVxIPjJ3t/To8e5k1nE40ZzwmwhPM6Fft1Fi6liAXIUUv8kKvownqZ L4ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753662909; x=1754267709; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sXVZw7MhPOd/KaLwCzhJ84ROhB+Xl4BsO6eq/oYPAn8=; b=GCaFuU39v9A3SBTsRHTpm7lR1LjB7bM9WKj52G3/UCJFb9f6neypUPFuofxuDn2ZhS kEhcMC6zqZMM65gmG+dRBAwAkRXBbrLcji7xJ7HiYxeByJqxegWdkHFfW1oa0f60frAh 4DfwKWlnmMDNkGV/2spMeCYyAy7DohUQeNaEggVhS5GA0XDLdyF+h7u6ZXOOQc310nEq rDHwLAsrCVuhGztSdF97e9GiSC9hMX1OvVdjt1kciZilsaIayNDYNV3pwfqshGG9b9HQ +vBwCAYESWv9lnsxRqgEXgYd2RTnEb2OM8v2dwA/fBDS/0WTdSrPKfc3jJCw1it+Jn90 ZYwg== X-Gm-Message-State: AOJu0Yw8Y17WS1pb2+DDpscfK2kHQDrF7HsB/CvmqKvLgEccwngweLbw WrJ+VEVsrWXbnC+uD851Mad6auLFv4pGVMeBT0vp8tCdO8g7ReVwYzlNH9pCRQ70A74tcTr4DQ2 zMeSfVzATWeHjaMYPwfVLe/35cq2UcoKhI7Zg X-Gm-Gg: ASbGncvqCT4Xmx3PIkhveHrwKVjGpSlVp7TQPWGw5yHW3QDuCHPEX/sY+RfUgpH7vJm qGhSgjf0oi3H6xqPnu+5arVEIK5yCwHX8iDEswAhWN38F/TEA2NVdXQ/EDg220U53CeQwOd4Dxh MLb4sb/7Nv+TlQ9nQSj4E9j2d2+Snfn0oNRpusSk3HHYOGI6ZFMz/9+DgEBSn1i5OfXhH9jDoKd wQM X-Google-Smtp-Source: AGHT+IH7lHSPe+FaJvP50keN2C02/IvT1oij5WgjDHtVn4p47m9W5gVzo4heOXbjB+GKazn1LgWB/zZVl4JmahUfoIs= X-Received: by 2002:a05:6402:2692:b0:615:127f:6b8a with SMTP id 4fb4d7f45d1cf-615127f6e00mr4758825a12.30.1753662908863; Sun, 27 Jul 2025 17:35:08 -0700 (PDT) MIME-Version: 1.0 References: <19ac6efe-69be-438e-a87b-ca9c91ab9290@gmail.com> In-Reply-To: <19ac6efe-69be-438e-a87b-ca9c91ab9290@gmail.com> From: Kacper Michajlow Date: Mon, 28 Jul 2025 02:34:23 +0200 X-Gm-Features: Ac12FXwK75ys13vZKNKlr8Zp8cV7f3n6vIQhvfkByKAguE9V5SlcvsNmMeLm2ZA Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH v3] avformat/avisynth: fix segfault when also compiled with libvmaf X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Mon, 28 Jul 2025 at 02:04, Daniel Bermond wrote: > > When FFmpeg is compiled with support for both avisynth and libvmaf, > a segmentation fault occurs when using avisynth (.avs) input. > > This happens because both avisynthplus and vmaf have the exactly > same C++ symbol 'Cache::~Cache()'[1][2], which is a C++ destructor. > When using avisynth input, this destructor is also called in the > vmaf side, although no vmaf object was created, thus causing a > segmentation fault. > > Without changing this conflicting symbol in avisynthplus and/or > vmaf upstream code, a solution is to switch the 'RTLD_LOCAL'[3] I'm not opposed to a workaround to the issues as an interim solution, but has this issue been reported to upstream? Classes with such generic names should be put in a namespace in the respective projects. Additionally it would be good for those projects to be built with -fvisibility=hidden to reduce the amount of exposed symbols and only expose API entry points. - Kacper > flag for 'RTLD_DEEPBIND'[4] when calling 'dlopen()' on the > avisynthplus library. This will make the avisynthplus symbols > loaded by 'dlopen()' to be ahead of the symbols loaded in the > global scope, and consequently avoid the segmentation fault by > preventing the conflicting vmaf C++ destructor to be called. > > More details can be seen in the discussion of the Arch Linux bug > report[5] about this issue. > > [1] https://github.com/AviSynth/AviSynthPlus/blob/v3.7.5/avs_core/core/cache.h#L62 > [2] https://github.com/Netflix/vmaf/blob/v3.0.0/libvmaf/src/svm.cpp#L75 > [3] https://man.archlinux.org/man/dlopen.3#RTLD_LOCAL > [4] https://man.archlinux.org/man/dlopen.3#RTLD_DEEPBIND > [5] https://gitlab.archlinux.org/archlinux/packaging/packages/ffmpeg/-/issues/19 > > Signed-off-by: Daniel Bermond > --- > libavformat/avisynth.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c > index cb2be10925..bef61b4a60 100644 > --- a/libavformat/avisynth.c > +++ b/libavformat/avisynth.c > @@ -120,7 +120,7 @@ typedef struct AviSynthContext { > > static av_cold int avisynth_load_library(AviSynthContext *avs) > { > - avs->avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_LOCAL); > + avs->avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_DEEPBIND); > if (!avs->avs_library.library) > return AVERROR_UNKNOWN; > > -- > 2.50.1 > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".