https://bugs.exim.org/show_bug.cgi?id=2575

            Bug ID: 2575
           Summary: RE unsafe in static initializers
           Product: PCRE
           Version: 8.44
          Hardware: All
                OS: All
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: p...@hermes.cam.ac.uk
          Reporter: billy.dona...@gmail.com
                CC: pcre-dev@exim.org

ASAN reports an initialization order fiasco when I create an RE to initialize a
static-duration variable, because the static `default_options` variable hasn't
been initialized yet.

In RE::Init, line 106 of pcrecpp.cc, here
https://vcs.pcre.org/pcre/code/trunk/pcrecpp.cc?annotate=1763&pathrev=1763

    options_ = default_options;

But default_options was defined on line 82 as a nonlocal static.

static RE_Options default_options;


There are lots of fixes.
One fix might be to bring default_options inside the Init function.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-- 
## List details at https://lists.exim.org/mailman/listinfo/pcre-dev 

Reply via email to