Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-7351

Trying to render a very long URL in comment causes StackOverflow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • 4.4.5
    • Code reviews

    Description

      Trying to render a very long url, will cause a StackOverflowError in the highlighter, with an error message like the one below.
      The comment will still be rendered, without highlighting the url.

      2015-08-03 09:53:03,609 WARN  [qtp1300016164-25072 ] fisheye noClassMethodInfo - Error parsing file with multiline pattern (\b(?:https?://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?&=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?))(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),~]|(?:%[a-fA-F\d]{2}))|[;:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),~]|(?:%[a-fA-F\d]{2}))|[;:@&=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),~]|(?:%[a-fA-F\d]{2}))|[;:@&=])*))?)?(?:#(?:[/\?!a-zA-Z0-9_:.%,\-()~]*)?)?))|(\b(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?&=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?: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:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))|localhost)?/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&=])*))*))), on file <stream> and offset 12, starting with: NT http://
      java.lang.StackOverflowError
      

      Workaround:

      1. Try to identify something readable in the error message, like https, ftp, news, telnet, mailto, file, and localhost in the message above
      2. Connect to the database and run this query (for the specific error message above):
        select * from cru_comment where cru_message like '%https%ftp%news%telnet%mailto%file%localhost%';
        

        This should return the comment into which that URL was added, along with its cru_comment_id information.

      3. Edit that comment running a query that follows this example below:
        update cru_comment set cru_message = '<message without url>' where cru_comment_id = <the id returned in the previous query>;
        

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lpater Lukasz Pater
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: