From patchwork Mon Sep 10 00:22:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 10286 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp1898620jap; Sun, 9 Sep 2018 17:22:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbdjnXQlzuLWqUnvq3PrG5GGpCqTEkoX5ZaBCL3cVfmok49WzYLexq+wTUY9dr3XnGqfHC/ X-Received: by 2002:a1c:e00a:: with SMTP id x10-v6mr11543821wmg.58.1536538974376; Sun, 09 Sep 2018 17:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536538974; cv=none; d=google.com; s=arc-20160816; b=nU3MZqWbuoqlkbY8Rc25vOWRZbJo3OV8PyRPLoU2xKZrYHKrPrsJAr0y/G0Ek0ZbHD L25NZI8JABAkIEiOpDHlVfaFjyi4zrLNFuTWXUXc3+448h4DyRTJBeGkd7SxH3j8PuDo dYlwKqKSkfdtKtB63GEcz2KoFvlpyD2dnlI3szJS4hnrXQaf0W31QUjXMHtRQ73qbQ+V qya4H7uLdIu9T6gmqacbxvq6Vs+PhA0mHFPZ2Ds6BbiOHMd2z9VHu1pS8YEULDdO/OC1 hJgThAYDC194Zxc2k88vsXYidNJI9NYzo65fZWlzcB/Fy7lQUbFlyHT4bd8y0hA1dV8E ZZdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=Xf4ZL0l17M6UiVXqN1yb6W7KvjGIe0noP84xkDvoakQ=; b=W726pwzC+VpZxJVhy3wxXuNJbReMVh3PFqStk4vePt+0onw7PqapVcMK27CSOzOf34 cUg6gNBhz8sbWB9XTjcPzZTzTICS/ihq63anml0UYWUTin6KloLtu99/DbH9xyYcrztj qAA9L0pQ/SLK4sKWGCAamWiWUFaOL3v5kepx8tWQMWdAq5GkAw8N6JVfG/rsAP3gMdPs 1Sg7ttWdkOeKbim89XsvSoDZyitFtoWlehs8kfmU8TVOWRPX3Zq5qe9bGANojU8zz7cc Jp0Ok7VwZ5Cmf816XZDlpqs9+7inj4eEpo3qBx1Z9oovGvVqbAtBIksoUOkrBTaVcHKQ RE2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 187-v6si11853398wmz.126.2018.09.09.17.22.53; Sun, 09 Sep 2018 17:22:54 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D6F8C68A339; Mon, 10 Sep 2018 03:22:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-1.mx.upcmail.net (vie01a-qmta-pe02-1.mx.upcmail.net [62.179.121.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 86F0F689F95 for ; Mon, 10 Sep 2018 03:22:36 +0300 (EEST) Received: from [172.31.218.48] (helo=vie01a-dmta-pe06-3.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fz9yX-0004Q4-9J for ffmpeg-devel@ffmpeg.org; Mon, 10 Sep 2018 02:22:45 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fz9yR-0005N6-ER for ffmpeg-devel@ffmpeg.org; Mon, 10 Sep 2018 02:22:39 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id ZcNd1y00A0S5wYM01cNePH; Mon, 10 Sep 2018 02:22:38 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 10 Sep 2018 02:22:06 +0200 Message-Id: <20180910002206.30613-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 Subject: [FFmpeg-devel] [PATCH] tools: add target_dec_fate.sh X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Script to download and test ossfuzz testcases This also includes a list of such testcases. I intend to subsequently fill this list with the cases we have fixed in the past Signed-off-by: Michael Niedermayer --- tools/target_dec_fate.list | 6 ++++ tools/target_dec_fate.sh | 62 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 tools/target_dec_fate.list create mode 100755 tools/target_dec_fate.sh diff --git a/tools/target_dec_fate.list b/tools/target_dec_fate.list new file mode 100644 index 0000000000..e0509aaa64 --- /dev/null +++ b/tools/target_dec_fate.list @@ -0,0 +1,6 @@ +544/clusterfuzz-testcase-5936536407244800.f8bd9b24_8ba77916_70c2c7be_3df6a2ea_96cd9f14 target_dec_interplay_video_fuzzer +724/clusterfuzz-testcase-6738249571631104 target_dec_pictor_fuzzer +1214/clusterfuzz-testcase-minimized-6130606599569408 target_dec_h264_fuzzer +5264/clusterfuzz-testcase-minimized-4621956621008896 target_dec_indeo5_fuzzer +7279/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5977332473921536 target_dec_g2m_fuzzer +10053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5636993883570176 target_dec_prosumer_fuzzer diff --git a/tools/target_dec_fate.sh b/tools/target_dec_fate.sh new file mode 100755 index 0000000000..d4e11955ac --- /dev/null +++ b/tools/target_dec_fate.sh @@ -0,0 +1,62 @@ +#!/bin/sh +# +# Copyleft (c) Michael Niedermayer + +set -e + +LC_ALL=C +export LC_ALL + +LIST=target_dec_fate.list + +show_help(){ + cat < [] + +directory the directory into which sample files will be downloaded +test to run the number of the issue to test +Note, some test samples may not yet be available to the public, also this +script will not download samples which are already in the directory. So you +may want to preserve its content between runs. +EOF + exit 0 +} + +test -z "$1" && show_help +test ! -d "$1" && echo $1 is not an accessable directory && show_help +test ! -f target_dec_fate.sh && echo $0 Must be run from its location && show_help +grep 'CONFIG_OSSFUZZ 0' ../config.h && echo not configured for ossfuzz && show_help + +#Download testcases +while read -r LINE; do + ISSUE_NUM=`echo $LINE | sed 's#/.*##'` + FILE_ID=`echo $LINE | sed 's#.*/clusterfuzz-testcase[a-zA-Z0-9_-]*-\([0-9]*\).*#\1#'` + FILE=`echo $LINE | sed 's# .*##'` + if test -f "$1/$FILE" ; then + echo exists $FILE + else + echo downloading $FILE + mkdir -p "$1/$ISSUE_NUM" + wget -O "$1/$FILE" "https://oss-fuzz.com/download?testcase_id=$FILE_ID" || rm "$1/$FILE" + fi +done < "$LIST" + +#Find which fuzzers we need to build +TOOLS= +while read -r LINE; do + TOOL_ID=`echo $LINE | sed 's#[^ ]* ##'` + TOOLS="$TOOLS tools/$TOOL_ID" +done < "$LIST" + +cd .. +#Build fuzzers +make -j4 $TOOLS + +#Run testcases +while read -r LINE; do + TOOL_ID=`echo $LINE | sed 's#[^ ]* ##'` + FILE=`echo $LINE | sed 's# .*##'` + tools/$TOOL_ID $1/$FILE +done < "tools/$LIST" + +echo OK \ No newline at end of file