# Crash when importing Cloud-Optimised Geotiff

**URL:** https://discourse.gplates.org/t/crash-when-importing-cloud-optimised-geotiff/725
**Category:** Bug Reports
**Created:** [3 September 2023 10:20 UTC](https://discourse.gplates.org/t/crash-when-importing-cloud-optimised-geotiff/725 "2023-09-03T10:20:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![chhei](https://discourse.gplates.org/letter_avatar_proxy/v4/letter/c/90ced4/32.png) [@chhei](https://discourse.gplates.org/u/chhei)
#### Post date: [3 September 2023 10:20 UTC](https://discourse.gplates.org/t/crash-when-importing-cloud-optimised-geotiff/725/1 "2023-09-03T10:20:19Z")

</div>

Hi John,

I am experiencing a crash when trying to open a [cloud-optimised geotiff](https://www.cogeo.org) which I produced using GDAL 3.7 like this:

```
gdal_translate input.tif output_cog.tif -of COG -co COMPRESS=LZW  

```

Happens on MacOS 10.15.x (yes… I know) and GPlates 2.3.0, crash log attached below. The log seems to say that this is related to the JPEG compression.

Cheers,  
Christian

Process: gplates [6043]  
Path: /Applications/gplates.app/Contents/MacOS/gplates  
Identifier: GPlates 2.3.0-Darwin-19.6.0  
Version: 2.3.0 (2.3.0)  
Code Type: X86-64 (Native)  
Parent Process: ??? [1]  
Responsible: gplates [6043]  
User ID: 651

Date/Time: 2023-09-03 12:11:22.683 +0200  
OS Version: Mac OS X 10.15.7 (19H2026)  
Report Version: 12  
Bridge OS Version: 6.6 (19P6064)

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC\_CRASH (SIGABRT)  
Exception Codes: 0x0000000000000000, 0x0000000000000000  
Exception Note: EXC\_CORPSE\_NOTIFY

Application Specific Information:  
Assertion failed: (sp-\>cinfo.comm.is\_decompressor), function JPEGSetupDecode, file tif\_jpeg.c, line 1021.

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread  
0 libsystem\_kernel.dylib 0x00007fff67c5a32a \_\_pthread\_kill + 10  
1 libsystem\_pthread.dylib 0x00007fff67d16e60 pthread\_kill + 430  
2 libsystem\_c.dylib 0x00007fff67be1808 abort + 120  
3 libsystem\_c.dylib 0x00007fff67be0ac6 \_\_assert\_rtn + 314  
4 libgdal.29.dylib 0x000000010c4cef8e JPEGSetupDecode.cold.2 + 35  
5 libgdal.29.dylib 0x000000010bfbdd7d JPEGSetupDecode + 442  
6 libgdal.29.dylib 0x000000010bfd51c4 TIFFStartTile + 31  
7 libgdal.29.dylib 0x000000010bfd49aa TIFFReadEncodedTile + 138  
8 libgdal.29.dylib 0x000000010bd6160a GTiffDataset::ReadStrile(int, void\*, long long) + 256  
9 libgdal.29.dylib 0x000000010bd61baa GTiffDataset::LoadBlockBuf(int, bool) + 402  
10 libgdal.29.dylib 0x000000010bd618cc GTiffRasterBand::IReadBlock(int, int, void\*) + 526  
11 libgdal.29.dylib 0x000000010c0bb187 GDALRasterBand::GetLockedBlockRef(int, int, int) + 371  
12 libgdal.29.dylib 0x000000010c0d66ed GDALRasterBand::IRasterIO(GDALRWFlag, int, int, int, int, void\*, int, int, GDALDataType, long long, long long, GDALRasterIOExtraArg\*) + 2401  
13 libgdal.29.dylib 0x000000010bd61205 GTiffRasterBand::IRasterIO(GDALRWFlag, int, int, int, int, void\*, int, int, GDALDataType, long long, long long, GDALRasterIOExtraArg\*) + 1087  
14 libgdal.29.dylib 0x000000010c0ba587 GDALRasterBand::RasterIO(GDALRWFlag, int, int, int, int, void\*, int, int, GDALDataType, long long, long long, GDALRasterIOExtraArg\*) + 735  
15 GPlates 2.3.0-Darwin-19.6.0 0x0000000109068296 void GPlatesFileIO::GDALRasterReader::add\_rgba\_data(GPlatesGui::rgba8\_t\*, GPlatesFileIO::GDALRasterReader::RasterBand::GDALRgbaBands const&, bool, unsigned int, unsigned int, unsigned int, unsigned int) + 534  
16 GPlates 2.3.0-Darwin-19.6.0 0x0000000109067f46 void GPlatesFileIO::GDALRasterReader::add\_dataGPlatesGui::rgba8\_t(GPlatesGui::rgba8\_t\*, GPlatesFileIO::GDALRasterReader::RasterBand const&, bool, unsigned int, unsigned int, unsigned int, unsigned int) + 86  
17 GPlates 2.3.0-Darwin-19.6.0 0x000000010908f309 boost::optional\<GPlatesPropertyValues::RawRasterImpl\<GPlatesGui::rgba8\_t, GPlatesPropertyValues::RawRasterDataPolicies::WithData, GPlatesPropertyValues::RawRasterStatisticsPolicies::WithoutStatistics, GPlatesPropertyValues::RawRasterNoDataValuePolicies::WithoutNoDataValue\>::non\_null\_ptr\_type\> GPlatesFileIO::GDALRasterReader::read\_data\<GPlatesPropertyValues::RawRasterImpl\<GPlatesGui::rgba8\_t, GPlatesPropertyValues::RawRasterDataPolicies::WithData, GPlatesPropertyValues::RawRasterStatisticsPolicies::WithoutStatistics, GPlatesPropertyValues::RawRasterNoDataValuePolicies::WithoutNoDataValue\> \>(GPlatesFileIO::GDALRasterReader::RasterBand const&, bool, QRect const&) + 297  
18 GPlates 2.3.0-Darwin-19.6.0 0x000000010908e786 void GPlatesFileIO::GDALRasterReader::hilbert\_curve\_traversal\<GPlatesPropertyValues::RawRasterImpl\<GPlatesGui::rgba8\_t, GPlatesPropertyValues::RawRasterDataPolicies::WithData, GPlatesPropertyValues::RawRasterStatisticsPolicies::WithoutStatistics, GPlatesPropertyValues::RawRasterNoDataValuePolicies::WithoutNoDataValue\> \>(GPlatesFileIO::GDALRasterReader::RasterBand&, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, QDataStream&, GPlatesFileIO::RasterFileCacheFormat::BlockInfos&, boost::optional\<GPlatesPropertyValues::RawRasterImpl\<GPlatesGui::rgba8\_t, GPlatesPropertyValues::RawRasterDataPolicies::WithData, GPlatesPropertyValues::RawRasterStatisticsPolicies::WithoutStatistics, GPlatesPropertyValues::RawRasterNoDataValuePolicies::WithoutNoDataValue\>::non\_null\_ptr\_type\>, QRect, GPlatesFileIO::ReadErrorAccumulation\*, double&, double&, double&, double&, long long&) + 230  
19 GPlates 2.3.0-Darwin-19.6.0 0x000000010908e61a void GPlatesFileIO::GDALRasterReader::write\_source\_raster\_file\_cache\_image\_data\<GPlatesPropertyValues::RawRasterImpl\<GPlatesGui::rgba8\_t, GPlatesPropertyValues::RawRasterDataPolicies::WithData, GPlatesPropertyValues::RawRasterStatisticsPolicies::WithoutStatistics, GPlatesPropertyValues::RawRasterNoDataValuePolicies::WithoutNoDataValue\> \>(GPlatesFileIO::GDALRasterReader::RasterBand&, QFile&, QDataStream&, GPlatesFileIO::RasterFileCacheFormat::BlockInfos&, GPlatesFileIO::ReadErrorAccumulation\*, double&, double&, double&, double&, long long&) + 266  
20 GPlates 2.3.0-Darwin-19.6.0 0x0000000109072d79 void GPlatesFileIO::GDALRasterReader::write\_source\_raster\_file\_cache\<GPlatesPropertyValues::RawRasterImpl\<GPlatesGui::rgba8\_t, GPlatesPropertyValues::RawRasterDataPolicies::WithData, GPlatesPropertyValues::RawRasterStatisticsPolicies::WithoutStatistics, GPlatesPropertyValues::RawRasterNoDataValuePolicies::WithoutNoDataValue\> \>(GPlatesFileIO::GDALRasterReader::RasterBand&, QString const&, GPlatesFileIO::ReadErrorAccumulation\*) + 841  
21 GPlates 2.3.0-Darwin-19.6.0 0x000000010906ef0c GPlatesFileIO::GDALRasterReader::create\_source\_raster\_file\_cache(GPlatesFileIO::GDALRasterReader::RasterBand&, unsigned int, GPlatesFileIO::ReadErrorAccumulation\*) + 220  
22 GPlates 2.3.0-Darwin-19.6.0 0x000000010906ce83 GPlatesFileIO::GDALRasterReader::create\_source\_raster\_file\_cache\_format\_reader(GPlatesFileIO::GDALRasterReader::RasterBand&, unsigned int, GPlatesFileIO::ReadErrorAccumulation\*) + 1443  
23 GPlates 2.3.0-Darwin-19.6.0 0x000000010906b8c7 GPlatesFileIO::GDALRasterReader::GDALRasterReader(QString const&, GPlatesFileIO::RasterReader\*, GPlatesFileIO::ReadErrorAccumulation\*) + 359  
24 GPlates 2.3.0-Darwin-19.6.0 0x00000001091a78c1 GPlatesFileIO::RasterReader::RasterReader(QString const&, GPlatesFileIO::ReadErrorAccumulation\*) + 577  
25 GPlates 2.3.0-Darwin-19.6.0 0x00000001091a72a3 GPlatesFileIO::RasterReader::create(QString const&, GPlatesFileIO::ReadErrorAccumulation\*) + 67  
26 GPlates 2.3.0-Darwin-19.6.0 0x000000010971e8b3 GPlatesQtWidgets::ImportRasterDialog::display(bool, GPlatesFileIO::ReadErrorAccumulation\*) + 931  
27 GPlates 2.3.0-Darwin-19.6.0 0x000000010983ae36 GPlatesQtWidgets::ViewportWindow::pop\_up\_import\_raster\_dialog(bool) + 246  
28 GPlates 2.3.0-Darwin-19.6.0 0x00000001092cf431 GPlatesGui::ImportMenu::handle\_action\_triggered(QAction\*) + 65  
29 org.qt-project.QtCore 0x000000010b5e4120 0x10b48b000 + 1413408  
30 org.qt-project.QtWidgets 0x000000010a7ef523 QActionGroup::triggered(QAction\*) + 55  
31 org.qt-project.QtCore 0x000000010b5e4120 0x10b48b000 + 1413408  
32 org.qt-project.QtWidgets 0x000000010a7ee0d4 QAction::triggered(bool) + 56  
33 org.qt-project.QtWidgets 0x000000010a7edfb8 QAction::activate(QAction::ActionEvent) + 224  
34 org.qt-project.QtCore 0x000000010b5df43f QObject::event(QEvent\*) + 693  
35 org.qt-project.QtWidgets 0x000000010a7f402a QApplicationPrivate::notify\_helper(QObject\*, QEvent\*) + 212  
36 org.qt-project.QtWidgets 0x000000010a7f4e87 QApplication::notify(QObject\*, QEvent\*) + 481  
37 GPlates 2.3.0-Darwin-19.6.0 0x00000001092c491c GPlatesGui::GPlatesQApplication::notify(QObject\*, QEvent\*) + 156  
38 org.qt-project.QtCore 0x000000010b5c556c QCoreApplication::notifyInternal2(QObject\*, QEvent\*) + 138  
39 org.qt-project.QtCore 0x000000010b5c60e0 QCoreApplicationPrivate::sendPostedEvents(QObject\*, int, QThreadData\*) + 392  
40 libqcocoa.dylib 0x0000000112a156c2 0x1129e6000 + 194242  
41 libqcocoa.dylib 0x0000000112a15c6e 0x1129e6000 + 195694  
42 com.apple.CoreFoundation 0x00007fff2ea93f92 **CFRUNLOOP\_IS\_CALLING\_OUT\_TO\_A\_SOURCE0\_PERFORM\_FUNCTION** + 17  
43 com.apple.CoreFoundation 0x00007fff2ea93f31 \_\_CFRunLoopDoSource0 + 103  
44 com.apple.CoreFoundation 0x00007fff2ea93d4b \_\_CFRunLoopDoSources0 + 209  
45 com.apple.CoreFoundation 0x00007fff2ea92a7a \_\_CFRunLoopRun + 927  
46 com.apple.CoreFoundation 0x00007fff2ea9207e CFRunLoopRunSpecific + 462  
47 com.apple.HIToolbox 0x00007fff2d710aad RunCurrentEventLoopInMode + 292  
48 com.apple.HIToolbox 0x00007fff2d7107c5 ReceiveNextEventCommon + 584  
49 com.apple.HIToolbox 0x00007fff2d710569 \_BlockUntilNextEventMatchingListInModeWithFilter + 64  
50 com.apple.AppKit 0x00007fff2bd593c9 \_DPSNextEvent + 883  
51 com.apple.AppKit 0x00007fff2bd57c10 -[NSApplication(NSEvent) \_nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352  
52 com.apple.AppKit 0x00007fff2bd4991e -[NSApplication run] + 658  
53 libqcocoa.dylib 0x0000000112a14eb0 0x1129e6000 + 192176  
54 org.qt-project.QtCore 0x000000010b5c31f8 QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 284  
55 org.qt-project.QtCore 0x000000010b5c59db QCoreApplication::exec() + 123  
56 GPlates 2.3.0-Darwin-19.6.0 0x0000000108de1356 internal\_main(int, char\*\*) + 1494  
57 GPlates 2.3.0-Darwin-19.6.0 0x00000001092c599c GPlatesGui::GPlatesQApplication::call\_main(int (\*)(int, char\*\*), int, char\*\*) + 108  
58 libdyld.dylib 0x00007fff67b12cc9 start + 1

Thread 1:  
0 libsystem\_pthread.dylib 0x00007fff67d12b68 start\_wqthread + 0

Thread 2:: Qt bearer thread  
0 libsystem\_kernel.dylib 0x00007fff67c5a3c6 poll + 10  
1 org.qt-project.QtCore 0x000000010b601d5f qt\_safe\_poll(pollfd\*, unsigned int, timespec const\*) + 187  
2 org.qt-project.QtCore 0x000000010b602a66 QEventDispatcherUNIX::processEvents(QFlagsQEventLoop::ProcessEventsFlag) + 356  
3 org.qt-project.QtCore 0x000000010b5c31f8 QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 284  
4 org.qt-project.QtCore 0x000000010b4a7604 QThread::exec() + 86  
5 org.qt-project.QtCore 0x000000010b4a8224 0x10b48b000 + 119332  
6 libsystem\_pthread.dylib 0x00007fff67d17109 \_pthread\_start + 148  
7 libsystem\_pthread.dylib 0x00007fff67d12b8b thread\_start + 15

Thread 3:: Thread (pooled)  
0 libsystem\_kernel.dylib 0x00007fff67c56872 \_\_psynch\_cvwait + 10  
1 libsystem\_pthread.dylib 0x00007fff67d17425 \_pthread\_cond\_wait + 698  
2 org.qt-project.QtCore 0x000000010b4ad713 0x10b48b000 + 141075  
3 org.qt-project.QtCore 0x000000010b4ad519 0x10b48b000 + 140569  
4 org.qt-project.QtCore 0x000000010b4ad484 QWaitCondition::wait(QMutex\*, QDeadlineTimer) + 108  
5 org.qt-project.QtCore 0x000000010b4aa88e 0x10b48b000 + 129166  
6 org.qt-project.QtCore 0x000000010b4a8224 0x10b48b000 + 119332  
7 libsystem\_pthread.dylib 0x00007fff67d17109 \_pthread\_start + 148  
8 libsystem\_pthread.dylib 0x00007fff67d12b8b thread\_start + 15

Thread 4:  
0 libsystem\_pthread.dylib 0x00007fff67d12b68 start\_wqthread + 0

Thread 5:: com.apple.NSEventThread  
0 libsystem\_kernel.dylib 0x00007fff67c53dea mach\_msg\_trap + 10  
1 libsystem\_kernel.dylib 0x00007fff67c54160 mach\_msg + 60  
2 com.apple.CoreFoundation 0x00007fff2ea94135 \_\_CFRunLoopServiceMachPort + 247  
3 com.apple.CoreFoundation 0x00007fff2ea92c02 \_\_CFRunLoopRun + 1319  
4 com.apple.CoreFoundation 0x00007fff2ea9207e CFRunLoopRunSpecific + 462  
5 com.apple.AppKit 0x00007fff2befabf4 \_NSEventThread + 132  
6 libsystem\_pthread.dylib 0x00007fff67d17109 \_pthread\_start + 148  
7 libsystem\_pthread.dylib 0x00007fff67d12b8b thread\_start + 15

Thread 6:: com.apple.CFSocket.private  
0 libsystem\_kernel.dylib 0x00007fff67c5c0ee \_\_select + 10  
1 com.apple.CoreFoundation 0x00007fff2eabce93 \_\_CFSocketManager + 641  
2 libsystem\_pthread.dylib 0x00007fff67d17109 \_pthread\_start + 148  
3 libsystem\_pthread.dylib 0x00007fff67d12b8b thread\_start + 15

Thread 7:: GPlatesApi::PythonExecutionThread  
0 libsystem\_kernel.dylib 0x00007fff67c5a3c6 poll + 10  
1 org.qt-project.QtCore 0x000000010b601d5f qt\_safe\_poll(pollfd\*, unsigned int, timespec const\*) + 187  
2 org.qt-project.QtCore 0x000000010b602a66 QEventDispatcherUNIX::processEvents(QFlagsQEventLoop::ProcessEventsFlag) + 356  
3 org.qt-project.QtCore 0x000000010b5c31f8 QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 284  
4 GPlates 2.3.0-Darwin-19.6.0 0x0000000108e5bfdf GPlatesApi::PythonExecutionThread::run() + 287  
5 org.qt-project.QtCore 0x000000010b4a8224 0x10b48b000 + 119332  
6 libsystem\_pthread.dylib 0x00007fff67d17109 \_pthread\_start + 148  
7 libsystem\_pthread.dylib 0x00007fff67d12b8b thread\_start + 15

Thread 8:  
0 libsystem\_pthread.dylib 0x00007fff67d12b68 start\_wqthread + 0

Thread 9:  
0 libsystem\_pthread.dylib 0x00007fff67d12b68 start\_wqthread + 0

Thread 0 crashed with X86 Thread State (64-bit):  
rax: 0x0000000000000000 rbx: 0x0000000116778dc0 rcx: 0x00007ffee6e22bf8 rdx: 0x0000000000000000  
rdi: 0x0000000000000307 rsi: 0x0000000000000006 rbp: 0x00007ffee6e22c20 rsp: 0x00007ffee6e22bf8  
r8: 0x00000000000003fd r9: 0xcccccccccccccccd r10: 0x0000000116778dc0 r11: 0x0000000000000246  
r12: 0x0000000000000307 r13: 0x0000000129ff9000 r14: 0x0000000000000006 r15: 0x0000000000000016  
rip: 0x00007fff67c5a32a rfl: 0x0000000000000246 cr2: 0x0000000129ff9000

Logical CPU: 0  
Error Code: 0x02000148  
Trap Number: 133

---

<div class="post-metadata">

### Author: ![john.cannon](https://discourse.gplates.org/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@john.cannon](https://discourse.gplates.org/u/john.cannon)
#### Post date: [7 September 2023 05:23 UTC](https://discourse.gplates.org/t/crash-when-importing-cloud-optimised-geotiff/725/2 "2023-09-07T05:23:59Z")

</div>

Hi Christian,

Interesting, sounds like it could be a GDAL issue.

Does the `gplates_2.3.1-beta.8_Darwin-x86_64.dmg` build in [this post](https://discourse.gplates.org/t/geometries-hanging-off-edge-of-map/721/6) have the same problem? That uses GDAL 3.7 whereas GPlates 2.3 uses GDAL 2.9 (as far as I can tell).

I tried creating a cloud-optimised geotiff (the same way you did) and importing that into GPlates 2.3 (on macOS 10.15). That worked for me though. If the above GPlates build still crashes feel free to send me the TIF that causes your crash.

---

<div class="post-metadata">

### Author: ![chhei](https://discourse.gplates.org/letter_avatar_proxy/v4/letter/c/90ced4/32.png) [@chhei](https://discourse.gplates.org/u/chhei)
#### Post date: [11 September 2023 07:40 UTC](https://discourse.gplates.org/t/crash-when-importing-cloud-optimised-geotiff/725/3 "2023-09-11T07:40:35Z")

</div>

Hi John,

haven’t had time to try the beta version yet.

> whereas GPlates 2.3 uses GDAL 2.9 (as far as I can tell).

yes, that sounds like this is the root cause. Cloud optimised geotifs were only added in GDAL 3.6 or so, I think.

If you don’t hear from me it’s worked in the beta and consider it fixed, otherwise I’ll report back.

Thanks for the pointer and the link to the beta.

Cheers,  
Christian

---

<div class="post-metadata">

### Author: ![chhei](https://discourse.gplates.org/letter_avatar_proxy/v4/letter/c/90ced4/32.png) [@chhei](https://discourse.gplates.org/u/chhei)
#### Post date: [13 September 2023 19:19 UTC](https://discourse.gplates.org/t/crash-when-importing-cloud-optimised-geotiff/725/4 "2023-09-13T19:19:43Z")

</div>

> Does the `gplates_2.3.1-beta.8_Darwin-x86_64.dmg` build in [this post](https://discourse.gplates.org/t/geometries-hanging-off-edge-of-map/721/6) have the same problem?

No - It all works! ™

Cheers,  
Christian
