[Privoxy-devel] PCRE2 for privoxy on windows

Lee ler762 at protonmail.com
Wed Jul 26 07:59:12 CEST 2023


On Monday, July 24th, 2023 at 4:19 AM, Fabian Keil <fk at fabiankeil.de> wrote:

> Lee ler762 at protonmail.com wrote on 2023-07-22 at 22:22:38:
> 
> > Hi all,
> 
> 
> Hi Lee,
> 
> it's good to hear from you again.
> 
> I noticed you're using a protonmail.com email address now
> so I hope this messages is accepted.

Yes, it made it thru :)

> I'm CC'ing you anyway as I'm not sure whether or not you're
> subscribed to the list yet.

Yes - I'm subscribed to -user and -devel.

> > Sourceforge mail gets through to gmail which is why I noticed the
> > Optional pcre2 support is available in the git master branch now.
> > 
> > I got it working on Windows :)
> 
> 
> Great.
> 
> > I dunno about
> > #warning The win32 build of Privoxy is expected to crash when compiled
> > with pcre2 support.
> 
> 
> I added the warning based on the assumption that the crashes
> seen on ElectroBSD and on Gagan's system with the POSIX regex
> functions [0] are platform independent.
> 
> My suspicion was that the crashes are the result of a bug
> in pcre2 but I didn't have time to track this down or ask
> the upstream.
> 
> > The only crashes I had were using OpenSSL for +https-inspection
> > I do not understand what's going on there, but adding a
> > #include <openssl/applink.c>
> > in openssl.c fixes the problem. ... or at least I haven't had any more
> > crashes.
> 
> 
> Did you get a backtrace you could post to the list?

No.  All I get is a popup window with
  OpenSSL: FATAL
  OPENSSL_Uplink(008A7C34,08): no OPENSSL_Applink
where the number inside () changes.

> Did you use OpenSSL 3.x or an older release?

cygcheck -srv reports it as
  mingw64-i686-openssl 3.0.9-0.1

> In general adding a header seems acceptable to me
> but I'd like to understand why it helps.

I can't help you there :(  All the info I found on the web talks about calling .DLLS and I don't have any .. well I have the normal windows stuff but no cygwin or mingw DLLS in the privoxy directory or on the path, so I don't see how this can be a 'DLL linking problem' with openssl DLLs.

Privoxy works just fine until enabling +https-inspection.  Then I think the most it went was ~40 minutes before crashing.
I've been running Privoxy for a few days now with no crashes and the only difference is adding the include of applink.c

This is my msg to the cygwin mailing list
  https://cygwin.com/pipermail/cygwin/2023-July/253991.html
no response yet, public or private :(

> > Running the regression test gets me
> > 2023-07-22 17:55:52: Executed 752 regression tests. Skipped 66. 752
> > successes, 0 failures.
> > 
> > so that looks promising :)
> 
> 
> Please try with the --forks option. On my ElectroBSD system
> "--forks 1" was already sufficient to reliable trigger the
> crashes.

No crashes, with "--forks 1" or "--forks 4"
But I'm on windows and not using posix threads.  If you recall this bit in w32svrapi.c
#ifndef FEATURE_PTHREAD
   /* NOTE: a cygwin cross-compiler build for --host=i686-w64-mingw32 must disable POSIX threading - eg
    *         ./configure --host=i686-w64-mingw32 --disable-pthread
    */
   child_id = _beginthread(w32_service_listen_loop, 0, NULL);
   if (child_id > 0)
#else
#error "FIXME: Do pthread stuff here!"
#endif

so maybe that has something to do with it?

> > See attached for my changes
> 
> 
> I'd be interested to review you're changes in "git format-patch"
> format. Can you send them to the list using a new thread for
> each patch (set)?

Sure thing, but
1. what exactly is the command?  I made a new PCRE2 branch in git and haven't done any commits yet.  Maybe that's why "git format-patch" doesn't print anything?

2. I don't do nice change sets.  I make changes to whatever seems to need changing and then do commits when
a) I think I'm done
b) I'm forced to so I can switch back to master and do a git pull

In other words, it'll take a day or two to make nice, neat change sets from the mess that I have.

Regards,
Lee



More information about the Privoxy-devel mailing list