Uploaded image for project: 'WorldEditor'
  1. WorldEditor
  2. WED-787

WED apt.dat & gateway import deletes node, resuling in crash

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Fix ASAP - Hair On Fire
    • Resolution: Fixed
    • Affects Version/s: 1.5, 1.5.1, 1.6.0b1
    • Fix Version/s: 1.6.0r1
    • Component/s: Import/Export
    • Labels:
      None
    • Severity:
      Crash
    • Platform:
      Mac OS, Windows, Linux

      Description

      WED 1.4 / 1.51 / 1.6, when importing a apt.dat with dupliated (zero length segment) airport line nodes deletes the duplicated nodes upon import, see attached.
      If the apt.dat has a line with only two co-located nodes this creates a single node WED_Chain after import, resulting in WED 1.6.0b1 crashes under windows - confirmed to happen at WED-768, suspect also at WED-780.

      These 2-colocated-node lines are kindof undesireable to start with and not readily produced by user action, but validation in all WED versions prior to WD. 1.6.0b1 (tested all WED 1.6 alphas, WED 1.51 and WED 1.4) will fail to catch them, apt.dat and gateway export will write them without any issues or notifications, see attached earth.wed..xml. A late commit in WED 1.6.0b1 finally added working validation for this and they cannot be exported any more, though still saved.

      At least one such scenery made it onto the gateway: KSEA - ironically it was me submitting it with WED 1.5 and its also in all KSEA demo areas shipped since 1050. I suspect it could be many more - once Tyler Young exports the global airports for the first time with WED 1.6.0b1, he will find out the hard way - validation will now refuse the scenery export.

      The problem upon apt.dat AND gateway import is in WED_AptIE.cpp importLinearPath(). This code intends to only remove rightfully co-located apt.dat lines needed to store the hi/low parts of Bezier nodes, but it will accidentically also delete any non-bezier duplicated nodes, like this apt.dat entry:

      120 Linear Feature 3
      111 49.18323571 -123.17252245 1
      115 49.18323571 -123.17252245
      99

      After import the above results in a single-node line, which will make WED 1.6.0 under windows crash at times immediately after apt.dat import complete, in other cases only after importing e.g. a DSF later on. Under linux no crash at all so far, but I suspect we just got lucky for now ...

      Saving after importing the above apt.dat will create a single node WED_Chain in earth.ewd.xml, which upon re-loading back into WED 1.6.0b1 is rightfully detected as corrupted data, the user is notified and its corrected by deleting this line marking completely.

      Ben Supnik Theodore (Ted) Greene I see several possible actions here:

      1) fix WED_APtIE.cpp importLinearPath() to NOT delete duplicated nodes that are NOT part of a bezier node group

      2) instead of 1) add detection of single-line nodes after apt.dat and gateway import, deleting such accidentially created single-node polygons BEFORE the scenery is drawn the first time (where it may crash). That would be similar to what the earth.wed.xml import currently does.

      3) find out where WED 1.6.0b1 crashes when displaying single-node WED_Chains

      I prefer 1). Thoughts ?

      1. earth.wed.xml
        24 kB
        Michael Minnhaar
      2. test.dat
        0.4 kB
        Michael Minnhaar
      3. test2.dat
        1 kB
        Michael Minnhaar

        Issue Links

          Activity

          Hide
          bsupnik Ben Supnik added a comment -

          This might explain why I couldn't understand how the GIT commit fixed the problem?

          Show
          bsupnik Ben Supnik added a comment - This might explain why I couldn't understand how the GIT commit fixed the problem?
          Hide
          meikelm Michael Minnhaar added a comment -

          Yeah,
          just a few kind words on the console windows are sometimes not enough
          This time I'll put it in and also add the testcase stuff Ted suggested elsewhere. Seems like I need that ....

          Show
          meikelm Michael Minnhaar added a comment - Yeah, just a few kind words on the console windows are sometimes not enough This time I'll put it in and also add the testcase stuff Ted suggested elsewhere. Seems like I need that ....
          Hide
          bsupnik Ben Supnik added a comment -

          Michael Minnhaar Ping - Please check in the full fix if you have it!

          Show
          bsupnik Ben Supnik added a comment - Michael Minnhaar Ping - Please check in the full fix if you have it!
          Hide
          meikelm Michael Minnhaar added a comment - - edited

          commit 022c6412e7227cbe4d1cae44c0c0914b79ce3720

          Also attached here for verification a test2.dat to import into WED:

          WED 1.6.0rc2 crashes upon import on windows, on Linux it will have after the import a "Line #7" in the hierachy window, but nothing to edit in the map window. As its after import a single-node line feature that will crash windows right away, under linux WED survives initially, but will notice this corrupt feature after re-loading the earth.wed.xml the next time.

          This commit preserves this line #7 as a propper 2-node feature, editable/saveable normally etc in Win7 and Linux.

          Show
          meikelm Michael Minnhaar added a comment - - edited commit 022c6412e7227cbe4d1cae44c0c0914b79ce3720 Also attached here for verification a test2.dat to import into WED: WED 1.6.0rc2 crashes upon import on windows, on Linux it will have after the import a "Line #7" in the hierachy window, but nothing to edit in the map window. As its after import a single-node line feature that will crash windows right away, under linux WED survives initially, but will notice this corrupt feature after re-loading the earth.wed.xml the next time. This commit preserves this line #7 as a propper 2-node feature, editable/saveable normally etc in Win7 and Linux.
          Hide
          bsupnik Ben Supnik added a comment -

          Thanks for getting this in!!

          Show
          bsupnik Ben Supnik added a comment - Thanks for getting this in!!

            People

            • Assignee:
              meikelm Michael Minnhaar
              Reporter:
              meikelm Michael Minnhaar
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: