• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Call sequence 'getpwuid(getuid())' unexpectedly returns NULL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Call sequence 'getpwuid(getuid())' unexpectedly returns NULL


  • Subject: Call sequence 'getpwuid(getuid())' unexpectedly returns NULL
  • From: "Sean Gates" <email@hidden>
  • Date: Fri, 31 Oct 2008 09:00:39 -0500
  • Thread-topic: Call sequence 'getpwuid(getuid())' unexpectedly returns NULL

Greetings from a new subscriber,

 

I’m having a problem on Macintosh OSX 10.4 & 10.5 involving user information lookup where the ‘getpwuid(getuid())’ call sequence starts unexpectedly returning NULL after an initial period of successful operation. On some systems the lookup failures start within than a day; on others, no failures have yet been observed.

 

I have a parent daemon process running as 'root' which spawns child processes running as some non-privileged, local user (with UID 502, for example) that invoke the call sequence 'getpwuid(getuid())’ to obtain user information. After the parent has been in operation for a day or so, the child 'getpwuid(getuid())' invocations start returning NULL (I've verified that 'getuid()' is still returning 502 as expected). This condition seems to persist until the parent process is killed and restarted, at which point lookups in child processes start working again and the cycle repeats. The machine itself is not rebooted.

 

The question is: Why would restarting the parent daemon cause user info lookups in child processes to start working again? There's virtually nothing being inherited by the child from the parent other than a single socket connected to the child's STDIO file descriptors. The forked child processes 'exec' a completely different program from that of the parent. (Also the 'lsof' listings of child processes whose user info lookups fail are the same as those whose lookups succeed.)

 

I've seen a few posts in various mailing lists reporting similar problems (Apple's and others - e.g. http://lists.apple.com/archives/macos-x-server/2008/Aug/msg00153.html thread) but have yet to see a technical explanation for why this might be happening or a definitive procedure for avoiding it. Some responses to these posts suggest that the issue has been resolved in OSX 10.5 but the problem is still being observed with OSX 10.5.4 & 10.5.5, both on our in-house systems as well as at customer sites.

 

Any insights on how to address this problem would be greatly appreciated.

 

// sean

 

P.S. In my desperation, I've cross-posted to the following Apple mailing lists: Darwin-dev, Darwin-userlevel, Macos-x-server and Unix-porting. Apologies for any inconvenience.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Call sequence 'getpwuid(getuid())' unexpectedly returns NULL
      • From: "Justin C. Walker" <email@hidden>
  • Prev by Date: Re: malloc errors / fragmentation?
  • Next by Date: Re: Call sequence 'getpwuid(getuid())' unexpectedly returns NULL
  • Previous by thread: Re: malloc errors / fragmentation?
  • Next by thread: Re: Call sequence 'getpwuid(getuid())' unexpectedly returns NULL
  • Index(es):
    • Date
    • Thread