segfault with pcre10.34-3

Bug #1855269 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcre2 (Debian)
Fix Released
Unknown
pcre2 (Ubuntu)
Fix Released
High
Andreas Hasenack
rspamd (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

With pcre 10.32-5, rspamd starts up just fine. Update pcre to 10.34-3 and this command starts to segfault:

root@focal-rspamd:~# rspamadm configtest
Segmentation fault (core dumped)

This is also happening in debian, see https://ci.debian.net/data/autopkgtest/unstable/amd64/r/rspamd/3566843/log.gz

Attached is the full backtrace. Here is a glimpse:
#0 0x00007ffff6f8a888 in pcre2_jit_compile_8 (code=0x0, options=options@entry=1) at src/pcre2_jit_compile.c:13746
#1 0x00007ffff7ab6663 in rspamd_regexp_post_process (r=0x7ffff1cdef80) at ./src/libutil/regexp.c:190
#2 rspamd_regexp_new (pattern=0x7ffff3d7e9c9 "[$€$¢¥₽]", flags=<optimized out>, err=err@entry=0x7fffffffe230) at ./src/libutil/regexp.c:481
#3 0x00007ffff7b622dd in rspamd_mime_expr_parse_regexp_atom (cfg=<optimized out>, line=0x7ffff3d7e970 "/[$€$¢¥₽]/Hu", pool=0x7ffff4632000) at ./src/libmime/mime_expressions.c:494
#4 rspamd_mime_expr_parse (line=<optimized out>, len=<optimized out>, pool=0x7ffff4632000, ud=<optimized out>, err=0x7fffffffe350) at ./src/libmime/mime_expressions.c:799
#5 0x00007ffff7a9b028 in rspamd_parse_expression (line=line@entry=0x7ffff47682c0 "Subject=/[$€$¢¥₽]/Hu", len=<optimized out>, len@entry=0, subr=0x7ffff7d6be80 <mime_expr_subr>,
    subr_data=subr_data@entry=0x7fffffffe3e0, pool=pool@entry=0x7ffff4632000, err=err@entry=0x7fffffffe350, target=0x7fffffffe348) at ./src/libutil/expression.c:671
#6 0x00007ffff7b7f2ec in read_regexp_expression (pool=0x7ffff4632000, symbol=0x7ffff47682a0 "SUBJECT_HAS_CURRENCY", line=line@entry=0x7ffff47682c0 "Subject=/[$€$¢¥₽]/Hu", ud=ud@entry=0x7fffffffe3e0,
    chain=<optimized out>) at ./src/plugins/regexp.c:81
#7 0x00007ffff7b7fd4f in regexp_module_config (cfg=0x7ffff4626800) at ./src/plugins/regexp.c:228
#8 0x00007ffff7b070cb in rspamd_init_filters (cfg=0x7ffff4626800, reconfig=reconfig@entry=false) at ./src/libserver/cfg_utils.c:1539
#9 0x000055555556845f in rspamadm_configtest (argc=<optimized out>, argv=<optimized out>, cmd=<optimized out>) at ./src/rspamadm/configtest.c:155
#10 0x0000555555566845 in main (argc=2, argv=<optimized out>, env=<optimized out>) at ./src/rspamadm/rspamadm.c:561

Revision history for this message
Andreas Hasenack (ahasenack) wrote :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

A simple rebuild with 10.34 picks that up as an updated verisoned dep, but the segfault still happens.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Adding a pcre2 task since it could be a bug in the new release, as the segfault happens inside that library.

Changed in rspamd (Ubuntu):
importance: High → Undecided
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The i386 dep8 test seems to pass just because the pcre2 library isn't updated, probably related to the i386 removal we are going through:

From https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-focal/focal/i386/r/rspamd/20191202_182054_dfe64@/log.gz:
"""
...
The following packages have been kept back:
  libpcre2-8-0
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
...
"""

Revision history for this message
Andreas Hasenack (ahasenack) wrote :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Confirmed the crash also happens in debian, and filed a bug there as well.

Changed in rspamd (Debian):
status: Unknown → New
Changed in rspamd (Ubuntu):
status: New → Invalid
Changed in pcre2 (Ubuntu):
status: New → In Progress
assignee: nobody → Andreas Hasenack (ahasenack)
no longer affects: rspamd (Debian)
Changed in pcre2 (Ubuntu):
importance: Undecided → High
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Debian grabbed the upstream fix and released 10.34-7, which synced in ubuntu and closes this bug.

Changed in pcre2 (Ubuntu):
status: In Progress → Fix Released
Changed in pcre2 (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.