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

QRegularExpression leads Vlagrind report "Invalid read" issue

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 5.15.9
    • None
    • Linux/X11

    Description

      Hi, Expert

      when we run the test code

          QRegularExpression escapedSlash("(\\\\)(/)");
          QString str = "MMWSPY";
          str.replace(escapedSlash, "/");
      

      with Qt 5.15.9, it report Valgrind "Invalid Read" issue

      ==122918== Invalid read of size 16
      ==122918==    at 0x1976FBC0: ???
      ==122918==    by 0x1587D367: ???
      ==122918==  Address 0x1587d36e is 30 bytes inside a block of size 40 alloc'd
      ==122918==    at 0x402E7AD: malloc (vg_replace_malloc.c:380)
      ==122918==    by 0x58B9B00: QArrayData::allocate(unsigned long, unsigned long, unsigned long, QFlags<QArrayData::AllocationOption>)
      ==122918==    by 0x594A992: QString::QString(int, Qt::Initialization) 
      ==122918==    by 0x5AF2D07: ???
      ==122918==    by 0x5AF35B1: ???
      ==122918==    by 0x594DFCA: QString::fromAscii_helper(char const*, int)
      

      Could you please help to fix it?

      if not, is it safe or how can we prevent this warning?

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            jian_chen Jian Chen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes