Calling pinentryPath in GPGController +initialize causes hang in some occasions (was: Mail hangs in semaphore_wait_trap from GPGTaskHelperXPC) Libmacgpg #141 ✔

Shad Sterling's Avatar

Shad Sterling

24 Feb, 2015 03:03 AM

Mail had been freezing up for several seconds at a time, so I closed and reopened it, and the reopen never got far enough to show the UI. In Activity Monitor, the trace looks like it's stuck in a GPGMail semaphore. The last thing I did with GPGMail was install the latest version, which I did when I got the prompt that the previously installed version had expired. I've attached the trace from Activity Monitor.

How do I get this unstuck?

  1. 1 Posted by Shad Sterling on 24 Feb, 2015 05:01 AM

    Shad Sterling's Avatar

    After a reboot Mail seems to be working again, we'll see if it starts freezing up again. Before the reboot I noted a few GPG processes running:

    2943 ?? 0:00.00 (gpg2) 32872 ?? 0:18.49 /usr/local/MacGPG2/bin/gpg-agent --daemon
    32878 ?? 0:00.01 /bin/bash /usr/local/MacGPG2/libexec/shutdown-gpg-agent
    32955 ?? 0:13.95 /opt/local/bin/gpg-agent --write-env-file --no-use-standard-socket --launchd
    34432 ?? 0:31.60 /Library/Application Support/GPGTools/org.gpgtools.Libmacgpg.xpc
    79544 ?? 0:16.51 /usr/local/MacGPG2/libexec/ /Library/Application Support/GPGTools/
    79545 ?? 0:15.89 /usr/local/MacGPG2/libexec/

    After the reboot, it's mostly similar:

    470 ?? 0:00.22 /Library/Application Support/GPGTools/org.gpgtools.Libmacgpg.xpc 571 ?? 0:00.05 /opt/local/bin/gpg-agent --write-env-file --no-use-standard-socket --launchd 577 ?? 0:00.01 /bin/bash /usr/local/MacGPG2/libexec/shutdown-gpg-agent 650 ?? 0:00.04 /usr/local/MacGPG2/bin/gpg-agent --daemon 982 ttys001 0:00.00 grep -n --color=auto -i gpg

    Was the original problem with the updater? Do I need to check that GPGMail is not half-updated?

  2. Support Staff 2 Posted by Luke Le on 24 Feb, 2015 02:19 PM

    Luke Le's Avatar

    Hi Shad,

    it's really strange this problem is reoccurring on your system.
    Could you open and search for "org.gpgtools.Libmacgpg" and post the messages you find here?


  3. 3 Posted by Shad Sterling on 25 Feb, 2015 05:36 AM

    Shad Sterling's Avatar

    Before the reboot searching Console for gpg got zero hits. Now there are 3, from long after Mail got back to normal:

    2015-Feb-24 19:17:01.000 kernel[0]: Sandbox: Mail(7498) deny file-write-unlink /Users/polyergic/.gnupg/gpg.conf
    2015-Feb-24 19:17:01.000 kernel[0]: Sandbox: Mail(7498) deny file-write-unlink /Users/polyergic/.gnupg/gpg.conf
    2015-Feb-24 19:17:01.824 Mail[7498]: Loaded GPGMail 2.5b5

  4. Support Staff 4 Posted by Steve on 25 Feb, 2015 02:35 PM

    Steve's Avatar

    Did you run the GPG Suite beta 5 update or use automatic update? If the latter, I'd suggest to run the GPG Suite from our homepage over it just to make sure everything is on the latest release status.

    So after that, did any issues persist? Any observations from today?

    All the best,

  5. 5 Posted by Shad Sterling on 25 Feb, 2015 03:51 PM

    Shad Sterling's Avatar

    I'm not aware of any automatic update, but that's essentially the point of having automatic updates. When I got the prompt that the previously installed version had expired it would not update automatically. From my browser history it looks like I downloaded GPG_Suite-2015.02-b5-1161.dmg on February 13th (more recently than I thought), any update after that was automatic; what's installed now says it's version 2.5b5 build 891b.

    I haven't had any issues since rebooting. If it does happen again, the first thing I'll do is download & reinstall the GPG Suite.

  6. Support Staff 6 Posted by Steve on 26 Feb, 2015 06:04 PM

    Steve's Avatar

    OK Shad, can you continue to observe this and let us know should this hang re-appear on your system please.

  7. 7 Posted by Shad Sterling on 09 Mar, 2015 04:05 PM

    Shad Sterling's Avatar

    Something similar happened again today. This time it wasn't freezing up, it was taking forever to load a particular message thread. (There were signed messages in that thread, all of them outgoing messages signed by GPGMail.) Quit and on restart it was again stuck in semaphore_wait_trap under GPGTaskHelperXPC. Killed, reinstalled GPG_Suite-2015.02-b5-1161.dmg (no reboot this time), and it again seems to be back to normal. Again there were no GPG entries in Console before or after; this time there was no GPGMail_Updater running before or after. Why would reinstalling the same version make any difference?

    470 ?? 0:57.83 /Library/Application Support/GPGTools/org.gpgtools.Libmacgpg.xpc 571 ?? 0:30.91 /opt/local/bin/gpg-agent --write-env-file --no-use-standard-socket --launchd 577 ?? 0:00.01 /bin/bash /usr/local/MacGPG2/libexec/shutdown-gpg-agent 650 ?? 0:39.99 /usr/local/MacGPG2/bin/gpg-agent --daemon 75224 ?? 0:00.00 (gpg2)

  8. 8 Posted by Shad Sterling on 16 Mar, 2015 09:11 PM

    Shad Sterling's Avatar

    Happened again today, Mail crashed while idle, and hung on relaunch. Same GPG processes running, no GPG entries in Console. More threads in sample this time.

    Can one of you point me to where in the code the semaphore wait happens? What's involved in getting this to run in a debugger?

  9. 9 Posted by Shad Sterling on 16 Mar, 2015 09:36 PM

    Shad Sterling's Avatar

    Tried relauching with reinstall or reboot, hung again the same way. Reinstall got it working again.

  10. Support Staff 10 Posted by Steve on 25 Mar, 2015 08:26 PM

    Steve's Avatar

    Hi Shad, thanks for keeping an eye on this. GPG Suite b6 is out and you might want to install the update.

    I don't think it fixes this problem since we have not working in that area. Nonetheless it would be good to keep testing with the latest beta.

    Have you found any steps to trigger this issue? So far it seems to come and go pretty random.


  11. 11 Posted by Jim on 30 Mar, 2015 08:27 AM

    Jim's Avatar

    Sam problem here. Mail hangs on startup. Reinstalling gpgtools solves it for e while.

  12. 12 Posted by Tom on 30 Mar, 2015 04:17 PM

    Tom's Avatar

    Same for me.

    It happens from time to time when I send an encrypted message. The message is stuck in "saving to drafts/outbox/whatever" and I am not able to recover it anyhow. The whole Mail app is then still responsive, however in the activity window, I can see that every activity is stuck. I'm not able to download new mails or send one.

    Probably the most annoying thing about it is, that the mail I supposed to send is completely gone. Sometimes I don't even notice that it was not sent, since there is no feedback from (you can only see the stuck message if you open the activity window). So I first realised this a couple of weeks ago when someone told me that I have not responded on his mail (which I actually did).


  13. 13 Posted by mjl on 31 Mar, 2015 09:20 PM

    mjl's Avatar

    Something similar happened here, starting Mail just gives me a spinning beach ball.

    It seems to be related with a couple of left over processes from earlier runs, I found:

    $ ps auxwww | grep -i gpg
    mjl               805   0.0  0.1  2741608   8224   ??  S    24Mar15   0:07.86 /Library/Application Support/GPGTools/org.gpgtools.Libmacgpg.xpc
    mjl               739   0.0  0.0  2450600    692   ??  Ss   24Mar15   0:04.78 /usr/local/MacGPG2/bin/gpg-agent --daemon
    mjl               593   0.0  0.0  2442584     48   ??  S    24Mar15   0:00.01 /bin/bash /usr/local/MacGPG2/libexec/shutdown-gpg-agent
    mjl             77766   0.0  0.0  2433796    648 s000  S+   11:10PM   0:00.00 grep -i gpg
    mjl             65096   0.0  0.0        0      0   ??  Z    11:53AM   0:00.00 (gpg2)

    I killed 805, 739, 593 and suddenly stopped beachballing and openened its window.

    I've also got a

    31.03.15 23:07:41,766 spindump[309]: Saved hang report for Mail version 8.2 (2070.6) to /Library/Logs/DiagnosticReports/Mail_2015-03-31-230741_parsnip.hang

    which I'm attaching for your perusal.



  14. Support Staff 14 Posted by Luke Le on 01 Apr, 2015 03:53 PM

    Luke Le's Avatar

    Thank you for all your reports and log files.

    It looks like GPGMail wants to connect to the XPC service while it's not yet up and running. Curiously enough, we were not yet able to reproduce this issue, but should be able to work around it.

    I'll create a ticket for it and this discussion will be updated when the bug is fixed.
    Should anyone of you still happen to find a scenario to reliably reproduce this, it would be really great.


  15. Support Staff 15 Posted by Luke Le on 01 Apr, 2015 04:33 PM

    Luke Le's Avatar

    This bug should be fixed in the latest nightly.
    Could you please install that from and let us know if it helps?


  16. 16 Posted by mjl on 03 Apr, 2015 08:11 AM

    mjl's Avatar

    Do the nightlies actually work? All I can get is "Not Found
    The requested URL /nightlies/GPG Suite-1299n.dmg was not found on this server."

  17. 17 Posted by Shad Sterling on 06 Apr, 2015 07:58 PM

    Shad Sterling's Avatar

    Happened again with 2.5b6 (build 916b) while trying to edit the outgoing server list from the send error dialog in a new message window. Hung on relaunch twice before I realized I had the Cisco AnyConnect VPN client running, but after closing that Mail hung on relaunch a third time. After rebooting the computer it opened normally (and I was able to update the server list and send that message). I'm also unable to download the nightly.

  18. Support Staff 18 Posted by Steve on 07 Apr, 2015 12:56 PM

    Steve's Avatar

    Hi Shad and mjl,

    we had a glitch with the server cache and nightly channel updates. Should be fixed now.

    Could you please download and install our latest nightly build and see if the problem persists. That page also has sig and SHA1 to verify the download.

    All the best, steve

    Disclaimer: This is a development version which has not been thoroughly tested yet - bugs or crashes are to be expected. Thanks for helping us test.

  19. Support Staff 19 Posted by Steve on 23 Apr, 2015 08:02 PM

    Steve's Avatar

    Hey all,

    did anybody ever get around to test this fix? It would be great to get feedback on this.

    If you have a minute please install the latest nightly, which should solve this issue.

  20. 20 Posted by Jim Hillebrand on 26 Apr, 2015 09:36 AM

    Jim Hillebrand's Avatar

    Hi Steve,

    Ik just installed the fix. I let you know.


  21. Support Staff 21 Posted by Steve on 27 Apr, 2015 10:26 AM

    Steve's Avatar

    Thanks Jim, please do keep us posted. And if others want to help test the fix, that would be most welcome.

  22. 22 Posted by Tamas Gal on 27 Apr, 2015 04:58 PM

    Tamas Gal's Avatar

    Hey all,

    it seems to be fixed, I did not had the error for the last two days!


  23. 23 Posted by Shad Sterling on 02 May, 2015 01:42 AM

    Shad Sterling's Avatar

    Just had it happen again with build 930n, which I believe was a nightly build after comment 18. It happened at least twice (there was a 3rd hang which I didn't sample), and relaunching worked after killing the GPG processes that were running after the first occurrence:

      446 ??         0:55.99 /Library/Application Support/GPGTools/org.gpgtools.Libmacgpg.xpc
      658 ??         0:41.64 /opt/local/bin/gpg-agent --write-env-file --no-use-standard-socket --launchd
      664 ??         0:00.01 /bin/bash /usr/local/MacGPG2/libexec/shutdown-gpg-agent
      760 ??         0:54.76 /usr/local/MacGPG2/bin/gpg-agent --daemon
    15147 ??         0:09.18 /Library/Application Support/GPGTools/
    20815 ??         0:23.75 /usr/local/MacGPG2/libexec/
    92498 ??         0:00.00 (gpg2)

    This time there were some messages in, I think they're all from after closing the previous instance of

    2015-May-01 21:13:59.892 Mail[28855]: Loaded GPGMail 2.5b6 (7bf389b)
    2015-May-01 21:15:38.487 Mail[28874]: Loaded GPGMail 2.5b6 (7bf389b)
    2015-May-01 21:18:53.307[1]: (org.gpgtools.macgpg2.updater[20815]) Service exited due to signal: Killed: 9
    2015-May-01 21:18:59.956 Mail[28988]: Loaded GPGMail 2.5b6 (7bf389b)
    2015-May-01 21:20:11.609[1]: (org.gpgtools.gpgmail.updater[15147]) Service exited due to signal: Terminated: 15
    2015-May-01 21:20:11.609[1]: (org.gpgtools.Libmacgpg.xpc[446]) Service exited due to signal: Terminated: 15
    2015-May-01 21:20:11.858[1]: (org.gpgtools.macgpg2.shutdown-gpg-agent[664]) Service exited with abnormal code: 143
    2015-May-01 21:20:21.504 Mail[29010]: Loaded GPGMail 2.5b6 (7bf389b)
    2015-May-01 21:20:34.000 kernel[0]: Sandbox: Mail(29010) deny file-write-unlink /Users/polyergic/.gnupg/gpg.conf
    2015-May-01 21:20:34.000 kernel[0]: Sandbox: Mail(29010) deny file-write-unlink /Users/polyergic/.gnupg/gpg.conf

    This time I closed the previous instance of because it had stopped sending outgoing mail to one of my accounts; I don't know weather that's related to GPGMail, or to this bug.

  24. Support Staff 24 Posted by Steve on 02 May, 2015 09:18 AM

    Steve's Avatar

    Shad, can you please copy all version info as described here into this discussion.

    GPGMail nightly is at 938n, but I would suggest to run GPG Suite 1326n or newer to check if this issue persists for you.

  25. 25 Posted by Shad Sterling on 04 May, 2015 12:52 AM

    Shad Sterling's Avatar

    Mac OS X 10.10.2 (14C1514)
    Libmacgpg 0.5 690n (92e4934)
    GPGMail 2.5b6 930n (7bf389b)
    GPG Keychain 1.2b6 1069n (2b8a5d9)
    GPGServices 1.10b6 788n (5e667ad)
    MacGPG2 2.0.27b6 807n (a3f96e8)
    GPGPreferences 1.5b6 779n (fab904e)

  26. Support Staff 26 Posted by Steve on 04 May, 2015 08:07 AM

    Steve's Avatar

    Hi Shad,

    that is not the latest nightly version of GPG Suite. Please update to GPG Suite 1326n or later from here:

    Also please update your OS to 10.10.3 (via the Mac AppStore) which includes a ton of security relevant fixes. After that see if the issue persists.

  27. 27 Posted by Shad Sterling on 04 May, 2015 01:45 PM

    Shad Sterling's Avatar

    Of course it's not the latest; when the glitch with downloading was fixed I updated. Wasn't that update supposed to have the fix for this hang? If the hang still occurs after the fix, I'd say there's some case where the fix doesn't work.

    I didn't realize you expected me to go to the site every day and install the new nightly. Is there any way to automate that?

  28. Support Staff 28 Posted by Steve on 02 Jun, 2015 12:35 PM

    Steve's Avatar

    Hi Shad,

    any GPG Suite nightly build higher than 1325n should include the fix.

    If you want to receive nightly updates, please open GPGPreferences > Updates and select the nightly channel. Use any update interval which fits your needs.

    Let me know if that worked. Also did the issue reappear for you? If so, please copy all version info as described here into this discussion.

    All the best,

  29. 29 Posted by Shad Sterling on 03 Jun, 2015 06:11 PM

    Shad Sterling's Avatar

    GPG Preferences doesn't show a version number for GPG Suite. I've changed everything to check daily, they were already on the nightly channel. GPGMail is now on 1004n.

    I haven't seen the issue since my last comment. I usually tell GPGMail to install on close, but I almost never close Mail; usually it gets closed when the system crashes, which I've started to think also prevents the install on close from running.

  30. Support Staff 30 Posted by Steve on 23 Jun, 2015 10:01 PM

    Steve's Avatar

    Shad, how were the past weeks? Did this re-occur?

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac