Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#49790 closed defect (fixed)

pth @2.0.7: hangs on PowerPC

Reported by: JR1994 Owned by: Ionic (Mihai Moldovan)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: powerpc Cc: mklein-de (Michael Klein)
Port: pth

Description (last modified by Ionic (Mihai Moldovan))

I am gnupg2 on OSX 10.5.8 and I a seeing really high cpu usage out of gpg-agent. I will also attach a portion of my system log so you can see the error I am seeing


The issue is really in pth and only triggered on ppc platforms.

Attachments (3)

system.txt (2.6 KB) - added by JR1994 9 years ago.
system log
mem.txt (736 bytes) - added by JR1994 9 years ago.
vmtop.d dtrace script
Portfile-pth.patch (813 bytes) - added by mklein-de (Michael Klein) 9 years ago.
pth Portfile patch

Download all attachments as: .zip

Change History (23)

Changed 9 years ago by JR1994

Attachment: system.txt added

system log

comment:1 Changed 9 years ago by JR1994

Cc: herminio.hernandezjr@… added

Cc Me!

comment:2 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: herminio.hernandezjr@… removed
Keywords: gnupg removed
Owner: changed from macports-tickets@… to ionic@…

comment:3 Changed 9 years ago by Ionic (Mihai Moldovan)

Are you actually logging in as root?

Something tries to spawn gpg-agent as user root, which is not supported.

Please create a "real" user account. Do you see the same problem with that configuration?

If yes, are you sure it's registered as a LaunchAgent and not a LaunchDaemon?

comment:4 Changed 9 years ago by JR1994

No I do not login as root, I am login as me. From what I see my account is running the process and it is a LaunchAgent.

herminio-hernandezs-power-mac-g4:~ herminio$ ls /Library/LaunchAgents/
com.hp.launchurlagent.plist	org.macports.gpg-agent.plist	org.macports.startx.plist
herminio-hernandezs-power-mac-g4:~ herminio$ ps aux |grep gpg-agent
herminio   185  49.7  0.1    78888   1360   ??  S     2:13PM   4:24.93 /opt/local/bin/gpg-agent --write-env-file --no-use-standard-socket --launchd

What else do you need me to check?

Last edited 9 years ago by JR1994 (previous) (diff)

comment:5 Changed 9 years ago by Ionic (Mihai Moldovan)

Are you absolutely positive?

What does id return?

comment:6 Changed 9 years ago by JR1994

here is the output

herminio-hernandezs-power-mac-g4:~ herminio$ id
uid=501(herminio) gid=20(staff) groups=20(staff),98(_lpadmin),81(_appserveradm),79(_appserverusr),80(admin),101(com.apple.sharepoint.group.1)

comment:7 Changed 9 years ago by JR1994

the error is saying "launchd only supported for real users - i.e., UID >= 500" yet my account which owns the process is 501

herminio-hernandezs-power-mac-g4:~ herminio$ dscl . -list /Users UniqueID
_amavisd           83
_appowner          87
_appserver         79
_ard               67
_atsserver         97
_calendar          93
_clamav            82
_cvs               72
_cyrus             77
_devdocs           59
_eppc              71
_installer         96
_jabber            84
_lp                26
_mailman           78
_mcxalr            54
_mdnsresponder     65
_mysql             74
_pcastagent        55
_pcastserver       56
_postfix           27
_qtss              76
_sandbox           60
_securityagent     92
_serialnumberd     58
_spotlight         89
_sshd              75
_svn               73
_teamsserver       94
_tokend            91
_unknown           99
_update_sharing    95
_usbmuxd           213
_uucp              4
_windowserver      88
_www               70
_xgridagent        86
_xgridcontroller   85
daemon             1
herminio           501
ldap               500
macports           502
nobody             -2
root               0

Version 1, edited 9 years ago by JR1994 (previous) (next) (diff)

comment:8 Changed 9 years ago by Ionic (Mihai Moldovan)

Hmm, that's fine.

Something must be trying to load the agent, though, most likely root.

Does sudo launchctl list | grep -i gpg return anything? It should not.

comment:9 Changed 9 years ago by JR1994

It returns nothing

herminio-hernandezs-power-mac-g4:~ herminio$ sudo launchctl list | grep -i gpg
Password:
herminio-hernandezs-power-mac-g4:~ herminio$

comment:10 Changed 9 years ago by Ionic (Mihai Moldovan)

Hmmm, okay. And what process exactly is creating the high CPU load? The gpg-agent process that is owned by your user, or the gpg-agent that is getting spawned by launchd and exits in a loop?

comment:11 Changed 9 years ago by JR1994

If I look at top it is my process

Processes:  55 total, 3 running, 52 sleeping... 317 threads                                                17:06:31
Load Avg:  1.85,  2.05,  2.16    CPU usage:  8.85% user, 68.58% sys, 22.57% idle
SharedLibs: num =    2, resident =   75M code,     0 data, 4252K linkedit.
MemRegions: num = 16103, resident =  760M +   22M private,  267M shared.
PhysMem:  224M wired, 1142M active,  376M inactive, 1744M used,  304M free.
VM: 6287M + 140M   137061(0) pageins, 11(0) pageouts

  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
    0 kernel_tas  60.6%  2:14:15  42     2    271 3984K      0   188M   170M 
  185 gpg-agent   57.9%  2:08:03   1    20     52  348K   428K  1360K    21M 
 1019 top          8.9%  0:00.75   1    18     28  728K   200K  1320K    18M 
  802 Activity M   6.3%  0:48.38   4   108    154 2504K    28M    10M   185M 
  724 Terminal     3.5%  0:20.85   3   103    147 2936K    15M  9716K   170M 
  803 pmTool       3.4%  0:49.11   1    24     26  428K  2912K  1268K    27M 
   50 WindowServ   3.0%  7:46.82   6   237    635 2804K    36M    35M   238M 
  908 Roccat       1.1%  1:54.38  20   279   1984  158M    31M   184M   409M
  721 thunderbir   0.4%  7:05.94  35   237   3019  284M    17M   326M   529M

herminio-hernandezs-power-mac-g4:~ herminio$ ps aux |grep 185
herminio   185  60.4  0.1    78888   1360   ??  S    Tue02PM 128:41.49 /opt/local/bin/gpg-agent --write-env-file --no-use-standard-socket --launchd

comment:12 Changed 9 years ago by Ionic (Mihai Moldovan)

Okay, so there's two problems: something tries to start gpg-agent as a system user and I should probably include the user ID or name in case this happens in the error message.

A free-wheeling "correctly started" gpg-agent user process is weird though and I haven't seen it before.

Is it always happening, even after a login-cycle (i.e., logging out and back in?)

comment:13 Changed 9 years ago by JR1994

yes, also I am also seeing it consume a lot of VM. See attached.

Changed 9 years ago by JR1994

Attachment: mem.txt added

vmtop.d dtrace script

comment:14 Changed 9 years ago by mklein-de (Michael Klein)

Cc: michael.klein@… added

Cc Me!

comment:15 Changed 9 years ago by mklein-de (Michael Klein)

same here on a G5 running 10.5.8

what's gpg-agent doing here???

fossekall:~ $ gdb -p 15139
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:46:18 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-apple-darwin".
/Volumes/Users/michael/15139: No such file or directory.
Attaching to process 15139.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ............... done
0x00101ca0 in __pth_pqueue_increase ()
(gdb) bt
#0  0x00101ca0 in __pth_pqueue_increase ()
#1  0x00103834 in __pth_scheduler ()
#2  0x00104fdc in pth_spawn_trampoline ()
(gdb) c
Continuing.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000003
0x00101ca0 in __pth_pqueue_increase ()
(gdb) c
Continuing.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000003
0x00101ca0 in __pth_pqueue_increase ()
(gdb) 

comment:16 Changed 9 years ago by mklein-de (Michael Klein)

see https://www.mail-archive.com/pth-users%40gnu.org/msg00529.html

rebuilding pth with --with-mctx-mth=sjlj --with-mctx-dsp=ssjlj --with-mctx-stk=sas fixed gpg-agent for me

The only issue I have now is that I have to source ~/.gpg-agent-info to get a valid $GPG_AGENT_INFO

fossekall:~ $ gpg-agent   
gpg-agent: malformed GPG_AGENT_INFO environment variable

fossekall:~ $ echo $GPG_AGENT_INFO 
/tmp/launch-oxXTa6/Listeners_agent

fossekall:~ $ . ~/.gpg-agent-info 

fossekall:~ $ echo $GPG_AGENT_INFO
/tmp/launch-oxXTa6/Listeners_agent:307:1

fossekall:~ $ gpg-agent          
gpg-agent: gpg-agent running and available

Changed 9 years ago by mklein-de (Michael Klein)

Attachment: Portfile-pth.patch added

pth Portfile patch

comment:17 Changed 9 years ago by Ionic (Mihai Moldovan)

Description: modified (diff)
Keywords: powerpc added
Port: pth added; gpg-agent removed
Summary: gpg-agent @2.0.28 high cpupth @2.0.7: hangs on PowerPC

Sorry for the last response and thanks for triaging this issue.

Looks related to PPC only, which is the reason I have not seen this problem before.

Let's reassign this ticket.

comment:18 Changed 9 years ago by Ionic (Mihai Moldovan)

r144492 should get rid of the issue in pth. I still need to revbump gpg-agent, however, because the port is outdated anyway, I'll look into updating it at the same time.

Other dependent ports to be revbumped (if they are linking statically... but better safe than sorry):

comment:19 Changed 9 years ago by Ionic (Mihai Moldovan)

Resolution: fixed
Status: newclosed

gnupg2 updated to 2.0.29 in r144494, gpg-agent updated to 2.0.29 in r144495.

Please make sure to sync and update your systems. Also, please report back, even if the issue was fixed so that I know that I don't need to worry about it anymore.

comment:20 Changed 9 years ago by JR1994

I updated my ports and it looks the issue is fixed for me.

Thanks everyone!

Note: See TracTickets for help on using tickets.