[MacPorts] #45309: gimp2 @2.8.14 on 10.9 - doesn't load plug-ins
#45309: gimp2 @2.8.14 on 10.9 - doesn't load plug-ins --------------------------+--------------------------------- Reporter: and.damore@… | Owner: devans@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Keywords: | Port: gimp2 gimp gimp-app --------------------------+--------------------------------- GIMP doesn't load its plug-ins at boot, it prints out a dbus-related error on standard error {{{ Error spawning command line `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET': Child process killed by signal 11 }}} and then {{{ LibGimpBase-WARNING **: gimp: gimp_wire_read(): error }}} The same symptoms [https://lists.macosforge.org/pipermail/macports- users/2014-October/036585.html have been confirmed by the port maintainer]. Running gimp with ''--verbose'' provides a pair of {{{ Querying plug-in: '/opt/local/lib/gimp/2.0/plug-ins/blinds' Terminating plug-in: '/opt/local/lib/gimp/2.0/plug-ins/blinds' }}} output lines per each plug-in, this results in a GIMP instance with no plug-in that is of very little help, among other features it won't read/write any format other than its own XCF. On my 10.9.5 system with dbus-system daemon and dbus-session agent from MacPorts running I have a ''DBUS_LAUNCHD_SESSION_BUS_SOCKET'' env variable in shell but not in launchd environment, this is probably why GIMP is complaining about the getenv at start. I'm attaching full standard output and error. -- Ticket URL: <https://trac.macports.org/ticket/45309> MacPorts <http://www.macports.org/> Ports system for OS X
#45309: gimp2 @2.8.14 on 10.9 - doesn't load plug-ins ---------------------------+---------------------- Reporter: and.damore@… | Owner: devans@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: gimp2 | ---------------------------+---------------------- Changes (by devans@…): * status: new => assigned * version: 2.3.1 => * port: gimp2 gimp gimp-app => gimp2 Comment: Thanks for opening this ticket and confirming the problem. It appears there are two separate issues involved here, first the dbus problem and secondly the gimp plugin one. The dbus issue seems to be with the GDBus API provided by the GIO component of glib2. The stock code expects the environment variable DBUS_SESSION_BUS_ADDRESS to be set a session debus address of the form 'unix:path=<path to dbus session socket>'. We have added custom code that attempts to obtain the socket path using the the launchctl command mentioned in the error message if DBUS_SESSION_BUS_ADDRESS is not set. On my 10.9.5 system, manually running the command yields the socket address as follows. {{{ $ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET /tmp/launch-vW5khj/unix_domain_listener }}} I can override the GIMP dbus error by setting DBUS_SESSION_BUS_ADDRESS with this value {{{ export DBUS_SESSION_BUS_ADDRESS="unix:path=/tmp/launch- vW5khj/unix_domain_listener" }}} You can get more debugging output from glib2 by setting the additional env variable {{{ export G_DBUS_DEBUG=address }}} This produces the additional output {{{ GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus type 'session' GDBus-debug:Address: env var DBUS_SESSION_BUS_ADDRESS is not set GDBus-debug:Address: env var DBUS_SYSTEM_BUS_ADDRESS is not set GDBus-debug:Address: env var DBUS_STARTER_BUS_TYPE is not set GDBus-debug:Address: launchctl command line: `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET' GDBus-debug:Address: Cannot look-up address bus type 'session': Error spawning command line `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET': Child process killed by signal 11 }}} This give me an idea of where to look in glib2 to see what's going on. No idea what's going on with the plugin load failures as yet. Will look at it today. -- Ticket URL: <https://trac.macports.org/ticket/45309#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#45309: gimp2 @2.8.14 on 10.9 - doesn't load plug-ins ---------------------------+---------------------- Reporter: and.damore@… | Owner: devans@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: gimp2 | ---------------------------+---------------------- Comment (by eborisch@…): Same symptoms on 10.6.8, FWIW. -- Ticket URL: <https://trac.macports.org/ticket/45309#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#45309: gimp2 @2.8.14 on 10.9 - doesn't load plug-ins ---------------------------+---------------------- Reporter: and.damore@… | Owner: devans@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: gimp2 | ---------------------------+---------------------- Comment (by devans@…): Replying to [comment:4 eborisch@…]:
Same symptoms on 10.6.8, FWIW.
I've reproduced the same symptoms with fresh builds on SL, Mavericks and even Yosemite Beta 5 so it looks like OS version is not an issue. -- Ticket URL: <https://trac.macports.org/ticket/45309#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#45309: gimp2 @2.8.14 on 10.9 - doesn't load plug-ins ---------------------------+---------------------- Reporter: and.damore@… | Owner: devans@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: gimp2 | ---------------------------+---------------------- Comment (by devans@…): Status: So far I've been able to confirm that the dbus issue and the failing plugins have a common element: they both involve spawning a child process that terminates prematurely. In the dbus case, g_dbus_address_get_for_bus_sync() attempts to execute the launchctl command in a spawned child process which reports killed by signal 11. However, this only happens when running gimp. For example, running eog (or most other GNOME apps) the child process is spawned successfully and the correct result returned. {{{ $ eog GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus type 'session' GDBus-debug:Address: env var DBUS_SESSION_BUS_ADDRESS is not set GDBus-debug:Address: env var DBUS_SYSTEM_BUS_ADDRESS is not set GDBus-debug:Address: env var DBUS_STARTER_BUS_TYPE is not set GDBus-debug:Address: launchctl command line: `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET' GDBus-debug:Address: launchctl stdout: 0000: 2f 74 6d 70 2f 6c 61 75 6e 63 68 2d 37 4d 46 69 /tmp/launch- 7MFi 0010: 64 37 2f 75 6e 69 78 5f 64 6f 6d 61 69 6e 5f 6c d7/unix_domain_l 0020: 69 73 74 65 6e 65 72 0a 00 istener.. GDBus-debug:Address: Returning address 'unix:path=/tmp/launch- 7MFid7/unix_domain_listener' for bus type 'session' }}} In the case of the GIMP plugins, the failure point occurs when GIMP is querying the individual plugins for their characteristics. The plugin is executed as a child process which communicates bidirectionally with the main program using a pair of pipes. After sending a query command to each plugin, the main process attempts to read an expected response but immediately gets an EOF instead and the plugin is skipped. A crash report for the child is produced as follows: {{{ Process: gimp-2.8 [62774] Path: /opt/local/bin/gimp-2.8 Identifier: gimp-2.8 Version: ??? Code Type: X86-64 (Native) Parent Process: gimp-2.8 [62731] Responsible: Terminal [361] User ID: 501 Date/Time: 2014-10-09 12:14:46.255 -0700 OS Version: Mac OS X 10.9.5 (13F34) Report Version: 11 Anonymous UUID: 25BD4C19-81DA-575C-A9EB-3C11B6BF2F84 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000001118b69b5 VM Regions Near 0x1118b69b5: __LINKEDIT 0000000110f36000-0000000110f47000 [ 68K] r--/rwx SM=COW /opt/local/lib/*.dylib --> MALLOC_TINY 00007ff479400000-00007ff479800000 [ 4096K] rw-/rwx SM=COW Application Specific Information: *** multi-threaded process forked *** crashed on child side of fork pre-exec Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 ??? 0x00000001118b69b5 0 + 4589316533 1 libsystem_pthread.dylib 0x00007fff85d06f5b _pthread_fork_child_postinit + 69 2 libsystem_c.dylib 0x00007fff85c0317e fork + 29 3 libglib-2.0.0.dylib 0x000000010f692067 fork_exec_with_pipes + 695 (gspawn.c:1337) 4 libglib-2.0.0.dylib 0x000000010f691293 g_spawn_async_with_pipes + 851 (gspawn.c:661) 5 libglib-2.0.0.dylib 0x000000010f690f26 g_spawn_async + 198 (gspawn.c:146) 6 gimp 0x000000010e078486 gimp_plug_in_open + 1894 (gimpplugin.c:363) 7 gimp 0x000000010e0826a1 gimp_plug_in_manager_call_query + 641 (gimppluginmanager-call.c:75) 8 gimp 0x000000010e087e9e gimp_plug_in_manager_query_new + 382 (gimppluginmanager-restore.c:355) 9 gimp 0x000000010e087688 gimp_plug_in_manager_restore + 536 (gimppluginmanager-restore.c:112) 10 gimp 0x000000010e0b4a71 gimp_real_restore + 97 (gimp.c:715) 11 libgobject-2.0.0.dylib 0x000000010f559674 g_cclosure_marshal_VOID__POINTER + 244 (gmarshal.c:1201) 12 libgobject-2.0.0.dylib 0x000000010f553398 g_type_class_meta_marshal + 120 (gclosure.c:966) 13 libgobject-2.0.0.dylib 0x000000010f55288a g_closure_invoke + 522 (gclosure.c:773) 14 libgobject-2.0.0.dylib 0x000000010f57583b signal_emit_unlocked_R + 2155 (gsignal.c:3591) 15 libgobject-2.0.0.dylib 0x000000010f5774ee g_signal_emit_valist + 6046 (gsignal.c:3309) 16 libgobject-2.0.0.dylib 0x000000010f577e94 g_signal_emit + 356 (gsignal.c:3365) 17 gimp 0x000000010e0b1849 gimp_restore + 1449 (gimp.c:1013) 18 gimp 0x000000010dd56704 app_run + 708 (app.c:221) 19 gimp 0x000000010dd5a017 main + 1255 (main.c:474) 20 libdyld.dylib 0x00007fff85d005fd start + 1 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000004 rbx: 0x0000000000000028 rcx: 0x00000001118b69b5 rdx: 0x0000000000000000 rdi: 0x0000000000000103 rsi: 0x0000000000000403 rbp: 0x00007fff51eb5440 rsp: 0x00007fff51eb5418 r8: 0x0000000000000003 r9: 0x0000000000000000 r10: 0x00000000000002bc r11: 0x0000000000000246 r12: 0x000000010e0786b0 r13: 0x0000000000000000 r14: 0x000000010e6d01e0 r15: 0x0000000000000001 rip: 0x00000001118b69b5 rfl: 0x0000000000010202 cr2: 0x00000001118b69b5 Logical CPU: 3 Error Code: 0x00000014 Trap Number: 14 }}} Again spawning the child process has failed (SIGSEGV). No idea what's causing the problem and why it is specific to GIMP at this point. If any one else has an idea about what's going on here or better how to fix it please let me know. I'm heading out for the weekend but should get back to this on Sunday. -- Ticket URL: <https://trac.macports.org/ticket/45309#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#45309: gimp2 @2.8.14 on 10.9 - doesn't load plug-ins ---------------------------+---------------------- Reporter: and.damore@… | Owner: devans@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: gimp2 | ---------------------------+---------------------- Comment (by cal@…): On OS X, you cannot call non-async-safe functions in a process `fork(2)`ed from a child process before calling `execve(2)`. This looks like some post-fork-phtread callback code that calls stuff it shouldn't call. A valid solution for this kind of problem is to replace the `fork(2)` and `execve(2)` combination with `posix_spawn(2)`. Please make sure upstream is aware of this problem. For further reference, for example: http://lists.gnu.org/archive/html/coreutils/2013-11/msg00083.html. Googling for "*** multi-threaded process forked ***" also gets you lots of similar hits. -- Ticket URL: <https://trac.macports.org/ticket/45309#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#45309: gimp2 @2.8.14 on 10.9 - doesn't load plug-ins ---------------------------+---------------------- Reporter: and.damore@… | Owner: devans@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: gimp2 | ---------------------------+---------------------- Comment (by macports@…): I ran into this same problem on Mavericks. After spending a while trying reactivating older ports (eg, older gtk2, older glib2 2.40) -- which didn't seem to solve the problem, and involved lots of rebuilding things depending on them, I started looking at the glib2 source. In particular the verbose error output says: {{{ Error spawning command line `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET': Child process killed by signal 11 Dynamic session lookup supported but failed: launchctl terminated abnormally without any error message Not enough memory }}} which implies that maybe it's a memory allocation being failed. So I started following the glib2 call chain for running a process, from the launchctl example above (seemed easier than trying to find where the plugins get loaded, since I imagine they're going through a common glib2 function. The call path seems to be: 0. g_spawn_command_line_sync() 0. g_spawn_sync() 0. fork_exec_with_pipes() 0. do_exec() 0. Optionally: (* child_setup)(user_data) 0. g_execute() and AFAICT in g_execute() (in glib/gspawn.c) it looks like there is a memory allocation performed if the thing being run does not have a full path (around line 1721, glib 2.42): {{{ freeme = name = g_malloc (pathlen + len + 1); }}} which is consistent with the command line printed out (running bare launchctl). Memory allocations are one of those things which are typically on the "do not do between fork() and exec()." Although sometimes the rules for single threaded and multi-threaded applications are different about some of these things. (Hard to be sure if that will allocate memory or not, since it goes through all the glib2 memory wrappers too.) So just as another option to consider for, eg, pthread atfork related things. Possibly if someone figures out when it last worked (which is why I was trying downgrading glib2/gtk2/etc) then it'll be more obvious why it has stopped working. Ewen -- Ticket URL: <https://trac.macports.org/ticket/45309#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#45309: gimp2 @2.8.14 on 10.9 - doesn't load plug-ins ---------------------------+---------------------- Reporter: and.damore@… | Owner: devans@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: gimp2 | ---------------------------+---------------------- Comment (by hohro.st@…): I've also encountered this problem.[[BR]][[BR]]
Possibly if someone figures out when it last worked (which is why I was trying downgrading glib2/gtk2/etc) then it'll be more obvious why it has stopped working. There was no such problem at least 13 days ago (on Oct. 5). I think it occurred around the day when this ticket was opened.
-- Ticket URL: <https://trac.macports.org/ticket/45309#comment:12> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts