You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remember that although you ask for -Gabc.tiff, what is written here is a grid (netCDF). And you loose the green and blue layers since a grid is z only. I think you were imagining a subset of an image to be written? Also, you had some other GDAL related troubles so perhaps the crash is part of that?
Remember that although you ask for -Gabc.tiff, what is written here is a grid (netCDF). And you loose the green and blue layers since a grid is z only. I think you were imagining a subset of an image to be written?
I didn't realize that. I expect to have a subset of an image, written in tiff format.
Also, you had some other GDAL related troubles so perhaps the crash is part of that?
gmt grdinfo @earth_day_05m works well for me. gmt grdcut @earth_day_05m -R0/30/0/30 -Gabc.tiff -Vd shows the following messages before crashing:
grdcut [DEBUG]: gmt_get_filename: In: /Users/seisman/.gmt/server/earth/earth_day/earth_day_05m_p.hdr Out: /Users/seisman/.gmt/server/earth/earth_day/earth_day_05m_p.hdr
grdcut [DEBUG]: Found readable file /Users/seisman/.gmt/server/earth/earth_day/earth_day_05m_p.tif
grdcut [INFORMATION]: File /Users/seisman/.gmt/server/earth/earth_day/earth_day_05m_p.tif reads with GDAL driver GTiff
grdcut [DEBUG]: Found readable file /Users/seisman/.gmt/server/earth/earth_day/earth_day_05m_p.tif
grdcut [DEBUG]: Geographic input grid, longitudes span less than 360
grdcut [DEBUG]: Call gmtgrdio_doctor_geo_increments on a geographic grid
grdcut [DEBUG]: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter.
grdcut [DEBUG]: Geographic input grid, longitudes span exactly 360
grdcut [DEBUG]: GMT_End_IO: Input resource access is now disabled
grdcut [DEBUG]: gmtapi_begin_io: Input resource access is now enabled [container]
grdcut [DEBUG]: gmtapi_import_grid: Passed ID = 0 and mode = 2
grdcut [INFORMATION]: Reading grid from file /Users/seisman/.gmt/server/earth/earth_day/earth_day_05m_p.tif
grdcut [INFORMATION]: Read band(s): 1
grdcut [DEBUG]: Found readable file /Users/seisman/.gmt/server/earth/earth_day/earth_day_05m_p.tif
grdcut [DEBUG]: Found readable file /Users/seisman/.gmt/server/earth/earth_day/earth_day_05m_p.tif
ERROR: Caught signal number 11 (Segmentation fault: 11) at
0 libgmt.6.dylib 0x0000000104c06439 gmt_gdal_read_grd + 2057
1 ??? 0x00007ff9778e2000 0x0 + 140709429387264
Stack backtrace:
0 libgmt.6.dylib 0x0000000104bb5ef2 sig_handler + 578
1 libsystem_platform.dylib 0x00007fff6fe815fd _sigtramp + 29
2 ??? 0x0000000000000006 0x0 + 6
3 libgmt.6.dylib 0x0000000104c195a9 gmtlib_read_grd + 185
4 libgmt.6.dylib 0x0000000104be9635 gmtapi_import_grid + 4885
5 libgmt.6.dylib 0x0000000104be39b5 gmtapi_import_data + 437
6 libgmt.6.dylib 0x0000000104bd090c gmtapi_get_data + 348
7 libgmt.6.dylib 0x0000000104bc8d11 GMT_Read_Data + 4849
8 libgmt.6.dylib 0x0000000104e35218 GMT_grdcut + 11640
9 libgmt.6.dylib 0x0000000104bd895c GMT_Call_Module + 2156
10 gmt 0x0000000104ba59a8 main + 2568
11 libdyld.dylib 0x00007fff6fc88cc9 start + 1
12 ??? 0x0000000000000006 0x0 + 6
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.
@seisman, would you be able to check whether #5798 fixes this crash? For me, it works fine but it seems that the problem was not easily reproducible to start with.
Activity
PaulWessel commentedon Aug 18, 2020
Cannot immediately reproduce that:
seisman commentedon Aug 18, 2020
Tried both GDAL 2.4.4 and 3.1.2. They both crash.
PaulWessel commentedon Aug 18, 2020
OK, after dinner and movie...
joa-quim commentedon Aug 18, 2020
It doesn't crash for me neither.
PaulWessel commentedon Sep 3, 2020
Remember that although you ask for -Gabc.tiff, what is written here is a grid (netCDF). And you loose the green and blue layers since a grid is z only. I think you were imagining a subset of an image to be written? Also, you had some other GDAL related troubles so perhaps the crash is part of that?
PaulWessel commentedon Sep 3, 2020
If we actually wanted grdcut to work on images like you probably expected, the shortcut to implementation would be
Coded up as a short functions that sets the virtual files stuff it is all done in memory.
joa-quim commentedon Sep 3, 2020
We talked this before. The solution should go into grdgdal.
seisman commentedon Sep 3, 2020
I didn't realize that. I expect to have a subset of an image, written in tiff format.
gmt grdinfo @earth_day_05mworks well for me.gmt grdcut @earth_day_05m -R0/30/0/30 -Gabc.tiff -Vdshows the following messages before crashing:Debugging in xcode shows the crash point:

head->sizeis 132694, andjis 131072.stale commentedon Dec 4, 2020
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.
joa-quim commentedon Mar 15, 2021
Hmm, but this tiff file is indexed so it should have ~worked (though loose the cpt).
PaulWessel commentedon Mar 15, 2021
Does this still crash for @seisman ? Works fine for me.
seisman commentedon Mar 15, 2021
It still crashes for me.
joa-quim commentedon Mar 15, 2021
And for me too, but Kristof showed as the example of the land cover file where he was able to do a
grdcuton a single band tif file.stale commentedon Jun 16, 2021
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.
maxrjones commentedon Sep 27, 2021
@seisman, would you be able to check whether #5798 fixes this crash? For me, it works fine but it seems that the problem was not easily reproducible to start with.
seisman commentedon Sep 27, 2021
Yes, it works with PR #5798.
maxrjones commentedon Sep 27, 2021
Great, thanks!
maxrjones commentedon Sep 28, 2021
Fixed by #5798