file-heif HEIC import or export of high bit depth image broken
GIMP version: master
Operating System: Linux at least
Package: dev build
Description of the bug
@dnovomesky This is for you!
Exporting an image as HEIC in high bit depth seems to work but re-importing the same image fails (or in some basic cases, like a blank canvas, it re-opens it but with wrong colors). I am not sure if the main bug is in import or export, as I have no other program which knows how to open HEIC files so I can't check if the exported HEIC is actually valid.
Note 0: the bug does not happen with AVIF, only HEIC.
Note 1: I am not sure if the main issue is in import or export. Nevertheless if it turns out to be an export bug, then import must also be fixed to not crash when being given a corrupted HEIC. It should simply gracefully exit with an error.
Note 2: GIMP seems to open fine the 10-bit HEIC provided there. But not the ones it exported itself.
Reproduction
Is the bug reproducible? Always
Simple blank canvas
First case is a simpler case where export and import seem to work fine except that colors are wrong:
Reproduction steps:
- Create a new blank image
- Export it as HEIC (.heic or .heif extension) and select 10 or 12 bpc.
- Import back the newly created HEIC file.
Expected result: it should import a fully blank image in 16 bpc.
Actual result: it imports an image as same size as original, in 16 bpc, but with grayscale lines (intermittent gray vertical lines of 1 pixel width).
More complex case
Reproduction steps:
- Open a "real world" image. It doesn't seem to matter what (may be a screenshot, a photograph, I could reproduce with anything as long as it was not a boring uniform color).
- Export it as HEIC (.heic or .heif extension) and select 10 or 12 bpc.
- Import back the newly created HEIC file.
Expected result: it should import the same looking image in 16 bpc. Also even if the image was actually corrupted (i.e. if the main bug is in the export procedure, not the import one), the import should not crash. Instead it should detect a problem and gracefully exit with an error.
Actual result: file-heif
crashesn with the following backtrace.
/home/jehan/.local/share/crossroad/roads/native/gimp/lib64/gimp/2.99/plug-ins/file-heif/file-heif (pid:103542): [E]xit, show [S]tack trace or [P]roceed: s
# Stack traces obtained from PID 103542 - Thread 103552 #
[New LWP 103543]
[New LWP 103544]
[New LWP 103545]
[New LWP 103546]
[New LWP 103547]
[New LWP 103548]
[New LWP 103549]
[New LWP 103550]
[New LWP 103551]
[New LWP 103552]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f76036b0b27 in __pthread_timedjoin_ex () from /lib64/libpthread.so.0
Id Target Id Frame
* 1 Thread 0x7f76017e6e40 (LWP 103542) "file-heif" 0x00007f76036b0b27 in __pthread_timedjoin_ex () from /lib64/libpthread.so.0
2 Thread 0x7f75f4742700 (LWP 103543) "gmain" 0x00007f76038fea5f in poll () from /lib64/libc.so.6
3 Thread 0x7f75f3f41700 (LWP 103544) "gdbus" 0x00007f76038fea5f in poll () from /lib64/libc.so.6
4 Thread 0x7f75f349a700 (LWP 103545) "worker" 0x00007f76039041dd in syscall () from /lib64/libc.so.6
5 Thread 0x7f75f2c99700 (LWP 103546) "worker" 0x00007f76039041dd in syscall () from /lib64/libc.so.6
6 Thread 0x7f75f2498700 (LWP 103547) "worker" 0x00007f76039041dd in syscall () from /lib64/libc.so.6
7 Thread 0x7f75f1c97700 (LWP 103548) "worker" 0x00007f76039041dd in syscall () from /lib64/libc.so.6
8 Thread 0x7f75f1496700 (LWP 103549) "worker" 0x00007f76039041dd in syscall () from /lib64/libc.so.6
9 Thread 0x7f75f0c95700 (LWP 103550) "worker" 0x00007f76039041dd in syscall () from /lib64/libc.so.6
10 Thread 0x7f75dbfff700 (LWP 103551) "worker" 0x00007f76039041dd in syscall () from /lib64/libc.so.6
11 Thread 0x7f75db361700 (LWP 103552) "file-heif" 0x00007f76038fa43c in read () from /lib64/libc.so.6
Thread 11 (Thread 0x7f75db361700 (LWP 103552)):
#0 0x00007f76038fa43c in read () at /lib64/libc.so.6
#1 0x00007f7604a58dd5 in gimp_stack_trace_print (prog_name=prog_name@entry=0x7fff35c4c7fc "/home/jehan/.local/share/crossroad/roads/native/gimp/lib64/gimp/2.99/plug-ins/file-heif/file-heif", stream=0x7f76039cb500 <_IO_2_1_stdout_>, trace=trace@entry=0x0) at ../../../../../../../dev/src/gimp/libgimpbase/gimputils.c:1345
status = 61880524
stack_printed = 0
gtrace = 0x0
gimp_pid = "103542\000\000\001\000\000\000u\177\000"
buffer = "\377\377\377\377\000\000\000\000x\202\020\002v\177\000\000\340\"\244\004v\177\000\000\320\366\246\004v\177\000\000`\375\065\333u\177\000\000\374\307\304\065\377\177\000\000\210\065\246\004v\177\000\000Ї\034\304u\177\000\000\020\240>\333u\177\000\000\307Ʈ\004v\177\000\000\005", '\000' <repeats 15 times>, "\240\375\065\333u\177\000\000\240 \244\004v\177\000\000@\375\065\333u\177\000\000\216\067\257\004v\177\000\000S\000\000\000\000\000\000\000\202\061\001\304u\177", '\000' <repeats 11 times>, "\265\234\003v\177\000\000\374\307\304\065\377\177\000\000`\375\065\333u\177\000\000\200\005\000\304u\177\000\000\216\067\257\004v\177\000\000\000\000\000\000\000\000\000\000\361H"...
read_n = <optimized out>
sync_fd = {14, 15}
out_fd = {16, 17}
fork_pid = 103554
pid = 103542
eintr_count = 0
tid = 103552
#2 0x00007f7604a59210 in gimp_stack_trace_query (prog_name=0x7fff35c4c7fc "/home/jehan/.local/share/crossroad/roads/native/gimp/lib64/gimp/2.99/plug-ins/file-heif/file-heif") at ../../../../../../../dev/src/gimp/libgimpbase/gimputils.c:1515
buf = "s\n\000\003v\177\000\000\235\324\320\003v\177\000"
#3 0x00007f7604a8bdbf in gimp_plugin_sigfatal_handler (sig_num=11) at ../../../../../../../dev/src/gimp/libgimp/gimp.c:1093
sigset = {__val = {0 <repeats 16 times>}}
#4 0x00007f76038446b0 in <signal handler called> () at /lib64/libc.so.6
#5 0x00007f760396cb99 in __memmove_avx_unaligned_erms () at /lib64/libc.so.6
#6 0x00007f7603ab0add in heif::HeifContext::decode_and_paste_tile_image(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const (this=<optimized out>, tileID=<optimized out>, img=std::shared_ptr<heif::HeifPixelImage> (use count 2, weak count 1) = {...}, x0=0, y0=0) at /home/jehan/dev/src//libheif/libheif/heif_context.cc:1521
py = 599
tile_data = 0x7f75c41c87d0 "\006\001\377"
out_stride = 464
copy_width = 900
ys = 0
tile_stride = 912
out_data = 0x7f75db3ea010 "\006\001\377"
xs = 0
channel = <optimized out>
__for_range = std::set with 3 elements = {[0] = heif_channel_R, [1] = heif_channel_G, [2] = heif_channel_B}
tile_img = std::shared_ptr<heif::HeifPixelImage> (use count 1, weak count 1) = {get() = 0x7f75c4012ad0}
err = {error_code = heif_error_Ok, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = {error_code = heif_error_Ok, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = <same as static member of an already seen type>, static kSuccess = 0x7f7603acc7c0 <heif::Error::kSuccess> "Success"}, static kSuccess = <same as static member of an already seen type>}
w = 450
h = 600
src_width = 450
src_height = 600
__PRETTY_FUNCTION__ = "heif::Error heif::HeifContext::decode_and_paste_tile_image(heif_item_id, std::shared_ptr<heif::HeifPixelImage>, int, int) const"
chroma = <optimized out>
channels = std::set with 3 elements = {[0] = heif_channel_R, [1] = heif_channel_G, [2] = heif_channel_B}
#7 0x00007f7603ab3442 in std::__invoke_impl<heif::Error, heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int>(std::__invoke_memfun_deref, heif::Error (heif::HeifContext::*&&)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*&&, unsigned int&&, std::shared_ptr<heif::HeifPixelImage>&&, int&&, int&&) (__t=<optimized out>, __f=<optimized out>) at /usr/include/c++/9/bits/shared_ptr_base.h:756
#8 std::__invoke<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int>(heif::Error (heif::HeifContext::*&&)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*&&, unsigned int&&, std::shared_ptr<heif::HeifPixelImage>&&, int&&, int&&) (__fn=<optimized out>) at /usr/include/c++/9/bits/invoke.h:96
#9 std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul, 5ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul, 5ul>) (this=<optimized out>) at /usr/include/c++/9/thread:244
#10 std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >::operator()() (this=<optimized out>) at /usr/include/c++/9/thread:251
#11 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<heif::Error>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >, heif::Error>::operator()() const (this=0x7f75db360760) at /usr/include/c++/9/future:1339
#12 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<heif::Error>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >, heif::Error> >::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/include/c++/9/bits/std_function.h:286
#13 0x00007f7603ab100b in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const (this=<optimized out>) at /usr/include/c++/9/bits/std_function.h:683
__res = std::unique_ptr<std::__future_base::_Result_base> = {get() = 0x7f7604af55ac <__tls_get_addr+60>}
#14 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) (this=0x10da020, __f=<optimized out>, __did_set=0x7f75db360737) at /usr/include/c++/9/future:561
__res = std::unique_ptr<std::__future_base::_Result_base> = {get() = 0x7f7604af55ac <__tls_get_addr+60>}
#15 0x00007f76036b797f in __pthread_once_slow () at /lib64/libpthread.so.0
#16 0x00007f7603ab20a6 in __gthread_once (__func=<optimized out>, __once=0x10da038) at /usr/include/c++/9/x86_64-redhat-linux/bits/gthr-default.h:700
__callable = {____f = @0x7f75db360750, ____args#0 = @0x7f75db360738, ____args#1 = @0x7f75db360740, ____args#2 = @0x7f75db360748}
__e = <optimized out>
__did_set = false
this = 0x10da020
#17 std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) (__f=@0x7f75db360750: (void (std::__future_base::_State_baseV2::*)(std::__future_base::_State_baseV2 * const, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()> *, bool *)) 0x7f7603ab0ff0 <std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>, __once=...) at /usr/include/c++/9/mutex:683
__callable = {____f = @0x7f75db360750, ____args#0 = @0x7f75db360738, ____args#1 = @0x7f75db360740, ____args#2 = @0x7f75db360748}
__e = <optimized out>
__did_set = false
this = 0x10da020
#18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) (__ignore_failure=false, __res=..., this=0x10da020) at /usr/include/c++/9/future:401
__did_set = false
this = 0x10da020
#19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >, heif::Error>::_Async_state_impl(std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >&&)::{lambda()#1}::operator()() const (this=0xfe6038) at /usr/include/c++/9/future:1662
this = 0x10da020
#20 std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >, heif::Error>::_Async_state_impl(std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >&&)::{lambda()#1}>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >, heif::Error>::_Async_state_impl(std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >&&)::{lambda()#1}&&) (__f=...) at /usr/include/c++/9/bits/invoke.h:60
#21 std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >, heif::Error>::_Async_state_impl(std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >&&)::{lambda()#1}>(std::__invoke_result&&, (std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >, heif::Error>::_Async_state_impl(std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >&&)::{lambda()#1}&&)...) (__fn=...) at /usr/include/c++/9/bits/invoke.h:95
#22 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >, heif::Error>::_Async_state_impl(std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >&&)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0xfe6038) at /usr/include/c++/9/thread:244
#23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >, heif::Error>::_Async_state_impl(std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >&&)::{lambda()#1}> >::operator()() (this=0xfe6038) at /usr/include/c++/9/thread:251
#24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >, heif::Error>::_Async_state_impl(std::thread::_Invoker<std::tuple<heif::Error (heif::HeifContext::*)(unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int) const, heif::HeifContext const*, unsigned int, std::shared_ptr<heif::HeifPixelImage>, int, int> >&&)::{lambda()#1}> > >::_M_run() (this=0xfe6030) at /usr/include/c++/9/thread:195
#25 0x00007f76021c33d4 in execute_native_thread_routine () at /lib64/libstdc++.so.6
#26 0x00007f76036af4e2 in start_thread () at /lib64/libpthread.so.0
#27 0x00007f76039096c3 in clone () at /lib64/libc.so.6
Thread 10 (Thread 0x7f75dbfff700 (LWP 103551)):
#0 0x00007f76039041dd in syscall () at /lib64/libc.so.6
#1 0x00007f7603d53c03 in g_cond_wait () at /lib64/libglib-2.0.so.0
#2 0x00007f7603c02ed3 in gegl_parallel_distribute_thread_func (thread=0x7f7603cb12b0 <gegl_parallel_distribute_threads+336>) at ../../src/gegl/gegl/gegl-parallel.c:508
#3 0x00007f7603d31012 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#4 0x00007f76036af4e2 in start_thread () at /lib64/libpthread.so.0
#5 0x00007f76039096c3 in clone () at /lib64/libc.so.6
Thread 9 (Thread 0x7f75f0c95700 (LWP 103550)):
#0 0x00007f76039041dd in syscall () at /lib64/libc.so.6
#1 0x00007f7603d53c03 in g_cond_wait () at /lib64/libglib-2.0.so.0
#2 0x00007f7603c02ed3 in gegl_parallel_distribute_thread_func (thread=0x7f7603cb1278 <gegl_parallel_distribute_threads+280>) at ../../src/gegl/gegl/gegl-parallel.c:508
#3 0x00007f7603d31012 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#4 0x00007f76036af4e2 in start_thread () at /lib64/libpthread.so.0
#5 0x00007f76039096c3 in clone () at /lib64/libc.so.6
Thread 8 (Thread 0x7f75f1496700 (LWP 103549)):
#0 0x00007f76039041dd in syscall () at /lib64/libc.so.6
#1 0x00007f7603d53c03 in g_cond_wait () at /lib64/libglib-2.0.so.0
#2 0x00007f7603c02ed3 in gegl_parallel_distribute_thread_func (thread=0x7f7603cb1240 <gegl_parallel_distribute_threads+224>) at ../../src/gegl/gegl/gegl-parallel.c:508
#3 0x00007f7603d31012 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#4 0x00007f76036af4e2 in start_thread () at /lib64/libpthread.so.0
#5 0x00007f76039096c3 in clone () at /lib64/libc.so.6
Thread 7 (Thread 0x7f75f1c97700 (LWP 103548)):
#0 0x00007f76039041dd in syscall () at /lib64/libc.so.6
#1 0x00007f7603d53c03 in g_cond_wait () at /lib64/libglib-2.0.so.0
#2 0x00007f7603c02ed3 in gegl_parallel_distribute_thread_func (thread=0x7f7603cb1208 <gegl_parallel_distribute_threads+168>) at ../../src/gegl/gegl/gegl-parallel.c:508
#3 0x00007f7603d31012 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#4 0x00007f76036af4e2 in start_thread () at /lib64/libpthread.so.0
#5 0x00007f76039096c3 in clone () at /lib64/libc.so.6
Thread 6 (Thread 0x7f75f2498700 (LWP 103547)):
#0 0x00007f76039041dd in syscall () at /lib64/libc.so.6
#1 0x00007f7603d53c03 in g_cond_wait () at /lib64/libglib-2.0.so.0
#2 0x00007f7603c02ed3 in gegl_parallel_distribute_thread_func (thread=0x7f7603cb11d0 <gegl_parallel_distribute_threads+112>) at ../../src/gegl/gegl/gegl-parallel.c:508
#3 0x00007f7603d31012 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#4 0x00007f76036af4e2 in start_thread () at /lib64/libpthread.so.0
#5 0x00007f76039096c3 in clone () at /lib64/libc.so.6
Thread 5 (Thread 0x7f75f2c99700 (LWP 103546)):
#0 0x00007f76039041dd in syscall () at /lib64/libc.so.6
#1 0x00007f7603d53c03 in g_cond_wait () at /lib64/libglib-2.0.so.0
#2 0x00007f7603c02ed3 in gegl_parallel_distribute_thread_func (thread=0x7f7603cb1198 <gegl_parallel_distribute_threads+56>) at ../../src/gegl/gegl/gegl-parallel.c:508
#3 0x00007f7603d31012 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#4 0x00007f76036af4e2 in start_thread () at /lib64/libpthread.so.0
#5 0x00007f76039096c3 in clone () at /lib64/libc.so.6
Thread 4 (Thread 0x7f75f349a700 (LWP 103545)):
#0 0x00007f76039041dd in syscall () at /lib64/libc.so.6
#1 0x00007f7603d53c03 in g_cond_wait () at /lib64/libglib-2.0.so.0
#2 0x00007f7603c02ed3 in gegl_parallel_distribute_thread_func (thread=0x7f7603cb1160 <gegl_parallel_distribute_threads>) at ../../src/gegl/gegl/gegl-parallel.c:508
#3 0x00007f7603d31012 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#4 0x00007f76036af4e2 in start_thread () at /lib64/libpthread.so.0
#5 0x00007f76039096c3 in clone () at /lib64/libc.so.6
Thread 3 (Thread 0x7f75f3f41700 (LWP 103544)):
#0 0x00007f76038fea5f in poll () at /lib64/libc.so.6
#1 0x00007f7603d0786e in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#2 0x00007f7603d07bf3 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#3 0x00007f7603f5707a in gdbus_shared_thread_func () at /lib64/libgio-2.0.so.0
#4 0x00007f7603d31012 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#5 0x00007f76036af4e2 in start_thread () at /lib64/libpthread.so.0
#6 0x00007f76039096c3 in clone () at /lib64/libc.so.6
Thread 2 (Thread 0x7f75f4742700 (LWP 103543)):
#0 0x00007f76038fea5f in poll () at /lib64/libc.so.6
#1 0x00007f7603d0786e in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#2 0x00007f7603d079a3 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#3 0x00007f7603d079f1 in glib_worker_main () at /lib64/libglib-2.0.so.0
#4 0x00007f7603d31012 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#5 0x00007f76036af4e2 in start_thread () at /lib64/libpthread.so.0
#6 0x00007f76039096c3 in clone () at /lib64/libc.so.6
Thread 1 (Thread 0x7f76017e6e40 (LWP 103542)):
#0 0x00007f76036b0b27 in __pthread_timedjoin_ex () at /lib64/libpthread.so.0
#1 0x00007f76021c3637 in std::thread::join() () at /lib64/libstdc++.so.6
#2 0x00007f76036b797f in __pthread_once_slow () at /lib64/libpthread.so.0
#3 0x00007f7603ab1106 in __gthread_once (__func=<optimized out>, __once=0x10da048) at /usr/include/c++/9/x86_64-redhat-linux/bits/gthr-default.h:700
__callable = {____f = @0x7fff35c496f0, ____args#0 = @0x7fff35c496e8}
__e = <optimized out>
#4 std::call_once<void (std::thread::*)(), std::thread*>(std::once_flag&, void (std::thread::*&&)(), std::thread*&&) (__f=@0x7fff35c496f0: (void (std::thread::*)(std::thread * const)) 0x7f76021c3620 <std::thread::join()>, __once=...) at /usr/include/c++/9/mutex:683
__callable = {____f = @0x7fff35c496f0, ____args#0 = @0x7fff35c496e8}
__e = <optimized out>
#5 std::__future_base::_Async_state_commonV2::_M_join() (this=0x10da020) at /usr/include/c++/9/future:1642
#6 std::__future_base::_Async_state_commonV2::_M_complete_async() (this=0x10da020) at /usr/include/c++/9/future:1640
#7 0x00007f7603ab2c8a in std::__future_base::_State_baseV2::wait() (this=0x10da020) at /usr/include/c++/9/future:334
__res = <optimized out>
__reset = {_M_fut = @0xfb0600}
#8 std::__basic_future<heif::Error>::_M_get_result() const (this=0xfb0600) at /usr/include/c++/9/future:717
__res = <optimized out>
__reset = {_M_fut = @0xfb0600}
#9 std::future<heif::Error>::get() (this=0xfb0600) at /usr/include/c++/9/future:796
__reset = {_M_fut = @0xfb0600}
#10 0x00007f7603aadacc in heif::HeifContext::decode_full_grid_image(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, std::vector<unsigned char, std::allocator<unsigned char> > const&) const (this=0xf42ee0, ID=<optimized out>, img=std::shared_ptr<heif::HeifPixelImage> (use count 2, weak count 1) = {...}, grid_data=...) at /usr/include/c++/9/bits/stl_deque.h:1478
e = {error_code = heif_error_Ok, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = {error_code = heif_error_Ok, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = <same as static member of an already seen type>, static kSuccess = <same as static member of an already seen type>}, static kSuccess = <same as static member of an already seen type>}
grid = {m_rows = 1, m_columns = 1, m_output_width = 450, m_output_height = 600}
err = {error_code = heif_error_Ok, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = {error_code = heif_error_Ok, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = <same as static member of an already seen type>, static kSuccess = <same as static member of an already seen type>}, static kSuccess = <same as static member of an already seen type>}
image_references = std::vector of length 1, capacity 1 = {1}
ipma = std::shared_ptr<heif::Box_ipma> (use count 3, weak count 0) = {get() = 0xff11c0}
pixi_box = std::shared_ptr<heif::Box> (empty) = {get() = 0x0}
pixi = std::shared_ptr<heif::Box_pixi> (empty) = {get() = <optimized out>}
w = <optimized out>
h = <optimized out>
__PRETTY_FUNCTION__ = "heif::Error heif::HeifContext::decode_full_grid_image(heif_item_id, std::shared_ptr<heif::HeifPixelImage>&, const std::vector<unsigned char>&) const"
tile_chroma = heif_chroma_444
bpp = <optimized out>
y0 = <optimized out>
reference_idx = <optimized out>
tiles = std::deque with 0 elements
errs = std::deque with 1 element = {{<std::__basic_future<heif::Error>> = {<std::__future_base> = {<No data fields>}, _M_state = std::shared_ptr<std::__future_base::_State_baseV2> (use count 1, weak count 0) = {get() = 0x10da020}}, <No data fields>}}
#11 0x00007f7603aaeff1 in heif::HeifContext::decode_image_planar(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_decoding_options const*) const (this=0xf42ee0, ID=2, img=std::shared_ptr<heif::HeifPixelImage> (use count 2, weak count 1) = {...}, out_colorspace=heif_colorspace_RGB, options=0x0) at /home/jehan/dev/src//libheif/libheif/heif_context.cc:1101
data = std::vector of length 8, capacity 8 = {0 '\000', 0 '\000', 0 '\000', 0 '\000', 1 '\001', 194 '\302', 2 '\002', 88 'X'}
image_type = "grid"
imginfo = std::shared_ptr<heif::HeifContext::Image> (use count 5, weak count 0) = {get() = 0xebe420}
__PRETTY_FUNCTION__ = "heif::Error heif::HeifContext::decode_image_planar(heif_item_id, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, const heif_decoding_options*) const"
error = {error_code = heif_error_Ok, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = {error_code = heif_error_Ok, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = <same as static member of an already seen type>, static kSuccess = <same as static member of an already seen type>}, static kSuccess = <same as static member of an already seen type>}
#12 0x00007f7603ab04f5 in heif::HeifContext::decode_image_user(unsigned int, std::shared_ptr<heif::HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const*) const (this=<optimized out>, ID=<optimized out>, img=std::shared_ptr<heif::HeifPixelImage> (use count 2, weak count 1) = {...}, out_colorspace=out_colorspace@entry=heif_colorspace_RGB, out_chroma=heif_chroma_interleaved_RRGGBB_LE, options=0x0) at /home/jehan/dev/src//libheif/libheif/heif_context.cc:952
err = {error_code = 15808512, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = {error_code = heif_error_Ok, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = <same as static member of an already seen type>, static kSuccess = <same as static member of an already seen type>}, static kSuccess = <same as static member of an already seen type>}
target_colorspace = <optimized out>
target_chroma = <optimized out>
different_chroma = <optimized out>
different_colorspace = <optimized out>
bpp = <optimized out>
#13 0x00007f7603a9e14a in heif_decode_image(heif_image_handle const*, heif_image**, heif_colorspace, heif_chroma, heif_decoding_options const*) (in_handle=0x1032600, out_img=out_img@entry=0x7fff35c49f40, colorspace=colorspace@entry=heif_colorspace_RGB, chroma=<optimized out>, options=options@entry=0x0) at /usr/include/c++/9/bits/shared_ptr_base.h:1020
img = std::shared_ptr<heif::HeifPixelImage> (use count 2, weak count 1) = {get() = 0xe53f20}
err = {error_code = 57373168, sub_error_code = 32630, message = "", static Ok = {error_code = heif_error_Ok, sub_error_code = heif_suberror_Unspecified, message = "", static Ok = <same as static member of an already seen type>, static kSuccess = 0x7f7603acc7c0 <heif::Error::kSuccess> "Success"}, static kSuccess = <same as static member of an already seen type>}
#14 0x0000000000408651 in load_image (file=file@entry=0xe14200, interactive=interactive@entry=1, status=status@entry=0x7fff35c4a084, error=error@entry=0x7fff35c4a088) at ../../../../../../../dev/src/gimp/plug-ins/common/file-heif.c:925
input = 0x10942d0
file_size = <optimized out>
file_buffer = 0x10ef400 "б\234\003v\177"
bytes_read = 76653
ctx = 0xfd1790
err = <optimized out>
handle = 0x1032600
img = 0x0
profile = 0x0
n_images = <optimized out>
primary = 2
selected_image = 2
has_alpha = 0
width = <optimized out>
height = <optimized out>
image = <optimized out>
layer = <optimized out>
buffer = <optimized out>
format = <optimized out>
data = <optimized out>
stride = 8
bit_depth = 10
chroma = <optimized out>
precision = <optimized out>
load_linear = <optimized out>
encoding = <optimized out>
__func__ = "load_image"
#15 0x0000000000409957 in heif_load (procedure=0xe1a140, run_mode=GIMP_RUN_INTERACTIVE, file=0xe14200, args=<optimized out>, run_data=<optimized out>) at ../../../../../../../dev/src/gimp/plug-ins/common/file-heif.c:349
return_vals = <optimized out>
status = GIMP_PDB_EXECUTION_ERROR
image = <optimized out>
interactive = 1
error = 0x0
#16 0x00007f7604a9186a in gimp_load_procedure_run (procedure=0xe1a140, args=0xe13fa0) at ../../../../../../../dev/src/gimp/libgimp/gimploadprocedure.c:172
load_proc = 0xe1a140
remaining = 0xe14220
return_values = <optimized out>
run_mode = GIMP_RUN_INTERACTIVE
file = 0xe14200
i = 2
#17 0x00007f7604a99205 in gimp_procedure_run (procedure=procedure@entry=0xe1a140, args=args@entry=0xe13fa0) at ../../../../../../../dev/src/gimp/libgimp/gimpprocedure.c:1819
return_vals = <optimized out>
error = 0x0
i = <optimized out>
__func__ = "gimp_procedure_run"
#18 0x00007f7604a944a8 in gimp_plug_in_proc_run_internal (plug_in=0xdebf20, proc_run=0xe13f60, procedure=0xe1a140, proc_return=0x7fff35c4a1f0) at ../../../../../../../dev/src/gimp/libgimp/gimpplugin.c:1216
arguments = 0xe13fa0
return_values = 0x0
#19 0x00007f7604a95d3e in gimp_plug_in_proc_run (proc_run=0xe13f60, plug_in=0xdebf20) at ../../../../../../../dev/src/gimp/libgimp/gimpplugin.c:1163
proc_return = {name = 0x0, n_params = 14591584, params = 0x0}
procedure = 0xe1a140
msg = {type = 5, data = 0xe13f60}
__func__ = "_gimp_plug_in_run"
#20 gimp_plug_in_loop (plug_in=0xdebf20) at ../../../../../../../dev/src/gimp/libgimp/gimpplugin.c:1071
msg = {type = 5, data = 0xe13f60}
__func__ = "_gimp_plug_in_run"
#21 _gimp_plug_in_run (plug_in=0xdebf20) at ../../../../../../../dev/src/gimp/libgimp/gimpplugin.c:820
__func__ = "_gimp_plug_in_run"
#22 0x00007f7604a8c539 in gimp_main (plug_in_type=<optimized out>, argc=<optimized out>, argv=0x7fff35c4a4b8) at ../../../../../../../dev/src/gimp/libgimp/gimp.c:593
read_channel = 0xdd8980
write_channel = 0xdb3380
basename = <optimized out>
protocol_version = <optimized out>
__func__ = "gimp_main"
#23 0x00007f760382f1a3 in __libc_start_main () at /lib64/libc.so.6
#24 0x0000000000405f5e in _start () at ../../../../../../../dev/src/gimp/plug-ins/common/file-heif.c:112
[Inferior 1 (process 103542) detached]
Additional information
Also in some cases, the following error was displayed on stderr: munmap_chunk(): invalid pointer
I'm not sure how useful this is.