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

QResource file engine returns read-only memory for some resources even with MapPrivateOption

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.8.0 FF
    • 6.7.0
    • Core: I/O
    • None
    • Linux n97 6.8.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 17 Apr 2024 15:20:28 +0000 x86_64 GNU/Linux
    • Linux/X11
    • 39e156e63 (dev)

    Description

      Here is a crappy sample how it happens:

      if (QFile f(id); f.open(QIODevice::ReadOnly) &&
        (dat = f.map({}, f.size(), QFileDevice::MapPrivateOption)))
      {
        *dat = {};
      }
      

      Will SEGV after a second resource (e.g.":/resource.png") is loaded in, but not the first. I used this method for lazy reading instead of loading a resouce into a QByteArray. I don't see how I could be responsible.

      Attachments

        For Gerrit Dashboard: QTBUG-124608
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            janezzabc Janez Žemva
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change