Bug 1203582 - gdalinfo segfaults reading a grib2 file
Summary: gdalinfo segfaults reading a grib2 file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gdal
Version: 21
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Devrim Gündüz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-19 07:59 UTC by Esa Östring
Modified: 2015-07-23 19:13 UTC (History)
25 users (show)

Fixed In Version: gdal-1.11.2-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-23 19:13:29 UTC
Type: Bug


Attachments (Terms of Use)
Valgrind run with "--leak-check full" (192.58 KB, text/plain)
2015-03-19 07:59 UTC, Esa Östring
no flags Details
Forecast data of temperatures causing gdalinfo segfault. (265.89 KB, application/octet-stream)
2015-03-19 08:01 UTC, Esa Östring
no flags Details

Description Esa Östring 2015-03-19 07:59:01 UTC
Created attachment 1003723 [details]
Valgrind run with "--leak-check full"

Description of problem: 

gdalinfo can't read temperature data from grib2 -file. Result is immediate segmentation fault.

Version-Release number of selected component (if applicable):

gdal-1.11.2-1


How reproducible:

gdalinfo temperature.grib2

Steps to Reproduce:
1. Install Fedora 21 x86_64
2. yum update
3. gdalinfo temperature.grib2

Actual results:

Segmentation fault

Expected results:

Information about contents of grib2 file containing temperature forecast.

Additional info:

Using another program for grib2 handling, wgrib2, information about file contents is printed as expected, no segmentation fault.

I previously filed a bug in osgeo (gdal maintainer), but they were not able to produce the problem in GDAL, but suggested to file a bug in Fedora.

osgeo ticket about this exact problem: https://trac.osgeo.org/gdal/ticket/5876

Comment 1 Esa Östring 2015-03-19 08:01:18 UTC
Created attachment 1003724 [details]
Forecast data of temperatures causing gdalinfo segfault.

Use this input file to check bug existence.

Comment 2 Suren Karapetyan 2015-03-20 13:40:15 UTC
I confirm that removing the gdal-g2clib.patch and rebuilding the rpm fixes the issue.

Comment 3 Orion Poplawski 2015-03-26 02:45:54 UTC
Okay, I think I've finally figured out at least part of the issue.  g2clib's grib2.h uses:

#ifdef __64BIT__
typedef int g2int;
typedef unsigned int g2intu;
#define PRIg2int "d"
#else
typedef long g2int;
typedef unsigned long g2intu;
#define PRIg2int "ld"
#endif

The problem is that nothing else defines __64BIT__ automatically.  So it means that all g2clib users must define __64BIT__ on 64 bit platforms as well.  I think we need a better patch for g2clib to make this check work automatically.

This could explain some other issues seen with g2clib users as well.

Comment 4 Orion Poplawski 2015-03-26 04:43:52 UTC
Hopefully there will be some new gdal builds to test here soon: 
https://copr.fedoraproject.org/coprs/orion/g2clib/

Comment 5 Orion Poplawski 2015-03-31 22:45:45 UTC
I've built F22 and F23 updates for gdal.  I'm going to let the normal gdal maintainers build/submit and F21/F20 update as there are some differences in the branches.

Comment 6 Alfonso Escribano 2015-05-20 09:20:44 UTC
We have same problen in CentOS 7.1.1503

Using g2clib gdal builds, problem is corrected.

Comment 7 Orion Poplawski 2015-05-26 21:13:53 UTC
The g2clib update is in EPEL7 now, so it should just be a matter of rebuilding gdal, which I'll leave to the gdal maintainers.

Comment 8 Adam Jackson 2015-05-27 15:16:05 UTC
*** Bug 1203927 has been marked as a duplicate of this bug. ***

Comment 9 Adam Jackson 2015-05-27 15:16:09 UTC
*** Bug 1204091 has been marked as a duplicate of this bug. ***

Comment 10 Adam Jackson 2015-05-27 15:16:12 UTC
*** Bug 1204398 has been marked as a duplicate of this bug. ***

Comment 11 Adam Jackson 2015-05-27 15:16:15 UTC
*** Bug 1210979 has been marked as a duplicate of this bug. ***

Comment 12 Adam Jackson 2015-05-27 15:16:18 UTC
*** Bug 1210980 has been marked as a duplicate of this bug. ***

Comment 13 Adam Jackson 2015-05-27 15:16:21 UTC
*** Bug 1211087 has been marked as a duplicate of this bug. ***

Comment 14 Adam Jackson 2015-05-27 15:16:25 UTC
*** Bug 1212529 has been marked as a duplicate of this bug. ***

Comment 15 Adam Jackson 2015-05-27 15:16:29 UTC
*** Bug 1212692 has been marked as a duplicate of this bug. ***

Comment 16 Adam Jackson 2015-05-27 15:16:33 UTC
*** Bug 1212908 has been marked as a duplicate of this bug. ***

Comment 17 Adam Jackson 2015-05-27 15:16:36 UTC
*** Bug 1212997 has been marked as a duplicate of this bug. ***

Comment 18 Adam Jackson 2015-05-27 15:16:39 UTC
*** Bug 1213551 has been marked as a duplicate of this bug. ***

Comment 19 Adam Jackson 2015-05-27 15:16:43 UTC
*** Bug 1214488 has been marked as a duplicate of this bug. ***

Comment 20 Adam Jackson 2015-05-27 15:16:47 UTC
*** Bug 1214974 has been marked as a duplicate of this bug. ***

Comment 21 Adam Jackson 2015-05-27 15:16:50 UTC
*** Bug 1217040 has been marked as a duplicate of this bug. ***

Comment 22 Adam Jackson 2015-05-27 15:16:53 UTC
*** Bug 1217213 has been marked as a duplicate of this bug. ***

Comment 23 Adam Jackson 2015-05-27 15:16:57 UTC
*** Bug 1217230 has been marked as a duplicate of this bug. ***

Comment 24 Adam Jackson 2015-05-27 15:17:00 UTC
*** Bug 1222400 has been marked as a duplicate of this bug. ***

Comment 25 Fedora Update System 2015-07-07 00:05:24 UTC
gdal-1.11.2-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/gdal-1.11.2-1.el7

Comment 26 Fedora Update System 2015-07-08 17:10:18 UTC
Package gdal-1.11.2-1.el7:
* should fix your issue,
* was pushed to the Fedora EPEL 7 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing gdal-1.11.2-1.el7'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2015-7068/gdal-1.11.2-1.el7
then log in and leave karma (feedback).

Comment 27 Fedora Update System 2015-07-23 19:13:29 UTC
gdal-1.11.2-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.