[FFmpeg-devel,1/2] tools/target_dec_fate.sh: print some statistics

Submitted by Michael Niedermayer on Dec. 29, 2018, 1:35 a.m.

Details

Message ID 20181229013519.8910-1-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer Dec. 29, 2018, 1:35 a.m.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 tools/target_dec_fate.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Moritz Barsnick Dec. 29, 2018, 9:47 a.m.
On Sat, Dec 29, 2018 at 02:35:18 +0100, Michael Niedermayer wrote:
> +        CACHED=$((CACHED+1))

I believe this is the sort of math that won't work on old, non-POSIX
Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
even matters.

Moritz
Derek Buitenhuis Dec. 29, 2018, 4:40 p.m.
On 29/12/2018 09:47, Moritz Barsnick wrote:
> I believe this is the sort of math that won't work on old, non-POSIX
> Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
> even matters.

I don't think we care about those, e.g.:

    ~/ffmpeg$ grep '+1)' configure
            eval ${pvar}_level=$(($level+1))
- Derek
Carl Eugen Hoyos Dec. 29, 2018, 7:09 p.m.
> Am 29.12.2018 um 17:40 schrieb Derek Buitenhuis <derek.buitenhuis@gmail.com>:
> 
>> On 29/12/2018 09:47, Moritz Barsnick wrote:
>> I believe this is the sort of math that won't work on old, non-POSIX
>> Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
>> even matters.
> 
> I don't think we care about those, e.g.:
> 
>    ~/ffmpeg$ grep '+1)' configure
>            eval ${pvar}_level=$(($level+1))

configure automatically chooses a (gnu) bash-compatible Shell on Solaris (this is impossible to avoid), all other FFmpeg scripts use another shell at least on some systems, this for example affects the versioning of shared libraries.

I find this difficult to test though.

Carl Eugen
Michael Niedermayer Jan. 4, 2019, 7:29 p.m.
On Sat, Dec 29, 2018 at 10:47:16AM +0100, Moritz Barsnick wrote:
> On Sat, Dec 29, 2018 at 02:35:18 +0100, Michael Niedermayer wrote:
> > +        CACHED=$((CACHED+1))
> 
> I believe this is the sort of math that won't work on old, non-POSIX
> Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
> even matters.

which platform without a posix /bin/sh supports the libfuzz stuff ?

thanks

[...]
Michael Niedermayer Jan. 15, 2019, 10:36 p.m.
On Fri, Jan 04, 2019 at 08:29:36PM +0100, Michael Niedermayer wrote:
> On Sat, Dec 29, 2018 at 10:47:16AM +0100, Moritz Barsnick wrote:
> > On Sat, Dec 29, 2018 at 02:35:18 +0100, Michael Niedermayer wrote:
> > > +        CACHED=$((CACHED+1))
> > 
> > I believe this is the sort of math that won't work on old, non-POSIX
> > Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
> > even matters.
> 
> which platform without a posix /bin/sh supports the libfuzz stuff ?

ping, is there any suggestion for improving this patch ?
or are all concerns resolved ?

thx

[...]
Carl Eugen Hoyos Jan. 15, 2019, 10:41 p.m.
2019-01-15 23:36 GMT+01:00, Michael Niedermayer <michael@niedermayer.cc>:
> On Fri, Jan 04, 2019 at 08:29:36PM +0100, Michael Niedermayer wrote:
>> On Sat, Dec 29, 2018 at 10:47:16AM +0100, Moritz Barsnick wrote:
>> > On Sat, Dec 29, 2018 at 02:35:18 +0100, Michael Niedermayer wrote:
>> > > +        CACHED=$((CACHED+1))
>> >
>> > I believe this is the sort of math that won't work on old, non-POSIX
>> > Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
>> > even matters.
>>
>> which platform without a posix /bin/sh supports the libfuzz stuff ?
>
> ping, is there any suggestion for improving this patch ?
> or are all concerns resolved ?

I believe adding more things that will not work on sunos is not
ideal.
But if there is no other way solving the issues that this patch
fixes, sunos is of course no show-stopper.

Carl Eugen
Michael Niedermayer Jan. 17, 2019, 9:21 p.m.
On Tue, Jan 15, 2019 at 11:41:22PM +0100, Carl Eugen Hoyos wrote:
> 2019-01-15 23:36 GMT+01:00, Michael Niedermayer <michael@niedermayer.cc>:
> > On Fri, Jan 04, 2019 at 08:29:36PM +0100, Michael Niedermayer wrote:
> >> On Sat, Dec 29, 2018 at 10:47:16AM +0100, Moritz Barsnick wrote:
> >> > On Sat, Dec 29, 2018 at 02:35:18 +0100, Michael Niedermayer wrote:
> >> > > +        CACHED=$((CACHED+1))
> >> >
> >> > I believe this is the sort of math that won't work on old, non-POSIX
> >> > Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
> >> > even matters.
> >>
> >> which platform without a posix /bin/sh supports the libfuzz stuff ?
> >
> > ping, is there any suggestion for improving this patch ?
> > or are all concerns resolved ?
> 
> I believe adding more things that will not work on sunos is not
> ideal.
> But if there is no other way solving the issues that this patch
> fixes, sunos is of course no show-stopper.

how can i test easily that a change work with such a non posix shell ?


[...]
Carl Eugen Hoyos Jan. 18, 2019, 11:48 a.m.
2019-01-17 22:21 GMT+01:00, Michael Niedermayer <michael@niedermayer.cc>:
> On Tue, Jan 15, 2019 at 11:41:22PM +0100, Carl Eugen Hoyos wrote:
>> 2019-01-15 23:36 GMT+01:00, Michael Niedermayer <michael@niedermayer.cc>:
>> > On Fri, Jan 04, 2019 at 08:29:36PM +0100, Michael Niedermayer wrote:
>> >> On Sat, Dec 29, 2018 at 10:47:16AM +0100, Moritz Barsnick wrote:
>> >> > On Sat, Dec 29, 2018 at 02:35:18 +0100, Michael Niedermayer wrote:
>> >> > > +        CACHED=$((CACHED+1))
>> >> >
>> >> > I believe this is the sort of math that won't work on old, non-POSIX
>> >> > Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
>> >> > even matters.
>> >>
>> >> which platform without a posix /bin/sh supports the libfuzz stuff ?
>> >
>> > ping, is there any suggestion for improving this patch ?
>> > or are all concerns resolved ?
>>
>> I believe adding more things that will not work on sunos is not
>> ideal.
>> But if there is no other way solving the issues that this patch
>> fixes, sunos is of course no show-stopper.
>
> how can i test easily that a change work with such a non posix shell ?

That is exactly what I don't know: Even on sunos it appears to
depend on settings that I don't understand.

Sorry, Carl Eugen

Patch hide | download patch | download mbox

diff --git a/tools/target_dec_fate.sh b/tools/target_dec_fate.sh
index 1fdfdcaaea..5e683676d1 100755
--- a/tools/target_dec_fate.sh
+++ b/tools/target_dec_fate.sh
@@ -43,6 +43,9 @@  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
 
+CACHED=0
+DOWNLOADED=0
+FAILED2DOWNLOAD=0
 #Download testcases
 while read -r LINE; do
     ISSUE_NUM=`echo $LINE | sed 's#/.*##'`
@@ -50,10 +53,12 @@  while read -r LINE; do
     FILE=`echo $LINE | sed 's# .*##'`
     if test -f "$1/$FILE" ; then
         echo exists       $FILE
+        CACHED=$((CACHED+1))
     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"
+        wget -O "$1/$FILE" "https://oss-fuzz.com/download?testcase_id=$FILE_ID" || ( rm "$1/$FILE" ; FAILED2DOWNLOAD=$((FAILED2DOWNLOAD+1)) )
+        DOWNLOADED=$((DOWNLOADED+1))
     fi
 done < "$LIST"
 
@@ -75,4 +80,4 @@  while read -r LINE; do
     tools/$TOOL_ID $1/$FILE
 done < "tools/$LIST"
 
-echo OK
+echo OK cached:$CACHED downloaded:$DOWNLOADED failed to download:$FAILED2DOWNLOAD