Bug 204919

Summary: graphics/gimp LibGimp-ERROR **: shmat() failed: Invalid argument
Product: Ports & Packages Reporter: Ludger Bolmerg <lbolmerg>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Some People CC: burke, everytrash, gnome, kwm, rff1917, robroygregg, tobias, tobik
Priority: --- Keywords: crash, needs-qa
Version: Latest   
Hardware: amd64   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206097
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=53607

Description Ludger Bolmerg 2015-11-30 17:03:26 UTC
after upgrading graphics/gimp to gimp-2.8.16,2 I get an error message when starting gimp and a core file script-fu.core is being written

system is 10.2-STABLE FreeBSD 10.2-STABLE #0 r291236 amd64
everything installed from packages

% gimp                                                         ~

(script-fu:3985): LibGimp-ERROR **: shmat() failed: Invalid argument
Could not attach to gimp shared memory segment

(gimp:3972): LibGimpBase-WARNING **: gimp: gimp_wire_read(): error
GIMP-Error: Plug-in crashed: "script-fu"
(/usr/local/libexec/gimp/2.2/plug-ins/script-fu)

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.
Comment 2 Ludger Bolmerg 2016-01-11 13:10:39 UTC
Compiling Gimp from ports works for me
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-12 03:24:55 UTC
@Ludger

Can you try the following workaround, using the binary gimp package and confirm whether it prevents the plugin crash please:

gimp --no-shm
Comment 4 Ludger Bolmerg 2016-01-12 08:10:52 UTC
(In reply to Kubilay Kocak from comment #3)

@Kubilay

I can confirm that option --no-shm prevents the the plugin from crashing
Comment 5 everytrash 2016-01-15 12:05:08 UTC
try: 

kern.ipc.shm_allow_removed=1
Comment 6 Ludger Bolmerg 2016-01-15 13:42:19 UTC
(In reply to everytrash from comment #5)

setting kern.ipc.shm_allow_removed=1 works OK
Comment 7 Robert Roy Gregg 2016-05-08 20:55:19 UTC
"sysctl kern.ipc.shm_allow_removed=1" fixed this same symptom for me on two all-package 10.2-RELEASE-p16 amd64 hosts, both with gimp-2.8.16,2.  One host was a Fusion VM, and the other a ThinkPad X230.  Thank you!
Comment 8 Mattias Wikstrom 2016-10-06 15:58:07 UTC
I just had the same problem with gimp-app-2.8.18_1,1 on 10.3-RELEASE, when installing from pkg. kern.ipc.shm_allow_removed=1 solved it for me as well.
Comment 9 commit-hook freebsd_committer freebsd_triage 2017-05-23 19:38:07 UTC
A commit references this bug:

Author: kwm
Date: Tue May 23 19:36:57 UTC 2017
New revision: 441550
URL: https://svnweb.freebsd.org/changeset/ports/441550

Log:
  Update gimp to 2.8.22. (1)

  * Move libsoup to the helpbrowser dependancy (2)
  * Gimp plugins need kern.ipc.shm_allow_removed=1, which is default for
    11.0-R and newer. Add pkg-message for 10.x (3)
  * Move desktop-file-utils so it only applies to the gimp-app port.

  PR:		219156 (based on)(1), 214751 (2), 204919 (3), 206097 (3)
  Submitted by:	mi@ (1), Christian Heckendorf <heckendorfc@gmail.com> (2)

Changes:
  head/graphics/gimp/Makefile
  head/graphics/gimp-app/Makefile
  head/graphics/gimp-app/distinfo
  head/graphics/gimp-app/pkg-message
  head/graphics/gimp-app/pkg-plist
Comment 10 Koop Mast freebsd_committer freebsd_triage 2017-05-23 19:40:20 UTC
I added a pkg-message for 10.3, from 11.0-R kern.ipc.shm_allow_removed=1 is default on. Thanks for the people doing the research!