1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Gimp won't start

Discussion in 'GIMP for Mac' started by mappler, Oct 23, 2008.

  1. mappler

    mappler New Member

    Joined:
    Oct 23, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I am running Mac OS 10.5.5, all updates available installed.
    I downloaded and installed the latest XQuartz release 2.3.1
    I downloaded the latest 2.6.1 release from http://gimp.lisanet.de/Website/Overview.html for Leopard/Intel.

    Gimp will not launch. Gimp launches fine from the command line if I run it as "sudo gimp" (pathnames omitted).

    Run from the command line without sudo, Gimp outputs the following error message:

    Could not get password database information for UID of current process: Failed to get groups for username "mappler" primary GID 1189380437: Unknown error: 0

    Failed to start message bus: Memory allocation failure in message bus
    EOF in dbus-launch reading address from bus daemon
    process 21653: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/tmp/skl/Gimp.app/Contents/Resources/var/lib/dbus/machine-id": No such file or directory
    See the manual page for dbus-uuidgen to correct this issue.
    D-Bus not built with -rdynamic so unable to print a backtrace
    /tmp/skl/Gimp.app/Contents/Resources/bin/gimp: line 10: 21653 Abort trap gimp-2.6 "$@"
    kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]



    I am using an account that is bound to an Active Directory. I'm assuming there is some kind of permissions error, but I am not sure how to proceed. Almost all help I've found is related to updating version of X11 or Gimp. Any help would be appreciated.

    Thank you,
    -Matt
     
  2. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    hhmm, this (and Active Diretory) seems to be the cause why dbus won't start.

    Could you just try a few things in Terminal.app?

    If there's a link /tmp/skl/Gimp.app, then please delete it (it will be regenarated on-the-fly if neede) adn please delete the (now empty) directory "skl". Now open Terminal.app and go to "/Applications/Gimp.app/Contents/Resources" and start "./script" (_not_ bin/gimp).

    What happens? Any error messages?
     
  3. mappler

    mappler New Member

    Joined:
    Oct 23, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Thank you for your help. I did as you requested. The link and the directory were there and I removed them. I ran the "script" from that directory and got the same error messages:

    Could not get password database information for UID of current process: Failed to get groups for username "mappler" primary GID 1189380437: Unknown error: 0

    Failed to start message bus: Memory allocation failure in message bus
    EOF in dbus-launch reading address from bus daemon
    process 22599: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/tmp/skl/Gimp.app/Contents/Resources/var/lib/dbus/machine-id": No such file or directory
    See the manual page for dbus-uuidgen to correct this issue.
    D-Bus not built with -rdynamic so unable to print a backtrace
    /tmp/skl/Gimp.app/Contents/Resources/bin/gimp: line 10: 22599 Abort trap gimp-2.6 "$@"
    kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]


    I'm more than happy to try whatever is necessary to help troubleshoot this problem.
    Thank you,
    -Matt
     
  4. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    I'm not familiar to Active Directory, soory. But just another try....

    I've patched the start scripts of the bundle so thar /tmp/skl will be world-writable. Please download the scripts from

    http://gimp.lisanet.de/Archiv.zip

    and place them into your application bundle, replacing the existing ones.

    "script" and "openDoc" go into "Applications/Gimp.app/Contents/Resources"
    "gimp" and "gimp-remote" go into "Applications/Gimp.app/Contents/Resources/bin"

    Then, please delete the link /tmp/skl/Gimp.app and the directory "skl" (some procedure as above) and try running "./script" again.

    Any output?

    skl
     
  5. mappler

    mappler New Member

    Joined:
    Oct 23, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    No luck. Same result.

    /tmp/skl did in fact come out world readable though.
    drwxrwxrwx 3 mappler wheel 102 Oct 23 17:42 skl/

    Active directory support has all sorts of these little weird OS X issues....

    Thanks,
    -Matt
     
  6. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    IMO dbus is not able to change itself to run under your user ID.

    drwxrwxrwx 3 mappler wheel 102 Oct 23 17:42 skl/

    Your UID is 102. AFAIK on Macs UIDs start with 501 and anything below 500 is reseverd for system / root use. This is why you can run gimp with "sudo". It seems, that OS X will prevent a user-space program (dbus-daemon) to change it's UID to anything below 500 - which relly makes sense, because if it will be possibel for any user space program to get to these UIDs ... this would be a very big security hole.

    Hhmm, is there any way that you can map your UID to something like "502"? Is this possible with Active Directory (and of course, doesn't break any other permissions?). Maybe this will allow dbus-damon to start up properly. (I'm quite sure it will)

    -skl
     
  7. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    ... hhmm, the UID should already exists. If not, IMO, dbus could fail again.
    But maping to an already existing UID may not be a good idea... ???
     
  8. mappler

    mappler New Member

    Joined:
    Oct 23, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    My UID is not 102. What I posted was the output from "ls -l". This output is in this format: file mode, number of links, owner name, group name, number of bytes in the file, abbreviated month, day-of-month file was last modified, hour file last modified, minute file last modified, and the pathname.

    My UID is actually 192172195

    I did find a new possible cause however. I have found some people posting that dbus has problems if you are a member of more than 16 groups. I am in fact a member of more than 16 groups. Most of these posts are old, so I am still tracking down this issue. I'll let you know what else I find.

    -Matt
     
  9. mappler

    mappler New Member

    Joined:
    Oct 23, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Ok, I have the problem (but not the solution) figured out now I believe. The issue does in fact appear to be one of group membership. dbus-launch is the culprit.

    I created another domain account and ran Gimp from there. Everything worked fine. I then added that user to another 10 groups on the domain, logged out, logged back on. This actually maps the user to more than 10 groups (OS X maps a few more local machine groups). The "id" command was reporting 17 groups. dbus-launch failed with the error messages above, Gimp would not run.

    I then removed 1 domain group (which ended up removing 1 local group as well) and brought the total to 15 groups as reported from id. dbus-launch, and therefore Gimp as well, ran just fine. There is a constant called "NGROUPS_MAX" on unix machines, including Darwin, that defines the maximum number of groups you can be a member of. For OS X that is 16. It appears Apple has done something to allow their applications to run properly even if you end up with more groups. dbus-launch however, seems to have a problem here.

    So, I'm fairly confident I have the problem narrowed down to the root causes. I have no idea how to proceed to fix it though..;) I'm not sure if something could be edited in dbus-launch to work around the problem.

    Thanks,
    -Matt
     
  10. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    ... wow, thanks for your work on finding this out. Great.

    So I think we should give this information to the dbus developers. Maybe they can find a way to work around this limitation.

    Thanks again.
    -skl
     
  11. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    I've dived into the sources of dbus (I really love hacking on C source code... ;D ), and found some related postings on the net...

    IMO the problem lies in "dbus/dbus-sysdeps-unix.c" around line 1589.

    The first call to getgrouplist() should either work or return the correct number of groups if the intitial value is too small. (the current implementation set this to 17, meaning 16 groups and 1 primary group)

    This fails on your system. I don't know if it's an issue with Mac OS X (the manpage of gethostlist() doesn't say that the nummber of groups will be set correctly on errors) or if it's only related to Active Directory, but we could simply test it...

    AFAICS, there are some possible fixes:

    quick&dirty: increase the initial value
    As gethostlist() only reads data, this should have no side effects like writing past the end of some system buffers (since NGROUPS_MAX is set to 16 in sys/syslimits.h) If this works, this would mean, that Darwin doesn't use NGROUPS_MAX, although it's defined

    elegant: get the correct number of groups
    Actually, the current sources should do this, but they fail ... It may be worth to check if the getgroups() system call will do it. (the manpage says that getgroups() never returns more groups then NGROUPS_MAX ??? )
    Another approch would be to increase the maximum value of groups until getgrouplist() doen't fail any longer. (that's more like "quick&dirty")

    do _not_ use getgrouplist() at all:
    we could simply use the primary GID which is retrieved correctly. Yours is 1189380437, right?
    AFAICS, dbus doesn't rely on a complete group list, so the primary GID should be sufficient.

    Any suggestions, what to test first?

    -skl
     
  12. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    Here are some libs for testing...

    This one uses the "elegant" way to get the nummber of groups:

    http://gimp.lisanet.de/dbus-libs-elegant.zip

    and this one only uses the primary GID

    http://gimp.lisanet.de/dbus-libs-pGID.zip

    Could you please test them?
    Each archive contains two libraries (libdbus-1.3.4.0.dylib and libdbus-glib-1.2.1.0.dylib). Please drop them into "/Applications/Gimp.app/Contents/Resources/lib" replacing the existing ones.

    Both versions work on my system (with a user with less than 16 groups).

    Go to "/Applications/Gimp.app/Contents/Resources" and run "./script". Does it run now? Which version works, "elegant" or "pGID"? Any error messages? (I've added a new one...)

    -skl
     
  13. mappler

    mappler New Member

    Joined:
    Oct 23, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Unfortunately, neither worked. Which is strange. I expected both might work.

    -Matt

    Elegant:
    Could not get password database information for UID of current process: Failed to get groups for username "mappler" primary GID 1189380437: Unknown error: 0

    Failed to start message bus: Memory allocation failure in message bus
    EOF in dbus-launch reading address from bus daemon
    process 35974: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/tmp/skl/Gimp.app/Contents/Resources/var/lib/dbus/machine-id": No such file or directory
    See the manual page for dbus-uuidgen to correct this issue.
    D-Bus not built with -rdynamic so unable to print a backtrace
    /tmp/skl/Gimp.app/Contents/Resources/bin/gimp: line 10: 35974 Abort trap gimp-2.6 "$@"
    kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]


    The other one:
    Could not get password database information for UID of current process: Failed to get groups for username "mappler" primary GID 1189380437: Unknown error: 0

    Failed to start message bus: Memory allocation failure in message bus
    EOF in dbus-launch reading address from bus daemon
    process 35999: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/tmp/skl/Gimp.app/Contents/Resources/var/lib/dbus/machine-id": No such file or directory
    See the manual page for dbus-uuidgen to correct this issue.
    D-Bus not built with -rdynamic so unable to print a backtrace
    /tmp/skl/Gimp.app/Contents/Resources/bin/gimp: line 10: 35999 Abort trap gimp-2.6 "$@"
    kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
     
  14. mappler

    mappler New Member

    Joined:
    Oct 23, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I wrote a quick program to make a call to "getgrouplist" and see what it returned. The function appears to run correctly, although obviously ignoring the system maximum..;)
    I pass it my username, my basegid (which is 1189380437),an integer array, and array size integer.

    If I set ngroups to 300, and it runs correctly and reports 27 groups and returns a result code of 0.
    If I set ngroups to 16, it operates properly and returns the first 16 groups into the integer array and returns a result code of -1.

    It does not return the "correct" number of groups if I pass it a number too small. It just fills the array to the amount you claimed to have allocated and returns a -1.

    -Matt
     
  15. mappler

    mappler New Member

    Joined:
    Oct 23, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    One other note: If the value you pass in for "basegid" is not in the grouplist, then "getgrouplist" makes that the first value of the array it passes back to you as if it is one of your groups. I forgot to initialize that value when writing my test stub and was momentarily confused when my first group was a negative number. :) Once I initilized it to a valid group, it did NOT add it to the list.

    So, to clarify, if I pass in a basegid of "22222", then getgrouplist will return that I have 28 groups and the array will start with the group "22222".
    If I base in a basegid of a valid group that I am a member of, getgrouplist will return that I have 27 groups and return an array of my actual GIDs.
    Either way, the function would return a return code of 0.

    I'm not sure if this is relevant, but thought I would mention it.
     
  16. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    I expected this too, at least the second approach should work.

    What makes me think, that I have mixed up someting on compiling the different libs, is, that both error messages are identical. This shouldn't happen, because the second version was supposed not to use getgrouplist(). Sorry.

    I've recompiled this... so could you do another test, please? Here are the libs, which don't use getgrouplist() at all and only take your primary GID.

    http://gimp.lisanet.de/dbus-libs-pgid-2.zip

    What happens now?
     
  17. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    ... that would give us the possibility to fill in your correct primary GID, use a high initial value for ngroups (something like 200, 300) and get the right group list.

    BTW, there's a system function getgroups(), which should return the number of groups the current user is in by calling

    ngroups = getgroups(0, NULL) + 1;

    Will this work on your system too?
     
  18. mappler

    mappler New Member

    Joined:
    Oct 23, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    getgroups runs fine, but it lies..;) It returns 17, which I guess is NGROUPS_MAX plus the 1 you added in.
    I tried the libraries you provided. I got the SAME error message. So, I tried removing them from Gimp.app entirely to make sure I wasn't doing something wrong. I got the following error message which I guess makes sense but makes me wonder if the problem isn't in the dbus_launcher executable itself before it even calls those libraries.

    Could not get password database information for UID of current process: Failed to get groups for username "mappler" primary GID 1189380437: Unknown error: 0

    Failed to start message bus: Memory allocation failure in message bus
    EOF in dbus-launch reading address from bus daemon
    dyld: Library not loaded: /tmp/skl/Gimp.app/Contents/Resources/lib/libdbus-glib-1.2.dylib
    Referenced from: /tmp/skl/Gimp.app/Contents/Resources/bin/gimp-2.6
    Reason: image not found
    /tmp/skl/Gimp.app/Contents/Resources/bin/gimp: line 10: 38879 Trace/BPT trap gimp-2.6 "$@"
    kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
     
  19. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    ... arrgghh! dbus-launch and dbus-daemon are _not_ linked dynamicly. They are static binaries.... What the hell is this dbus stuff all about... building *dylib and not using them ... ???

    So, here's the archiv with libs _and_ both binaries to replace dbus-launch and dbus-daemon in "Appl*/Gimp.app/C*/R*/bin"

    http://gimp.lisanet.de/dbus-libs-pgid-3.zip
     
  20. mappler

    mappler New Member

    Joined:
    Oct 23, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Winner! :D
    That works perfectly.
    There were no messages at all output to the terminal.
    Thank you very much for helping troubleshoot the problem. I really do appreciate it.
    Please let me know if you need any more information to report back upstream to the dbus development group.
    -Matt
     

Share This Page