Re: [INTERNALS-WIN] Appveyor build failure

[email protected] (Anatol Belski) Wed, 14 Nov 2018 19:18:35 +0000
Newsgroups php.internals.win
Message-ID <AM6PR0502MB384870C559776AB1DECB0B4BC0C30@AM6PR0502MB3848.eurprd05.prod.outlook.com>
Hi Christoph,

On Wed, 2018-11-14 at 18:48 +0100, Christoph M. Becker wrote:
> Hi!
> 
> I've noticed quite a lot Appveyor build failures recently.  A
> particular
> problem appears to be ext\fileinfo\tests\cve-2014-3538-nojit.phpt[1],
> which is supposed to be finished in one second, but run slightly
> longer
> mostly[2].
> 
> Anatol, should we simply increase the allowed time (to, say, 1.5
> sec),
> or is there an underlying issue which would better be solved instead?
> 
I was just working on a possible data fix for this. The issue is, that
some patterns in the vanilla data switched to posix character classes,
which impacts the performance when pcre.jit=0. For 7.2 it was fixed by
partially reverting the custom data patches, but for 7.3 - the libmagic
version contains all that data. While it makes some particular cases a
bit slower with pcre.jit=0, it's quite far from what the original CVE
is about.

My current approach is to reduce the input size on the offending
patterns in the vanilla data, which however might cause some rare
functional regression. So it needs to be checked and future libmagic
integration will have to be reconsidered anyway. Alternatively yes -
the max time can be increased a bit so the test doesn't cause false
positives. I'm going to push a patch today, so it can be observed for a
couple of days. If there are any issues, it can be reverted and the max
time can be increased instead.

Regards

Anatol