#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 , 3 weeks ago
| Cc: | added |
|---|
comment:2 by , 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 , 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 , 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 , 2 weeks ago
| Milestone: | → 5.2.0 release |
|---|
comment:6 by , 2 weeks ago
| Priority: | major → critical |
|---|---|
| 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 , 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 , 12 days ago
@dpelissiry a new MS4W 5.2.0-rc2 is now available, that contains your MapCache regex dimensions fix:
- download: https://ms4w.com/release/experimental/ms4w_5.2.0_rc2.zip
- after extracting, you *must* first re-run the C++ Redistributable installer (see step in /REQUIREMENTS.txt locally)
Please update this ticket as soon as you test that version (as soon as you can, pretty please ha). Thanks.
comment:9 by , 9 days ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:10 by , 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 )
comment:11 by , 7 days ago
| Cc: | added |
|---|
comment:12 by , 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 )

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.