[pcre-dev] [Bug 2575] New: RE unsafe in static initializers

Top Page

Reply to this message
Author: admin
To: pcre-dev
Subject: [pcre-dev] [Bug 2575] New: RE unsafe in static initializers

            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: ph10@???
          Reporter: billy.donahue@???
                CC: pcre-dev@???

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

    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.