[Privoxy-devel] how costly is --enable-strptime-sanity-checks ?

Fabian Keil fk at fabiankeil.de
Sun May 1 13:06:19 UTC 2016


Lee <ler762 at gmail.com> wrote:

> On 4/30/16, Fabian Keil <fk at fabiankeil.de> wrote:
> > Lee <ler762 at gmail.com> wrote:
> >  
> >> Looking on the bright side, the nice thing about migrating to the
> >> cygwin cross-compiler is that I get to learn so many new things :)
> >>
> >> How expensive would it be it to have --enable-strptime-sanity-checks
> >> default to on?  
> >
> > It should be fairly inexpensive. It has been enabled by default by the
> > FreeBSD port for a couple of years and nobody complained about it.
> >  
> >> dunno if this means anything or not, but this is the rabbit hole I'm
> >> going down now:
> >>
> >> ./configure --build=i686-pc-cygwin --host=i686-w64-mingw32
> >> --enable-mingw32  --enable-strptime-sanity-checks  --enable-zlib
> >>
> >> $ grep "Error: Failed to parse" privoxy.log
> >> 2016-04-29 19:18:50.638 00000270 Error: Failed to parse '' generated
> >> with '%a, %d %b %Y %H:%M:%S' to recreate 'Mon, 1 Jan 2525 00:00:00  
> > [...]  
> >> 2016-04-29 19:18:51.793 0000027c Error: Failed to parse '' generated
> >> with '%a, %d %b %Y %H:%M:%S' to recreate 'Wed, 31 Dec 1969 23:59:59
> >> GMT'.  
> >
> > I believe a 32 bit time_t would explain these failures.  
> 
> except it sure looks like size_t is 32 bits using gcc -mno-cygwin or
> i686-w64-mingw32-gcc
> ./configure comes back with
>   checking size of size_t... 4
> for both.

Why should the size of size_t affect the size of time_t?

I'm not saying it can't possibly be 4 bytes as well, but I don't
consider it an obvious conclusion.

> > I hindsight it's a bit disappointing that they haven't been
> > reported for other platforms so far.  
> 
> Maybe it works on all the other platforms?  It's only when using the
> new cross-compiler that I see those regression test failures.  Using
> the old gcc.v3 -mno-cygwin build I don't get any regression test
> failures.

The sanity check only detects inconsistencies between strptime()
and strftime() as this was sufficient to detect the FreeBSD libc bug.
If both fail consistently the check may not catch it.

In your example above strftime() seems to reject the date completely,
but on other platforms it could silently produce incorrect results.

Privoxy-Regression-Test doesn't properly check the times either
and will not detect all possible failures.

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-devel/attachments/20160501/536dfe24/attachment.bin>


More information about the Privoxy-devel mailing list