[pcre-dev] [Bug 2395] New: pcre_exec does not show estimated…

Αρχική Σελίδα
Delete this message
Συντάκτης: admin
Ημερομηνία:  
Προς: pcre-dev
Αντικείμενο: [pcre-dev] [Bug 2395] New: pcre_exec does not show estimated stack usage with -O2 or higher
https://bugs.exim.org/show_bug.cgi?id=2395

            Bug ID: 2395
           Summary: pcre_exec does not show estimated stack usage with -O2
                    or higher
           Product: PCRE
           Version: 8.43
          Hardware: x86-64
                OS: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: nikitamalyavin@???
                CC: pcre-dev@???


pcre_exec has a documented feature to return an estimated stack usage. See
https://www.pcre.org/original/doc/html/pcreapi.html#TOC1.

However,
pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0)
returns -4 (PCRE_ERROR_BADMAGIC) on Arch Linux with latest pcre (as of now it
is 8.43, but the problem is also present in 8.39, which maps to Ubuntu 19.04
version).

See build recipe here:
https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/pcre
The package is compiled with -O2 option, which can be proven by this log:
https://tests.reproducible-builds.org/archlinux/core/pcre/build1.log

Enabling -O1 solves the problem.

It was originally found in MariaDB and is solved for bundled pcre by marking
match() function with __attribute__((noinline,noclone)) for gcc/clang

https://github.com/MariaDB/server/commit/440157cbbe796b6b9a44a3de46bbb93d0cb5a77c#diff-6d7bc8269eeb8880d60132dcf64b4be6R514

So it's reasonable to make same solution here in upstream

--
You are receiving this mail because:
You are on the CC list for the bug.