GNOME Bugzilla – Bug 793428
Errors when loading an XCF with a saved selection mask
Last modified: 2018-02-13 18:31:52 UTC
So we've got a regression since the following commit: commit d0ae244fe85a502446fe9c7b82afdf1b89498966 Author: Ell <ell_se@yahoo.com> Date: Sat Feb 10 05:26:26 2018 -0500 app: invalidate channel boundary upon buffer "changed" signal Have GimpChannel connect to the drawable buffer's "changed" signal, so that we can invalidate the channel's boundary whenever the buffer contents change. Currently, the calls to gimp_drawable_invalidate_boundary() dispersed throughout the code are not enough. Moreover, invalidate both the boundary and the bounds in gimp_channel_invalidate_boundary(), since both are necessary when the buffer changes. We have a XCF which outputs many CRITICALs about a drawable not being a drawable upon loading. Then later trying to work on anything selection-related outputs more CRITICALs. And in some point we even got a crash. Backtrace on loading: GNU Image Manipulation Program version 2.9.9 git-describe: GIMP_2_9_8-248-g80bb12492a C compiler: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 7.3.1 20180130 (Red Hat 7.3.1-2) (GCC) using GEGL version 0.3.29 (compiled against version 0.3.29) using GLib version 2.54.3 (compiled against version 2.54.3) using GdkPixbuf version 2.36.11 (compiled against version 2.36.11) using GTK+ version 2.24.32 (compiled against version 2.24.32) using Pango version 1.40.13 (compiled against version 1.40.13) using Fontconfig version 2.12.6 (compiled against version 2.12.6) using Cairo version 1.15.10 (compiled against version 1.15.10) > GIMP-Error: gimp_drawable_invalidate_boundary: assertion 'GIMP_IS_DRAWABLE (drawable)' failed Stack trace: [New LWP 10553] [New LWP 10554] [New LWP 10795] [New LWP 17805] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". 0x00007f82a0dc33a7 in waitpid () from /lib64/libpthread.so.0
+ Trace 238391
> GIMP-Error: gimp_drawable_invalidate_boundary: assertion 'GIMP_IS_DRAWABLE (drawable)' failed > GIMP-Error: gimp_drawable_invalidate_boundary: assertion 'GIMP_IS_DRAWABLE (drawable)' failed > GIMP-Error: gimp_drawable_invalidate_boundary: assertion 'GIMP_IS_DRAWABLE (drawable)' failed > GIMP-Error: gimp_drawable_invalidate_boundary: assertion 'GIMP_IS_DRAWABLE (drawable)' failed > GIMP-Error: gimp_drawable_invalidate_boundary: assertion 'GIMP_IS_DRAWABLE (drawable)' failed > GIMP-Error: gimp_drawable_invalidate_boundary: assertion 'GIMP_IS_DRAWABLE (drawable)' failed > GIMP-Error: gimp_drawable_invalidate_boundary: assertion 'GIMP_IS_DRAWABLE (drawable)' failed
Example of a stacktrace happening on a random selection action: GNU Image Manipulation Program version 2.9.9 git-describe: GIMP_2_9_8-248-g80bb12492a C compiler: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 7.3.1 20180130 (Red Hat 7.3.1-2) (GCC) using GEGL version 0.3.29 (compiled against version 0.3.29) using GLib version 2.54.3 (compiled against version 2.54.3) using GdkPixbuf version 2.36.11 (compiled against version 2.36.11) using GTK+ version 2.24.32 (compiled against version 2.24.32) using Pango version 1.40.13 (compiled against version 1.40.13) using Fontconfig version 2.12.6 (compiled against version 2.12.6) using Cairo version 1.15.10 (compiled against version 1.15.10) > GIMP-Error: gimp_drawable_invalidate_boundary: assertion 'GIMP_IS_DRAWABLE (drawable)' failed Stack trace: [New LWP 10553] [New LWP 10554] [New LWP 10795] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". 0x00007f82a0dc33a7 in waitpid () from /lib64/libpthread.so.0
+ Trace 238392
Then stacktrace on a segfault on another selection action: GNU Image Manipulation Program version 2.9.9 git-describe: GIMP_2_9_8-248-g80bb12492a C compiler: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 7.3.1 20180130 (Red Hat 7.3.1-2) (GCC) using GEGL version 0.3.29 (compiled against version 0.3.29) using GLib version 2.54.3 (compiled against version 2.54.3) using GdkPixbuf version 2.36.11 (compiled against version 2.36.11) using GTK+ version 2.24.32 (compiled against version 2.24.32) using Pango version 1.40.13 (compiled against version 1.40.13) using Fontconfig version 2.12.6 (compiled against version 2.12.6) using Cairo version 1.15.10 (compiled against version 1.15.10) > fatal error: Segmentation fault Stack trace: [New LWP 10553] [New LWP 10554] [New LWP 10795] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". 0x00007f82a0dc33a7 in waitpid () from /lib64/libpthread.so.0
+ Trace 238393
Obviously a 2.10 blocker.
Argh, good catch! Fixed in master: commit 38d4aa81214d41225e43b08b3fd5b06176e9f798 Author: Ell <ell_se@yahoo.com> Date: Tue Feb 13 13:16:30 2018 -0500 Bug 793428 - Errors when loading an XCF with a saved selection mask Since commit d0ae244fe85a502446fe9c7b82afdf1b89498966, which connects GimpChannel instances to their buffer's "changed" signal, the XCF loading code that steals a channel's buffer when converting it to a selection mask (which happens when loading an XCF with a saved selection mask) is unsafe, since fails to perform the necessary cleanup and setup of the buffer in the old and new channel objects, respectively. Perform the buffer transfer using the new gimp_drawable_steal_buffer(), which does the same thing in a safe manner. app/xcf/xcf-load.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)