Hi,

I just upgraded my build system to Qt 4.7 and recompiled one of my apps that uses QGraphicsItems.

One of the first things the app does is create an offscreen QPixmap and renders into it. I'm not doing anything extraordinary - just loading 32bit pngs and rendering them into an offscreen buffer. I'm not using direct pixel buffer access anywhere.

When compiled with Qt 4.6.3 (mingw), no problems - the app runs fine.

When compiled with Qt 4.7 (also mingw), I get a memory access exception when I call QPainter::drawPixmap()

The crash happens in the function qt_blend_argb32_on_argb32_sse2, when the macro BLEND_SOURCE_OVER_ARGB32_SSE2 is executed.

I've created minimal apps using snippets of the code from my larger app, and none of these crash.

So right now I'm stuck trying to workout what else can cause the crash.

An example of the code is below (this does not crash).

Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4. QPixmap srcImage( ":/topLeft.png" );// this image is 15x15x32bit
  5. QPixmap destImage(640, 480);
  6. destImage.fill(QColor(0,0,0,0));
  7. QPainter p( &destImage );
  8. p.drawPixmap( 0, 0, 15, 15, srcImage );
  9. p.end();
  10. return 0;
  11. }
To copy to clipboard, switch view to plain text mode 


However if this code is called elsewhere in the application, it triggers the crash.
This function crashes if called after QGraphicsScene and QGraphicsView initialization.
It does not crash if I call it before doing the initialization.

Qt Code:
  1. void function()
  2. {
  3. QPixmap srcImage( ":/topLeft.png" ); // this image is 15x15x32bit
  4. QPixmap destImage(640, 480);
  5. destImage.fill(QColor(0,0,0,0));
  6. QPainter p( &destImage );
  7. p.drawPixmap( 0, 0, 15, 15, srcImage ); // crash
  8. p.end();
  9. }
To copy to clipboard, switch view to plain text mode 

Does anyone have any insight into what typically can cause problems when using the SSE instruction set?