Re: [RFC PATCH v2] grep: allow for run time disabling of JIT in PCRE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, 29 Jul 2019, Carlo Marcelo Arenas Belón wrote:

>   $ git grep 'foo bar'
>   fatal: Couldn't JIT the PCRE2 pattern 'foo bar', got '-48'

My immediate reaction to this error message was: That's not helpful.
What is `-48` supposed to mean? Why do we even think it sensible to
throw such an error message at the end user? Can't we do a much better
job translating that into something that makes actual sense without
knowing implementation details?

But then, I realized that -48 must be a well-known constant in PCRE2,
and my reaction transformed into something much more hopeful: why don't
we detect the situation where the JIT'ed code was not actually
executable [*1*], and fall back to the non-JIT'ed code path ourselves,
without troubling the end user (maybe warning, but maybe better not lest
we annoy the user with something pointless)?

Even after finding out that -48 disappointingly means
PCRE2_ERROR_NOMEMORY (as opposed to something like
PCRE2_ERROR_CANNOT_EXECUTE_JIT_CODE), I like the idea of not bothering
end users and doing the sensible fallback under the hood.

Ciao,
Dscho

Footnote *1*: Why anybody would think it sensible to build a PCRE2 with
JIT on an OS that does not allow executing code that was written by the
same process is beyond me. Or is there a mode in OpenBSD that *does*
allow JIT'ed code to be executed?

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux