Opened 2 years ago

Last modified 2 years ago

#58437 new defect

pcre, pcre2 jit libraries hang calling functions, resulting in segmentation faults

Reported by: essandess (Steve Smith) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: larryv (Lawrence Velázquez)
Port: pcre pcre2

Description (last modified by essandess (Steve Smith))

The pcre, pcre2 jit libraries hang when called in some situations, causing segmentation faults.

This is observed when they are used as dependencies for https://github.com/rspamd/rspamd.

Here's a core dump trace using pcre: https://github.com/rspamd/rspamd/issues/2884#issuecomment-489235483

The offending routines in this example are: sljit_free_code and _pcre_jit_compile.

See this PR for a Portfile example of the rspamd port that forces the use of the native /usr/lib/libpcre.dylib library (compiled without jit) to avoid this issue: https://github.com/macports/macports-ports/commit/3778fcef647b9d3cfa19f40fd4d59aa97ae1f25a

In the current rspamd build that uses native pcre, it reports in its logs:

2019-05-04 05:03:59 #69648(main) rspamd_regexp_library_init: pcre is compiled without JIT support, so many optimizations are impossible

Getting working jit in pcre and pcre2 would be great to have.

Change History (5)

comment:1 Changed 2 years ago by essandess (Steve Smith)

Description: modified (diff)

comment:2 Changed 2 years ago by essandess (Steve Smith)

Description: modified (diff)

comment:3 Changed 2 years ago by essandess (Steve Smith)

Description: modified (diff)

comment:4 Changed 2 years ago by essandess (Steve Smith)

In 00cf8a72e451a59e5d71433c06f5a734f64422a8/macports-ports (master):

rspamd: Fixed build for macOS and improved Portfile

comment:5 Changed 2 years ago by essandess (Steve Smith)

In 3c71ad86d24354406a813ce34afeaf9d5c2f86e3/macports-ports (master):

rspamd: Add hyperscan regex processing

see: #58437

Note: See TracTickets for help on using tickets.