[Privoxy-devel] PATCH for pcre2 support
Fabian Keil
fk at fabiankeil.de
Fri Jun 23 15:44:06 CEST 2023
Fabian Keil <fk at fabiankeil.de> wrote on 2023-06-19 at 15:05:06:
> Gagan Sidhu <broly at mac.com> wrote on 2023-06-19 at 06:40:17:
>
> > > On Jun 19, 2023, at 4:00 AM, Fabian Keil <fk at fabiankeil.de> wrote:
>
> > > I'm not seeing different crashes like this one, though:
>
> I meant to write "I'm now seeing ...".
>
> > > #0 0x0000000823c95acd in ?? () from /usr/local/lib/libpcre2-8.so.0
> > > [Current thread is 1 (LWP 108957)]
> > > (gdb) where
> > > #0 0x0000000823c95acd in ?? () from /usr/local/lib/libpcre2-8.so.0
> > > #1 0x0000000823c9002a in pcre2_match_8 () from /usr/local/lib/libpcre2-8.so.0
> > > #2 0x00000008255e60fe in pcre2_regexec () from /usr/local/lib/libpcre2-posix.so.3
> > > #3 0x000000000027309b in path_matches (path=0x856e3c040 "/iomm/latest/bootstrap/stub.js", pattern=0x82a2c5f20) at urlmatch.c:1360
> > > #4 0x0000000000272e7e in url_match (pattern=0x82a2c5f20, http=0x835520a58) at urlmatch.c:1387
> > > #5 0x000000000024cfa8 in apply_url_actions (action=0x835520810, http=0x835520a58, client_tags=0x835520ba0, b=0x82a2c5f20) at filters.c:2884
> > > #6 0x000000000024cf11 in get_url_actions (csp=0x835520808, http=0x835520a58) at filters.c:2845
> > > #7 0x00000000002580ac in process_encrypted_request_headers (csp=0x835520808) at jcc.c:2799
> > > #8 0x0000000000256a03 in chat (csp=0x835520808) at jcc.c:4472
> > > #9 0x0000000000255796 in serve (csp=0x835520808) at jcc.c:5056
> > > #10 0x0000000825a07a7a in thread_start (curthread=0x8355a6000) at /usr/src/lib/libthr/thread/thr_create.c:292
> > > #11 0x0000000000000000 in ?? ()
> > > Backtrace stopped: Cannot access memory at address 0x843d01000
> > >
> > > I haven't been able to reproduce this yet.
Looks like this is a threading issue.
It can be reproduced in a couple of seconds with:
privoxy-regression-test.pl --forks 1
which results in crashes like:
Thread 117 received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
[Switching to LWP 109325 of process 10990]
0x000000080062e25e in match (start_eptr=0x80280a0c0 "/show-url-info?url=http%3A%2F%2Fib.adnxs.com%2Fbounce?%252Fseg%253Fadd%253D279412",
start_ecode=0x800eecc50 "\036u\036t\036m\036_\036m\036e\036d\036i\036u\036m\036=\036f\036e\036e\036dy", top_bracket=0, frame_size=128, match_data=0x800ecce10, mb=0x7fffdf5f6458) at src/pcre2_match.c:1049
1049 src/pcre2_match.c: No such file or directory.
(gdb) info threads
Id Target Id Frame
1 LWP 101941 of process 10990 _poll () at _poll.S:4
116 LWP 109324 of process 10990 0x000000080062e25e in match (
start_eptr=0x801fc8480 "/show-url-info?url=http%3A%2F%2Ffarm.plista.com%2Fwidgetdata.php?clientrev=12%26domainid=4211%26publickey=fdc5a7f9d15be004aa03fc4d%26cb=PLISTA5_7ed57c93e0d17%26requestID=5%265=widgetintegration%253A%2"..., start_ecode=0x800eecc50 "\036u\036t\036m\036_\036m\036e\036d\036i\036u\036m\036=\036f\036e\036e\036dy", top_bracket=0, frame_size=128, match_data=0x800ecce10, mb=0x7fffdf7f7458) at src/pcre2_match.c:1049
* 117 LWP 109325 of process 10990 0x000000080062e25e in match (start_eptr=0x80280a0c0 "/show-url-info?url=http%3A%2F%2Fib.adnxs.com%2Fbounce?%252Fseg%253Fadd%253D279412",
start_ecode=0x800eecc50 "\036u\036t\036m\036_\036m\036e\036d\036i\036u\036m\036=\036f\036e\036e\036dy", top_bracket=0, frame_size=128, match_data=0x800ecce10, mb=0x7fffdf5f6458) at src/pcre2_match.c:1049
(gdb) where
#0 0x000000080062e25e in match (start_eptr=0x80280a0c0 "/show-url-info?url=http%3A%2F%2Fib.adnxs.com%2Fbounce?%252Fseg%253Fadd%253D279412",
start_ecode=0x800eecc50 "\036u\036t\036m\036_\036m\036e\036d\036i\036u\036m\036=\036f\036e\036e\036dy", top_bracket=0, frame_size=128, match_data=0x800ecce10, mb=0x7fffdf5f6458) at src/pcre2_match.c:1049
#1 0x000000080062c041 in pcre2_match_8 (code=0x800eecbc0, subject=0x80280a0c0 "/show-url-info?url=http%3A%2F%2Fib.adnxs.com%2Fbounce?%252Fseg%253Fadd%253D279412", length=81, start_offset=0, options=0,
match_data=0x800ecce10, mcontext=0x80065a508 <_pcre2_default_match_context_8>) at src/pcre2_match.c:7289
#2 0x000000080065e39d in pcre2_regexec (preg=0x800ed8380, string=0x80280a0c0 "/show-url-info?url=http%3A%2F%2Fib.adnxs.com%2Fbounce?%252Fseg%253Fadd%253D279412", nmatch=0, pmatch=0x0, eflags=0) at src/pcre2posix.c:388
#3 0x000000000027305b in path_matches (path=0x80280a0c0 "/show-url-info?url=http%3A%2F%2Fib.adnxs.com%2Fbounce?%252Fseg%253Fadd%253D279412", pattern=0x800eee300) at urlmatch.c:1360
#4 0x0000000000272e3e in url_match (pattern=0x800eee300, http=0x800ef4a58) at urlmatch.c:1387
#5 0x000000000024cf68 in apply_url_actions (action=0x800ef4810, http=0x800ef4a58, client_tags=0x800ef4ba0, b=0x800eee300) at filters.c:2884
#6 0x000000000024ced1 in get_url_actions (csp=0x800ef4808, http=0x800ef4a58) at filters.c:2845
#7 0x000000000025cb68 in receive_client_request (csp=0x800ef4808) at jcc.c:1960
#8 0x0000000000256627 in chat (csp=0x800ef4808) at jcc.c:4310
#9 0x0000000000255756 in serve (csp=0x800ef4808) at jcc.c:5056
#10 0x0000000800708a7a in thread_start (curthread=0x800e14300) at /usr/src/lib/libthr/thread/thr_create.c:292
#11 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffdf5f9000
(gdb) t 116
[Switching to thread 116 (LWP 109324 of process 10990)]
#0 0x000000080062e25e in match (
start_eptr=0x801fc8480 "/show-url-info?url=http%3A%2F%2Ffarm.plista.com%2Fwidgetdata.php?clientrev=12%26domainid=4211%26publickey=fdc5a7f9d15be004aa03fc4d%26cb=PLISTA5_7ed57c93e0d17%26requestID=5%265=widgetintegration%253A%2"..., start_ecode=0x800eecc50 "\036u\036t\036m\036_\036m\036e\036d\036i\036u\036m\036=\036f\036e\036e\036dy", top_bracket=0, frame_size=128, match_data=0x800ecce10, mb=0x7fffdf7f7458) at src/pcre2_match.c:1049
1049 in src/pcre2_match.c
(gdb) where
#0 0x000000080062e25e in match (
start_eptr=0x801fc8480 "/show-url-info?url=http%3A%2F%2Ffarm.plista.com%2Fwidgetdata.php?clientrev=12%26domainid=4211%26publickey=fdc5a7f9d15be004aa03fc4d%26cb=PLISTA5_7ed57c93e0d17%26requestID=5%265=widgetintegration%253A%2"..., start_ecode=0x800eecc50 "\036u\036t\036m\036_\036m\036e\036d\036i\036u\036m\036=\036f\036e\036e\036dy", top_bracket=0, frame_size=128, match_data=0x800ecce10, mb=0x7fffdf7f7458) at src/pcre2_match.c:1049
#1 0x000000080062c041 in pcre2_match_8 (code=0x800eecbc0,
subject=0x801fc8480 "/show-url-info?url=http%3A%2F%2Ffarm.plista.com%2Fwidgetdata.php?clientrev=12%26domainid=4211%26publickey=fdc5a7f9d15be004aa03fc4d%26cb=PLISTA5_7ed57c93e0d17%26requestID=5%265=widgetintegration%253A%2"..., length=365, start_offset=0, options=0, match_data=0x800ecce10, mcontext=0x80065a508 <_pcre2_default_match_context_8>) at src/pcre2_match.c:7289
#2 0x000000080065e39d in pcre2_regexec (preg=0x800ed8380,
string=0x801fc8480 "/show-url-info?url=http%3A%2F%2Ffarm.plista.com%2Fwidgetdata.php?clientrev=12%26domainid=4211%26publickey=fdc5a7f9d15be004aa03fc4d%26cb=PLISTA5_7ed57c93e0d17%26requestID=5%265=widgetintegration%253A%2"..., nmatch=0, pmatch=0x0, eflags=0) at src/pcre2posix.c:388
#3 0x000000000027305b in path_matches (
path=0x801fc8480 "/show-url-info?url=http%3A%2F%2Ffarm.plista.com%2Fwidgetdata.php?clientrev=12%26domainid=4211%26publickey=fdc5a7f9d15be004aa03fc4d%26cb=PLISTA5_7ed57c93e0d17%26requestID=5%265=widgetintegration%253A%2"..., pattern=0x800eee300) at urlmatch.c:1360
#4 0x0000000000272e3e in url_match (pattern=0x800eee300, http=0x800ef2e58) at urlmatch.c:1387
#5 0x000000000024cf68 in apply_url_actions (action=0x800ef2c10, http=0x800ef2e58, client_tags=0x800ef2fa0, b=0x800eee300) at filters.c:2884
#6 0x000000000024ced1 in get_url_actions (csp=0x800ef2c08, http=0x800ef2e58) at filters.c:2845
#7 0x000000000025cb68 in receive_client_request (csp=0x800ef2c08) at jcc.c:1960
#8 0x0000000000256627 in chat (csp=0x800ef2c08) at jcc.c:4310
#9 0x0000000000255756 in serve (csp=0x800ef2c08) at jcc.c:5056
#10 0x0000000800708a7a in thread_start (curthread=0x800e13c00) at /usr/src/lib/libthr/thread/thr_create.c:292
#11 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffdf7fa000
It seems to happen with and without JIT compilation.
Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-devel/attachments/20230623/a937cc8e/attachment.bin>
More information about the Privoxy-devel
mailing list