Bug 527514 - Freeze when exporting diagrams as BMP
Summary: Freeze when exporting diagrams as BMP
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 5.0.0   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
: 547484 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-11-20 11:06 EST by Pierre Guilet CLA
Modified: 2019-05-27 04:30 EDT (History)
3 users (show)

See Also:


Attachments
project to reproduce (260.19 KB, application/x-zip-compressed)
2017-11-20 11:06 EST, Pierre Guilet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Guilet CLA 2017-11-20 11:06:11 EST
Created attachment 271560 [details]
project to reproduce

The BMP export of some diagram freeze the bundle in an endless loop.
Steps to reproduce:

1- Import the attached project
2- Open the only diagram
3- Click on export button on tabbar
4- Choose to export as BMP
5- Launch export.

Then the bundle freeze.

The problem is located in org.eclipse.swt.internal.image.WinBMPFileFormat.unloadDataNoCompression(ImageData, byte[], OutputStream);

The line int linesPerBuf = 32678 / bmpBpl produce 0 as result because bmpBpl is 37440.

So the loop for (int y = 0; y < image.height; y += linesPerBuf) can never increment y leading to an infinite loop.
Comment 1 Pierre Guilet CLA 2017-11-21 03:50:27 EST
The problem is related to auto-scale. Without auto-scale, the export goes well.
Comment 2 Florian Barbin CLA 2017-11-24 08:35:34 EST
I do not reproduce this issue on Linux
Comment 3 Steve Monnier CLA 2017-11-24 08:43:11 EST
I reproduced the freeze on Windows in the same method as Pierre
Comment 4 Florian Barbin CLA 2019-05-27 04:29:47 EDT
*** Bug 547484 has been marked as a duplicate of this bug. ***
Comment 5 Florian Barbin CLA 2019-05-27 04:30:50 EDT
This issue is still present on Windows in Sirius 6.1: https://bugs.eclipse.org/bugs/show_bug.cgi?id=547484