qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.52k stars 2.99k forks source link

Loading SWW file crashes Qgis #30828

Closed schoeller closed 5 years ago

schoeller commented 5 years ago

Dear all,

thanks for putting Qgis to public and continously improving it.

When undertaking the following steps I experience a crash:

1#Qgis 3.6.3 was launched 2#A new project was created 3#"Add Mesh" was called from the taskbar 4#A SWW file was selected 5#When pressing "Add" Qgis crashes

Best regards

Sebastian test1.zip

saberraz commented 5 years ago

Confirmed in master too:

HDF5-DIAG: Error detected in HDF5 (1.10.4) thread 140255055814272:
  #000: ../../../src/H5F.c line 509 in H5Fopen(): unable to open file
    major: File accessibilty
    minor: Unable to open file
  #001: ../../../src/H5Fint.c line 1400 in H5F__open(): unable to open file
    major: File accessibilty
    minor: Unable to open file
  #002: ../../../src/H5Fint.c line 1700 in H5F_open(): unable to read superblock
    major: File accessibilty
    minor: Read failed
  #003: ../../../src/H5Fsuper.c line 411 in H5F__super_read(): file signature not found
    major: File accessibilty
    minor: Not an HDF5 file
malloc(): invalid size (unsorted)
KCrash: crashing... crashRecursionCounter = 2
schoeller commented 5 years ago

@saberraz , @gioman please comment if you see ways to contribute more concerning this issue. Best, Sebastian

saberraz commented 5 years ago

@schoeller SWW format should be a part of MDAL and it is covered by tests: https://github.com/lutraconsulting/MDAL/tree/master/tests/data/sww/anuga-viewer

Could you make sure the format is following the AnuGA standard output. Nevertheless, QGIS should not crash if the format is not supported.

schoeller commented 5 years ago

@saberraz , @stoiber I have Anuga running on Anaconda, Windows 10 as recent git checkout building to anuga-2.0.3-py2.7.egg-info. I then successfully ran examples from the examples\simple_examples directory. Whereas the results for sww files for buildings.sww, channel1.sww, channel2.sww, channel3.sww load into anuga_viewer, on Qgis 3.8.1 buildings.sww loads and other examples crash. Please advise on whether I should make a pull request to add to MDAL SWW test data.

saberraz commented 5 years ago

@schoeller there are 2 issues here: 1- QGIS crashes and causes data corruption for an unsupported mesh format 2- MDAL does not support certain type of SWW format.

1 should be straight forward. @PeterPetrik can look into that at some point next week. 2 needs a bit of more investigation. Feel free to do a PR with example file in support of this issue: https://github.com/lutraconsulting/MDAL/issues/137 or even better to fix the issue!

PeterPetrik commented 5 years ago

as it is crash directly in MDAL library, 1. cannot be fixed (QGIS crashes because MDAL library crashed)

  1. fixed on MDAL master, will appear in MDAL 0.4.0 or MDAL 0.3.4
PeterPetrik commented 5 years ago

@schoeller as a workaround, please do not use any variables that are volume-based (ending with _c), either remove them or do not export them.

schoeller commented 5 years ago

@PeterPetrik thanks for the work done. Concerning your mention of a workaround it seems that when setting domain.store_centroids = False as suggested in https://github.com/GeoscienceAustralia/anuga_core/blob/3e9f18a43676ba20e524b86806814892c28e561f/anuga/file/sww.py#L542, then header information is written and the file loads ok.

It would be lovely though to close 1 to maintain workability.

PeterPetrik commented 5 years ago

As the crash is caused by direct segfault (core dump) or library MDAL, QGIS cannot do anything and hence there is no fix possible on QGIS site except updating MDAL library.