On 02/21/2014 05:17 PM, Sandro Santilli wrote: > The following snippet reveals that 9.3.1 has a bug > in regexp_matches, which uninterruptably keeps CPU > spinning for minutes:
Huh. So it does. That's interesting. (You should generally report things to pgsql-b...@postgresql.org btw, not -hackers) Looks like it's busily looping within the regex.c code, never hitting a CHECK_FOR_INTERRUPTS. The real question IMO is why it's taking so long. It looks like cfindloop(...) is being called multiple times, with each call taking a couple of seconds. A profile of the run is attached. I don't expect to have a chance to dig into this right away, as I haven't touched the regexp code before and would need to spend a bit of time studying it to achieve anything. Hopefully the test, confirmation, and profile is useful. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
# Overhead Command Shared Object Symbol # ........ ........ ................. ............................................... # 40.33% postgres postgres [.] longest | --- longest cdissect cdissect cdissect cdissect cdissect cdissect | |--87.25%-- cdissect | | | |--78.14%-- cdissect | | | | | |--81.92%-- cdissect | | | | | | | |--68.07%-- cdissect | | | | | | | | | |--69.11%-- pg_regexec | | | | | | | | | --30.89%-- cdissect | | | | pg_regexec | | | | | | | --31.93%-- pg_regexec | | | | | --18.08%-- pg_regexec | | | --21.86%-- pg_regexec | --12.75%-- pg_regexec 19.20% postgres postgres [.] shortest | --- shortest cdissect cdissect cdissect cdissect cdissect cdissect cdissect cdissect cdissect cdissect pg_regexec 12.76% postgres postgres [.] miss | --- miss | |--88.87%-- longest | cdissect | cdissect | cdissect | cdissect | cdissect | cdissect | | | |--93.47%-- cdissect | | | | | |--74.23%-- cdissect | | | | | | | |--90.21%-- cdissect | | | | | | | | | |--85.39%-- cdissect | | | | | | | | | | | |--91.67%-- pg_regexec | | | | | | | | | | | --8.33%-- cdissect | | | | | pg_regexec | | | | | | | | | --14.61%-- pg_regexec | | | | | | | --9.79%-- pg_regexec | | | | | --25.77%-- pg_regexec | | | --6.53%-- pg_regexec | --11.13%-- shortest cdissect cdissect cdissect cdissect cdissect cdissect cdissect cdissect cdissect cdissect pg_regexec 11.25% postgres postgres [.] initialize | --- initialize | |--79.73%-- longest | cdissect | cdissect | cdissect | cdissect | cdissect | cdissect | | | |--84.41%-- cdissect | | | | | |--77.74%-- cdissect | | | | | | | |--84.58%-- cdissect | | | | | | | | | |--77.37%-- cdissect | | | | | | | | | | | |--77.89%-- pg_regexec | | | | | | | | | | | --22.11%-- cdissect | | | | | pg_regexec | | | | | | | | | --22.63%-- pg_regexec | | | | | | | --15.42%-- pg_regexec | | | | | --22.26%-- pg_regexec | | | --15.59%-- pg_regexec | --20.27%-- shortest cdissect cdissect cdissect cdissect cdissect cdissect cdissect cdissect cdissect cdissect pg_regexec 7.99% postgres postgres [.] cdissect | --- cdissect cdissect cdissect cdissect cdissect cdissect | |--83.49%-- cdissect | | | |--87.88%-- cdissect | | | | | |--90.92%-- cdissect | | | | | | | |--87.15%-- cdissect | | | | | | | | | |--66.36%-- pg_regexec | | | | | | | | | --33.64%-- cdissect | | | | | | | | | |--50.37%-- cdissect | | | | | pg_regexec | | | | | | | | | --49.63%-- pg_regexec | | | | | | | --12.85%-- pg_regexec | | | | | --9.08%-- pg_regexec | | | --12.12%-- pg_regexec | --16.51%-- pg_regexec 6.05% postgres postgres [.] zaptreesubs | --- zaptreesubs | |--53.05%-- zaptreesubs | | | |--63.17%-- cdissect | | cdissect | | cdissect | | cdissect | | cdissect | | cdissect | | | | | |--60.72%-- pg_regexec | | | | | --39.28%-- cdissect | | cdissect | | cdissect | | cdissect | | pg_regexec | | | --36.83%-- zaptreesubs | | | |--89.96%-- cdissect | | cdissect | | cdissect | | cdissect | | cdissect | | cdissect | | pg_regexec | | | --10.04%-- zaptreesubs | cdissect | cdissect | cdissect | cdissect | cdissect | cdissect | pg_regexec | --46.95%-- cdissect cdissect cdissect cdissect cdissect cdissect | |--79.77%-- cdissect | cdissect | cdissect | cdissect | pg_regexec | --20.23%-- pg_regexec
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers