stan-dev / stan

Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.
https://mc-stan.org
BSD 3-Clause "New" or "Revised" License
2.58k stars 368 forks source link

[BUGFIX] Replace STL regex with Boost for MinGW bug #3251

Closed andrjohns closed 8 months ago

andrjohns commented 8 months ago

Submission Checklist

Summary

Depending on the user's locale, using std::regex with the MinGW GCC in RTools will result in a memory leak and the program hangs.

This has previously been reported as bug to MinGW here, but it is still an issue.

For Stan, this can cause a hang when parsing JSON data (seen recently as the cause of this downstream issue). We can instead use the Boost Regex headers as a drop-in replacement, which I've verified resolve the issue.

Intended Effect

Avoid hanging under certain locales

How to Verify

Side Effects

N/A

Documentation

N/A

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Andrew Johnson

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

andrjohns commented 8 months ago

GCC bug listing here as well: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98723

andrjohns commented 8 months ago

Awkward, but it looks like I don't have permissions for stan:

image

Can I get a grown-up to merge this for me?

syclik commented 8 months ago

@andrjohns, merged! That looks like an oversight.

@WardBrian, can we give @andrjohns permissions?

WardBrian commented 8 months ago

So far as I can tell he has them: image

Maybe it was a github hiccup?

syclik commented 8 months ago

Thanks for checking! I hope it was. @andrjohns please let people know if it happens again!