Opened 3 weeks ago

Closed 9 days ago

Last modified 7 days ago

#484 closed defect (fixed)

CRITICAL: Apache crashes when using MapCache regex dimensions (PCRE2 access violation)

Reported by: dpelissiry Owned by: Jeff McKenna
Priority: critical Milestone: 5.2.0 release
Component: MS4W - MapCache Version: 5.0.0
Keywords: Cc: TC Haddad, dpelissiry@…
Blocked By: Blocking:

Description

When using MapCache regex dimensions on MS4W, both Apache (httpd.exe) and mapcache_seed consistently crash with an access violation in pcre2-8.dll. This reproduces on both a fresh MS4W install and an existing setup, and only occurs when regex dimensions are used. After digging into the MapCache source, it appears the PCRE2 code path for regex dimensions may be using uninitialized values when calling pcre2_compile and pcre2_match, which could explain the crashes. I was also wondering if there is an MS4W build available that uses the legacy PCRE instead of PCRE2, as a possible workaround.

Change History (15)

comment:1 by Jeff McKenna, 3 weeks ago

Cc: TC Haddad added

thanks for the report @dpelissiry Also please be sure to test with MS4W 5.2.0-rc1 ( https://ms4w.com/release/experimental/ms4w_5.2.0_rc1.zip ) and update this ticket with those results (in other words, be sure to state here what MS4W version you are testing against).

Regarding using PCRE vs PCRE2, this issue may require a fix in the MapCache source and then I can issue an updated MS4W 5.2.0-rc2 release.

Will examine more post-New-Years "celebrations".

PS. if you are able, you can submit your MapCache pull request at https://github.com/MapServer/mapcache

thanks again.

comment:2 by dpelissiry, 3 weeks ago

Thank you for the quick reply! I will try with 5.2.0, and also compile and test mapcache locally to verify if it is a source code bug. If that were the case, would the quickest solution have to be a PR and a mapcache release? I do see it is possible to build mapcache with a PCRE flag instead of PCRE2, which might solve the issue. I will do more debugging on my end to determine the true root cause. Really been enjoying using ms4w, so thanks again for the quick help!

comment:3 by Jeff McKenna, 2 weeks ago

Yes the quickest way is with a PR to the MapCache repository.

Please do test with MS4W 5.2.0 & update this ticket with those results.

thanks.

comment:4 by dpelissiry, 2 weeks ago

Tested with 5.2.0 and still seeing the same access violations from the pcre2-8.dll. Created a pull request here https://github.com/MapServer/mapcache/pull/371. Tested locally with mapcache.fcgi and successfully had regex dimensions parsed with PCRE2 enabled.

comment:5 by dpelissiry, 2 weeks ago

Milestone: 5.2.0 release

comment:6 by Jeff McKenna, 2 weeks ago

Priority: majorcritical
Summary: Apache crashes when using MapCache regex dimensions (PCRE2 access violation)CRITICAL: Apache crashes when using MapCache regex dimensions (PCRE2 access violation)

comment:7 by dpelissiry, 2 weeks ago

Hey Jeff,
Any idea of the timeline of a 5.2.0-rc2 release? Just curious if it would be days/weeks/months from now. Thanks for your help on this!

comment:8 by Jeff McKenna, 12 days ago

@dpelissiry a new MS4W 5.2.0-rc2 is now available, that contains your MapCache regex dimensions fix:

Please update this ticket as soon as you test that version (as soon as you can, pretty please ha). Thanks.

Last edited 9 days ago by Jeff McKenna (previous) (diff)

comment:9 by Jeff McKenna, 9 days ago

Resolution: fixed
Status: newclosed

comment:10 by Jeff McKenna, 7 days ago

@dpelissiry did you test your MapCache dimension steps with RC2? (if you want to test the latest, here is RC3: https://ms4w.com/release/experimental/ms4w_5.2.0_rc3.zip )

Version 0, edited 7 days ago by Jeff McKenna (next)

comment:11 by Jeff McKenna, 7 days ago

Cc: dpelissiry@… added

comment:12 by Jeff McKenna, 7 days ago

@dpelissiry did you test your MapCache dimension steps with RC2? (if you want to test the latest, here is RC3: https://ms4w.com/release/experimental/ms4w_5.2.0_rc3.zip )

Last edited 7 days ago by Jeff McKenna (previous) (diff)

comment:13 by Jeff McKenna, 7 days ago

ping dpelissiry

comment:14 by dpelissiry, 7 days ago

I'll test with it today and let you know.

comment:15 by dpelissiry, 7 days ago

Regex dimensions working with 5.2.0_rc3! Thank you for all the help

Note: See TracTickets for help on using tickets.