On Thu, May 14, 2020 at 01:40:23PM -0400, Wietse Venema wrote: > > A cursory glance at the PCRE2 docs suggests that we can ask libpcre > > to enforce more conservative limits before it runs out of stack, and > > it would presumably then unwind and return a recoverable error. > > That looks like a guessing game to me, because I doubt that libpcre > really knows how much stack space remains available, as that depends > on stack canaries and so on. > > Who know what happens when it runs out. Then, it will access an > invalid page and receive SIGSEGV.
No worse than before, but if we make a conservative guess we can avoid the segfaults. Alternatively, we could siglongjmp() out of a segfault handler, enabled around PCRE lookups, leaking whatever heap space libpcre may have allocated along the way, and log a more informative message, and thereby perhaps even avoid occasional service throttling in master that may happen if the service is killed by a signal. Just a thought... -- Viktor.