Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing a netcdf raster in Windows causes core dump #28980

Closed
qgib opened this issue Feb 4, 2019 · 17 comments
Closed

Closing a netcdf raster in Windows causes core dump #28980

qgib opened this issue Feb 4, 2019 · 17 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers High Priority

Comments

@qgib
Copy link
Contributor

qgib commented Feb 4, 2019

Author Name: Saber Razmjooei (@saberraz)
Original Redmine Issue: 21162
Affected QGIS version: 3.5(master)
Redmine category:data_provider
Assignee: Jürgen Fischer


To reproduce:
1- Download http://mf2.ipma.pt/downloads/?latest=arome.2m.relative_humidity&region=PT2
2- Add the netcdf as raster
3- Right-click and remove the raster in layers panel
4- Boom

This is a Windows only issue and might be related to netcdf driver.
See also:
lutraconsulting/MDAL#90


@qgib
Copy link
Contributor Author

qgib commented Feb 4, 2019

Author Name: Jürgen Fischer (@jef-n)


gdalinfo also crashes.

@qgib
Copy link
Contributor Author

qgib commented Feb 4, 2019

Author Name: Saber Razmjooei (@saberraz)


It is confirmed that custom QGIS builds with netcdf 4.6.x in Windows do not crash.
So, I am pretty sure it is due to old netcdf driver.

@qgib
Copy link
Contributor Author

qgib commented Feb 5, 2019

Author Name: Saber Razmjooei (@saberraz)


It is the same issue as:
https://trac.osgeo.org/osgeo4w/ticket/551

Update to the newer versions of netcdf should resolve the problem.

@qgib
Copy link
Contributor Author

qgib commented Feb 5, 2019

Author Name: Pedro Venâncio (Pedro Venâncio)


Downgrading netcdf driver to 4.3.0-1, also available in OSGeo4W, is not an option here, because this NetCDF files are not correctly recognized as Raster (min and max value always 1.79769e+308) with this version.

Loading them as Mesh gives

Invalid Data Source: D:\AROME_OPER_001_FC_SP_PT2_025_RH_2-HTGL_2019020412.nc is not a valid or recognized data source.

@qgib
Copy link
Contributor Author

qgib commented Feb 5, 2019

Author Name: Jürgen Fischer (@jef-n)


  • assigned_to_id was configured as Jürgen Fischer

@qgib
Copy link
Contributor Author

qgib commented Feb 5, 2019

Author Name: Alexandre Neto (@SrNetoChan)


I am getting a CRASH even before loading the data. Simply using the browser panel to navigate to it, as soon as I reach a folder with one of those files, QGIS crashes.

@qgib
Copy link
Contributor Author

qgib commented Feb 5, 2019

Author Name: Alexandre Neto (@SrNetoChan)


This is the crash report I get:

Crash ID: be28959efc88f41008b90f2715e269b9959ca36c

Stack Trace

RtlFreeHeap :
free_base :
nc_set_var_chunk_cache_ints :
nc_set_var_chunk_cache_ints :
NC4_sync :
NC4_close :
nc_close :
GDALRegister_netCDF :
GDALRegister_netCDF :
QgsLayoutUtils::fontHeightCharacterMM :
OGREnvelope::IsInit :
OGREnvelope::IsInit :
QgsLayoutUtils::fontHeightCharacterMM :
QgsLayoutUtils::fontHeightCharacterMM :
QgsLayoutUtils::fontHeightCharacterMM :
QgsLayoutUtils::fontHeightCharacterMM :
QThreadPoolPrivate::reset :
QThread::start :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.5.0-Master
QGIS code revision: 4a44306
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 2.4.0
Running against GDAL: 2.4.0

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.17763

@qgib
Copy link
Contributor Author

qgib commented Feb 6, 2019

Author Name: Jürgen Fischer (@jef-n)


rebuilt / updated szip, hdf4, hdf5 and netcdf in OSGeo4W using VC14.


  • status_id was changed from Open to Closed
  • resolution was changed from to fixed/implemented

@qgib qgib closed this as completed Feb 6, 2019
@qgib
Copy link
Contributor Author

qgib commented Feb 6, 2019

Author Name: Saber Razmjooei (@saberraz)


Thanks jef for the update.

Now, I can open the netcdf in QGIS 3.4 but in master it fails to open altogether. @pedro @alexandre could you confirm?

@qgib
Copy link
Contributor Author

qgib commented Feb 6, 2019

Author Name: Jürgen Fischer (@jef-n)


Saber Razmjooei wrote:

Thanks jef for the update.

Now, I can open the netcdf in QGIS 3.4 but in master it fails to open altogether. @pedro @alexandre could you confirm?

works fine in the nightly (64bit) of 185855b for me.

@qgib
Copy link
Contributor Author

qgib commented Feb 6, 2019

Author Name: Saber Razmjooei (@saberraz)


Brilliant, I did a re-install and all works well.

Thanks a lot for the prompt upgrade of the libraries!

@qgib
Copy link
Contributor Author

qgib commented Feb 6, 2019

Author Name: Pedro Venâncio (Pedro Venâncio)


Jürgen Fischer wrote:

Saber Razmjooei wrote:

Thanks jef for the update.

Now, I can open the netcdf in QGIS 3.4 but in master it fails to open altogether. @pedro @alexandre could you confirm?

works fine in the nightly (64bit) of 185855b for me.

Hi Jurgen,

I'm also with problems in master (code revision 185855b).

Now I don't have any crash in browser when opening the folder with these NetCDF files, but when I try to load them in QGIS, I get:

  • Loading as Mesh:
2019-02-06T09:26:19     CRITICAL    Layer is not valid : The layer is not a valid layer and can not be added to the map

2019-02-06T09:29:53     CRITICAL    Invalid Data Source : C:\Users\pedro.venancio\Documents\Nova_pasta_2\AROME_OPER_001_FC_SP_PT2_025_RH_2-HTGL_2019020512.nc is not a valid or recognized data source.

  • Loading as Raster:
2019-02-06T09:27:06     CRITICAL    Invalid Layer : GDAL provider Cannot open GDAL dataset C:/Users/pedro.venancio/Documents/Nova_pasta_2/AROME_OPER_001_FC_SP_PT2_025_RH_2-HTGL_2019020512.nc:
             `C:/Users/pedro.venancio/Documents/Nova_pasta_2/AROME_OPER_001_FC_SP_PT2_025_RH_2-HTGL_2019020512.nc' not recognized as a supported file format. (file: ..\..\..\src\providers\gdal\qgsgdalprovider.cpp row: 2616function QgsGdalProvider::initIfNeeded:)
             Raster layer Provider is not valid (provider: gdal, URI: C:/Users/pedro.venancio/Documents/Nova_pasta_2/AROME_OPER_001_FC_SP_PT2_025_RH_2-HTGL_2019020512.nc (file: ..\..\..\src\core\raster\qgsrasterlayer.cpp row: 616function QgsRasterLayer::setDataProvider:)

With QGIS 3.4.4 everything works fine.

@qgib
Copy link
Contributor Author

qgib commented Feb 6, 2019

Author Name: Saber Razmjooei (@saberraz)


@pedro,

I had the same issue. But I re-ran OSGeo4W installer and marked gdal and qgis-dev to be re-installed. It worked after re-installation.

@qgib
Copy link
Contributor Author

qgib commented Feb 6, 2019

Author Name: Pedro Venâncio (Pedro Venâncio)


Hi Saber,

I re-installed qgis-dev, gdal and netcdf, but I get the same behaviour in master.

This is even more strange.

In Browser, if I load the .nc file, first as Raster, and then as Mesh, everything works fine.

If I try to load the Mesh first, I get that error.

Please see the screencast attached.

The same happens loading .nc files from Data Source Manager (First as Raster, then as Mesh -> ok | First as Mesh -> Invalid Data Source: C:\Users\pedro.venancio\Documents\netcdf\AROME_OPER_001_FC_SP_PT2_025_TMP_2-HTGL_2019020600.nc is not a valid or recognized data source.).

The context menu is also different in both versions.


  • 14249 was configured as NetCDF_QGIS_Master.gif
  • 14250 was configured as NetCDF_context_menu.jpg

@qgib
Copy link
Contributor Author

qgib commented Feb 6, 2019

Author Name: Saber Razmjooei (@saberraz)


I can confirm the issue. I think it is a browser problem with handling the file formats. Everything works as expected from Add Source Layer option.

Let me try it in the latest Linux build and we can open a new ticket.

@qgib
Copy link
Contributor Author

qgib commented Feb 6, 2019

Author Name: Jürgen Fischer (@jef-n)


Saber Razmjooei wrote:

I can confirm the issue. I think it is a browser problem with handling the file formats. Everything works as expected from Add Source Layer option.

Let me try it in the latest Linux build and we can open a new ticket.

Wait for the next nightly build - the current might still be built with the previous HDF5 (so the MDAL provider might still have issues, that GDAL doesn't have anymore).

@qgib
Copy link
Contributor Author

qgib commented Feb 7, 2019

Author Name: Pedro Venâncio (Pedro Venâncio)


Jürgen Fischer wrote:

Wait for the next nightly build - the current might still be built with the previous HDF5 (so the MDAL provider might still have issues, that GDAL doesn't have anymore).

Seems fixed now Jürgen!

Thank you very much!

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Data Provider Related to specific vector, raster or mesh data providers labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers High Priority
Projects
None yet
Development

No branches or pull requests

1 participant