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

QImage crash when saving image(Qt5.0.2) on mac osx 10.8.3

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 5.0.2
    • Core: QtConcurrent
    • None
    • clang3.2, mac 10.8.3, Qt5.0.2
    • macOS

    Description

      Sometimes this would crash(race condition?) if you don’t lock the save function
      Is this a bug? Or a behavior of save?In Qt4 I haven’t found this kind of problem yet

      These are part of the error messages after the .app crash

      http://www.flickr.com/photos/92283971@N04/8678167798/in/photostream

      ps : there are the other small bug, the SLOT aboutQt will always show you you are using Qt5.0.1 but not Qt5.0.2

      #include <functional>

      #include <QApplication>
      #include <QtConcurrent/QtConcurrentMap>
      #include <QImage>
      #include <QLabel>

      //QMutex mutex;

      int process_image_impl(QString const &name)
      {
      QImage image(name);

      if(!image.isNull())

      { //QMutexLocker(&QMutex); you have to lock it to prevent undefined behavior image.save("save/" + name); }

      return 0;
      }

      int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);

      namespace ph = std::placeholders;

      QStringList image_name;
      for(size_t i = 0; i != 10; ++i)

      { image_name <<("onebit_" + QString::number(30 + i) + ".png"); }

      QtConcurrent::blockingMapped(image_name, std::bind<int>(process_image_impl, ph::_1));

      QLabel w;
      w.show();

      return a.exec();
      }

      The images are compress in the zip file

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            stereomatching stereoMatching
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes