Bug#906658: gimp-gmic: Segmentation fault when attempting to apply filter

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#906658: gimp-gmic: Segmentation fault when attempting to apply filter

Matthew Lemon
Package: gimp-gmic
Version: 1.7.9+zart-4.1+b1
Severity: normal

Dear Maintainer,

When trying to apply a gmic filter to a JPG, a message box appears with

"GIMP Message - Plug-in crashed: "gmic_gimp" (/usr/lib/gimp/2.0/plug-ins/gmic_gimp)
The dying plug-in may have messed up GIMP's internal state. You may want to
save your images and restart GIMP to be on the safe side.
"

Launching gimp with --verbose, I can see that the message is:

/usr/lib/gimp/2.0/plug-ins/gmic_gimp: fatal error: Segmentation fault

Upon opening the JPG file, I am electing to Keep the embedded colour profile
(sRGB), however the same crash occurs when electing to Convert to the built-in
RGB profile.

When first attempting use of a filter, clicking on the sublist having popped
out the first level of filters, e.g. Film emulation -> B&W Films. Clicking on
B&W Films causes the crash. Subsequent attempts to do the same thing result in
a crash at the earlier stage, simply trying to launch G'MIC from the Filters
menu.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.17.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gimp-gmic depends on:
ii  gimp                 2.10.2-1
ii  libatk1.0-0          2.28.1-1
ii  libbabl-0.1-0        0.1.54-1
ii  libc6                2.27-5
ii  libcairo2            1.15.10-3
ii  libcurl4             7.61.0-1
ii  libfftw3-double3     3.3.8-1
ii  libfontconfig1       2.13.0-5
ii  libfreetype6         2.8.1-2
ii  libfribidi0          1.0.5-1
ii  libgcc1              1:8.2.0-4
ii  libgdk-pixbuf2.0-0   2.36.12-1
ii  libgegl-0.4-0        0.4.6-1
ii  libgimp2.0           2.10.2-1
ii  libglib2.0-0         2.56.1-2
ii  libgomp1             8.2.0-4
ii  libgtk2.0-0          2.24.32-2
ii  libjson-glib-1.0-0   1.4.2-4
ii  libpango-1.0-0       1.42.1-2
ii  libpangocairo-1.0-0  1.42.1-2
ii  libpangoft2-1.0-0    1.42.1-2
ii  libpng16-16          1.6.34-2
ii  libstdc++6           8.2.0-4
ii  libx11-6             2:1.6.5-1
ii  zlib1g               1:1.2.11.dfsg-1

gimp-gmic recommends no packages.

Versions of packages gimp-gmic suggests:
pn  gmic  <none>

-- no debconf information

Matthew Lemon
Email: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#906658: gimp-gmic: Segmentation fault when attempting to apply filter

Bernhard Übelacker-3
Hello,
just tried to reproduce this issue.




This is the stack were the process crashes:


Thread 1 "gmic_gimp" received signal SIGSEGV, Segmentation fault.
__strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120
120     ../sysdeps/x86_64/multiarch/../strlen.S: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120
#1  0x00007f8ef92449b6 in printf_positional (s=s@entry=0x7ffdde9629c0, format=format@entry=0x55592598b438 "mode(%s),opacity(%g),pos(%d,%d),name(%s)", readonly_format=readonly_format@entry=0, ap=ap@entry=0x7ffdde962b30, ap_savep=ap_savep@entry=0x7ffdde962568, done=done@entry=5, nspecs_done=0, lead_str_end=<optimized out>, work_buffer=<optimized out>, save_errno=<optimized out>, grouping=<optimized out>, thousands_sep=<optimized out>) at vfprintf.c:2023
#2  0x00007f8ef9246db2 in _IO_vfprintf_internal (s=s@entry=0x7ffdde9629c0, format=format@entry=0x55592598b438 "mode(%s),opacity(%g),pos(%d,%d),name(%s)", ap=ap@entry=0x7ffdde962b30) at vfprintf.c:1688
#3  0x00007f8ef926ea60 in _IO_vsnprintf (string=0x5559266914f0 "mode(U", maxlen=<optimized out>, format=0x55592598b438 "mode(%s),opacity(%g),pos(%d,%d),name(%s)", args=args@entry=0x7ffdde962b30) at vsnprintf.c:114
#4  0x00007f8ef924e02f in __GI___snprintf (s=<optimized out>, maxlen=<optimized out>, format=<optimized out>) at snprintf.c:33
#5  0x00005559254a5077 in process_preview () at gmic_gimp.cpp:3259
#6  0x00007f8efaba1f6d in g_closure_invoke (closure=0x555926a0cac0, return_value=0x0, n_param_values=1, param_values=0x7ffdde963330, invocation_hint=0x7ffdde9632b0) at ../../../../gobject/gclosure.c:804
#7  0x00007f8efabb4d3e in signal_emit_unlocked_R (node=node@entry=0x555926912a40, detail=detail@entry=0, instance=instance@entry=0x555926783e80, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffdde963330) at ../../../../gobject/gsignal.c:3635
#8  0x00007f8efabbd3f5 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffdde9634f0) at ../../../../gobject/gsignal.c:3391
#9  0x00007f8efabbde0f in g_signal_emit (instance=instance@entry=0x555926783e80, signal_id=<optimized out>, detail=detail@entry=0) at ../../../../gobject/gsignal.c:3447
#10 0x00007f8efd31db8f in gimp_preview_invalidate_now (preview=0x555926783e80, preview@entry=<error reading variable: value has been optimized out>) at gimppreview.c:503
#11 0x00007f8efa8c8b73 in g_timeout_dispatch (source=source@entry=0x5559268628b0, callback=<optimized out>, user_data=<optimized out>) at ../../../../glib/gmain.c:4650
#12 0x00007f8efa8c80f5 in g_main_dispatch (context=0x55592653e460) at ../../../../glib/gmain.c:3177
#13 g_main_context_dispatch (context=context@entry=0x55592653e460) at ../../../../glib/gmain.c:3830
#14 0x00007f8efa8c84c0 in g_main_context_iterate (context=0x55592653e460, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../../glib/gmain.c:3903
#15 0x00007f8efa8c87d2 in g_main_loop_run (loop=0x5559266f9ce0) at ../../../../glib/gmain.c:4099
#16 0x00007f8efb7a3987 in IA__gtk_main () at ./gtk/gtkmain.c:1270
#17 0x00005559254a9171 in gmic_main () at gmic_gimp.cpp:4336
#18 0x00005559254af6d7 in gmic_run (name=<optimized out>, nparams=<optimized out>, param=<optimized out>, nreturn_vals=<optimized out>, return_vals=<optimized out>) at gmic_gimp.cpp:4425
#19 0x00007f8efce93418 in gimp_proc_run (proc_run=0x55592652e740) at gimp.c:2401
#20 gimp_loop () at gimp.c:2227
#21 gimp_main (info=<optimized out>, argc=<optimized out>, argv=<optimized out>) at gimp.c:671
#22 0x00007f8ef9219b17 in __libc_start_main (main=0x5559254920a0 <main(int, char**)>, argc=6, argv=0x7ffdde963b38, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffdde963b28) at ../csu/libc-start.c:310
#23 0x000055592549238a in _start ()



(gdb) list
...
3192    void process_preview() {
...
3249            const GimpLayerModeEffects blendmode = gimp_layer_get_mode(*layers);
...
3259            cimg_snprintf(layer_name,layer_name.width(),"mode(%s),opacity(%g),pos(%d,%d),name(%s)",
3260                          s_blendmode[blendmode],opacity,ox,oy,
3261                          _layer_name.data());



(gdb) list gimp_layer_get_mode

1106    GimpLayerMode
1107    gimp_layer_get_mode (gint32 layer_ID)
1108    {
1109      GimpParam *return_vals;
1110      gint nreturn_vals;
1111      GimpLayerMode mode = 0;
1112
1113      return_vals = gimp_run_procedure ("gimp-layer-get-mode",
1114                                        &nreturn_vals,
1115                                        GIMP_PDB_LAYER, layer_ID,
1116                                        GIMP_PDB_END);
1117
1118      if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
1119        mode = return_vals[1].data.d_int32;
1120
1121      gimp_destroy_params (return_vals, nreturn_vals);
1122
1123      return mode;
1124    }



Variable s_blendmode contains 0x17 strings like "alpha", "dissolve", "behind"...
Variable blendmode is retrieved by gimp_layer_get_mode and looks like it has a
value of GIMP_LAYER_MODE_NORMAL == 0x1c.
Therefore memory after s_blendmode is accessed.

It looks like gimp-gmic and libgimp2.0 disagree on the layer mode constants.
Possibly gimp-gmic expects GIMP_LAYER_MODE_NORMAL_LEGACY.
libgimp2.0 returns GIMP_LAYER_MODE_NORMAL.


Kind regards,
Bernhard

debugging.txt (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#906658: gimp-gmic: Segmentation fault when attempting to apply filter

Andrew Harvey
In reply to this post by Matthew Lemon
I have the same issue when trying to use any of the repair plugins:

/usr/lib/gimp/2.0/plug-ins/gmic_gimp: fatal error: Segmentation fault

Reply | Threaded
Open this post in threaded view
|

Bug#906658: gimp-gmic: Segmentation fault when attempting to apply filter

Osmo Antero
In reply to this post by Matthew Lemon
Same here.

Plug-in crashed: "gmic_gimp"
(/usr/lib/gimp/2.0/plug-ins/gmic_gimp)

The dying plug-in may have messed up GIMP's internal state. You may want to save your images and restart GIMP to be on the safe side.

$ gimp
gimp_device_info_set_device: trying to set GdkDevice 'Microsoft Microsoft® Nano Transceiver v2.0 Consumer Control' on GimpDeviceInfo which already has a device
/usr/lib/gimp/2.0/plug-ins/gmic_gimp: fatal error: Segmentation fault
/usr/lib/gimp/2.0/plug-ins/gmic_gimp: fatal error: Segmentation fault
/usr/lib/gimp/2.0/plug-ins/gmic_gimp: fatal error: Segmentation fault
----
I am running Ubuntu 18.10 64bit. 
Gimp is 2.10.6 directly from "sudo apt install gimp gimp-gmic".

$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 18.10
Release: 18.10
Codename: cosmic

$ gimp --version
GNU Image Manipulation Program version 2.10.6

--
Sent from my PC, laptop or phone with Ubuntu-Linux.
Reply | Threaded
Open this post in threaded view
|

Bug#906658: gimp-gmic: Segmentation fault when attempting to apply filter

Bernd Zeimetz
In reply to this post by Matthew Lemon
Hi,

> "GIMP Message - Plug-in crashed: "gmic_gimp"
> (/usr/lib/gimp/2.0/plug-ins/gmic_gimp) The dying plug-in may have messed
> up GIMP's internal state. You may want to
> save your images and restart GIMP to be on the safe side.
wild guess, you are using the recent gimp version with gmic that was not
built for it, maybe even using libgimp from the old version.

Please update to the current version from unstable and see if it works
again.


Bernd


--
 Bernd Zeimetz                            Debian GNU/Linux Developer
 http://bzed.de                                http://www.debian.org
 GPG Fingerprint: ECA1 E3F2 8E11 2432 D485  DD95 EB36 171A 6FF9 435F