Issue 125995 - Draw crashes when opening a file with two connectors
Summary: Draw crashes when opening a file with two connectors
Alias: None
Product: Draw
Classification: Application
Component: open-import (show other issues)
Version: 4.1.1
Hardware: PC Linux 64-bit
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2015-01-02 12:28 UTC by Michael
Modified: 2015-09-21 23:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

Exemplary files and screenshots (38.65 KB, application/zip)
2015-01-02 12:28 UTC, Michael
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Michael 2015-01-02 12:28:01 UTC
Created attachment 84365 [details]
Exemplary files and screenshots

Hi There,

I have a Draw document that suddenly started to crash Draw without any comment, when the file is opened. So I retrieved an old version from version control and investigated on the difference in the content.xml file.

The crash seems to be caused by two connectors that connect to each other in a special way
(The file can be rescued when one of the connectors is deleted from the content.xml).

I was able to reproduce this behaviour with new documents and made screenshots before closing (See attachment). I tried it with standard and curved connectors. The type of the arrow doesn't seem to matter. 

My observation is that the crash is caused by two interconnected connectors where each of them consists of exactly three points (See screenshots). It is quite tricky to arrange them like that because of the autorouting.

Steps to reproduce:
 - Create new Draw document
 - Add two e.g. curved connectors
 - Connect and arrange connectors
 - Save and close file
 -> Crash when the file is opened

My Version is:
Apache OpenOffice 4.1.1
AOO411m6(Build:9775)  -  Rev. 1617669
2014-08-13 09:23 - Linux x86_64

By the way: Is there any option to get some logging or debug information in this case?

Best Regards

Comment 1 Joe Smith 2015-01-06 17:42:05 UTC
I was able to reproduce the crash(es) with OO 4.1.1 on Linux x86, opening the crash documents attached here.

AOO411m6(Build:9775)  -  Rev. 1617669
2014-08-13 09:23 - Linux i686

OO crashed with a segfault.

I was also able to create a new Draw document that crashed, but I could not find a recipe that produces a crash file reproducibly: many attempts worked, even though the content and layout were similar to the crash documents (two standard connectors, three sides each).

Looking at the document xml of my crash document, I find the connector objects:

<draw:connector draw:style-name="gr1" draw:text-style-name="P1" xml:id="id1" draw:id="id1" draw:layer="layout" draw:line-skew="5.92cm" svg:x1="8.95cm" svg:y1="7.12cm" svg:x2="9.378cm" svg:y2="11.595cm" draw:end-shape="id2" draw:end-glue-point="3" svg:d="M8950 7120h6848v4475h-6420"><text:p/></draw:connector>
<draw:connector draw:style-name="gr1" draw:text-style-name="P1" xml:id="id2" draw:id="id2" draw:layer="layout" draw:line-skew="-5.142cm" svg:x1="8.95cm" svg:y1="7.12cm" svg:x2="9.378cm" svg:y2="11.595cm" draw:start-shape="id1" draw:start-glue-point="2" svg:d="M8950 7120h-5642v4475h6070"><text:p/></draw:connector>

Tweaking the xml to remove the attribute draw:start-shape="id1" or changing it to draw:x-start-shape="id1" allows the document to open without crashing. If the attribute is changed back to the correct spelling, then the document will crash on open.

Looking at the xml from the reporter's crash documents, it seems the common feature is that the two connectors refer to each other through the draw:start- or draw:end- attributes. If the reference chain (or loop) is broken by removing or misspelling any of the start- or end- attributes, then the document will load.

For example (from the above xml):

  <draw:connector ... xml:id="id1" ...
    draw:end-shape="id2" draw:end-glue-point="3" ...</draw:connector>

  <draw:connector ... xml:id="id2" ...
    draw:start-shape="id1" draw:start-glue-point="2" ...</draw:connector>
Comment 2 Jared 2015-09-21 23:32:00 UTC
System spec:
Windows 10 x64
System 1: Dell latitude E6410
System 2: Custom Desktop 3+ years old

I was able to replicate this error and found out a way to replicate it it consistently. This error seems to be just as Joe said, the system is looping around the curved connectors and segfaults. This error seems to come up not only with two connectors but up to 5+ and with any combination of curved connectors. I have also tried it with some other item in between the two curved connectors and it doesn’t crash, further backing up the idea Joe gave. I have also come up with more in depth instructions to replicate the error.

1. Open Draw to a new file
2. Choose any of the 3 types of curved connectors and place on the draw field
3. Do step two as many times and needed
4. Now order does matter from here on, so think of these as labeled 1-n where n is      
   the number of curved lines you placed
5. Connect curve 1 to curve 2
6. Connect curve 2 from the other end that one is connected to curve 3
7. Continue with this until you reach the end.
8. Connect the last side of the last curve to curve one and the end that doesn't            
   have anything connected.
9. Save the document and close Draw
70. Reopen Draw and try to re-open the file

This is where the system should crash. If it doesn’t make sure all of your curved line have only 3 point on them.  I feel that this bug can cause some problems as one use can be creating a loop diagram and labeling sections. This could be circumvented but would be difficult as most people would just connect one side to another, causing the system to crash.