Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-38034

QRegularExpressionValidator hangs on regular expression validating URL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • 5.4.0
    • 5.2.1
    • Core: Other
    • None
    • 414a411c275d28dee071e2372cc068b67ba47134

    Description

      The attached code is a simple application to try to validate a URL provided by the user. If you try it and try to enter something like "http://uuuuuuuuuuuuuuuuuuuu", then you will see that the application becomes slightly unresponsive and that you can't add any more character. If you run the application in debug mode and pause it, you will see that QRegularExpressionValidator::validate() makes an indirect call to pcre16_exec, which itself makes call to match, which itself makes call to match, which itself makes call to match, etc. Could this be a bug in QRegularExpressionValidator or even pcre16_exec?

      FWIW, as far as I can tell the regular expression is fine. It's not mine, I got it from https://gist.github.com/dperini/729294 and I 'simply' converted it to C++, but maybe this is where I made a mistake? Whatever the case, there is definitely something going on with QRegularExpressionValidator.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            peppe Giuseppe D'Angelo
            agarny Alan Garny
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes