Bug#255030: dia segfaults opening files created by older version

Jeff King Jeff King <peff-debbug@peff.net>, 255030@bugs.debian.org
Fri, 18 Jun 2004 08:48:05 -0400


Package: dia
Version: 0.93-3
Severity: normal

When trying to load an (circa 2001) dia file, dia segfaulted. I
systematically removed all objects from the file using a text editor and
determined that the problem is caused by a "UML - Message" object. I
have included the object's XML below:

    <object type="UML - Message" version="0" id="O5">
      <attribute name="obj_pos">
        <point val="8,5"/>
      </attribute>
      <attribute name="obj_bb">
        <rectangle val="7.6,4.95;8.4,11.25"/>
      </attribute>
      <attribute name="conn_endpoints">
        <point val="8,5"/>
        <point val="8,11.2"/>
      </attribute>
      <attribute name="text">
        <string/>
      </attribute>
      <attribute name="text_pos">
        <point val="8,8.1"/>
      </attribute>
      <attribute name="type">
        <int val="-690563370"/>
      </attribute>
      <connections>
        <connection handle="0" to="O3" connection="0"/>
        <connection handle="1" to="O0" connection="0"/>
      </connections>
    </object>

I was able to prevent the segfault by replacing <string/> with
<string>##</string> (as is generated by current versions of dia). It
seems that some piece of code is assuming the '##' markers will be
there.  I haven't tracked it further than this.

I believe that new dia versions should:
 - either support loading this construct or provide a short script to
   convert old files (a sed one-liner would work in most cases, but to
   be 100% correct, we might need to actually parse the XML).
 - at the very least not segfault. :)

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.6-1-k7-smp
Locale: LANG=C, LC_CTYPE=C

Versions of packages dia depends on:
ii  dia-common                  0.93-3       Diagram editor (common files)
ii  dia-libs                    0.93-3       Diagram editor (library files)
ii  libart-2.0-2                2.3.16-5     Library of functions for 2D graphi
ii  libatk1.0-0                 1.6.1-2      The ATK accessibility toolkit
ii  libc6                       2.3.2.ds1-13 GNU C Library: Shared libraries an
ii  libfreetype6                2.1.7-2.1    FreeType 2 font engine, shared lib
ii  libglib2.0-0                2.4.2-1      The GLib library of C routines
ii  libgtk2.0-0                 2.4.3-1      The GTK+ graphical user interface 
ii  libpango1.0-0               1.4.0-4      Layout and rendering of internatio
ii  libpng12-0                  1.2.5.0-6    PNG library - runtime
ii  libpopt0                    1.7-4        lib for parsing cmdline parameters
ii  libxml2                     2.6.10-3     GNOME XML library
ii  zlib1g                      1:1.2.1.1-3  compression library - runtime

-- no debconf information