Program unable to obtain user’s home folder
| Originator: | textmate | ||
| Number: | rdar://10261043 | Date Originated: | 10-Oct-2011 |
| Status: | Duplicate/9821898 | Resolved: | No |
| Product: | Mac OS X | Product Version: | 10.7.2 |
| Classification: | Other Bug | Reproducible: | Unable |
Programs that access user’s home folder via getpwuid() sometimes get back NULL pointer.
When this happens the user has to reboot to fix the issue and all programs on the system seems affected.
This happened occasionally prior to 10.6, I have never seen it happen on 10.6 (for me or user reports) but it seems to be back in 10.7.1 and 10.7.2 and the frequency might even be higher than prior to 10.6.
This is the code I presently use to obtain user’s home folder:
std::string home ()
{
passwd* entry = getpwuid(getuid());
if(!entry || !entry->pw_dir || access(entry->pw_dir, R_OK) != 0)
{
fprintf(stderr, "%s: abort due to missing home folder.\n", getprogname());
abort();
}
return entry->pw_dir;
}
Unfortunately the abort() is triggered for some users (on 10.7+).
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
2 desktop HDDs connected along with internal HDD
Just happened to me for the first time, as I was waking up from sleep. Normally, it's just my main HDD (2.5" 500GB spinning disk) and a Time Machine disk via FW, and I never had problems. Today, I connected up an extra disk via FW (so, 2 HDDs connected via FW in series), and I got this error.
SSD/HDD with this issue
just got this after a wake from sleep in 10.7.4. I have a 5 year old MacBook Pro with system/home folder on SSD (OCZ Vertex) with an HDD where the optical dive used to be, which is used for TimeMachine backups only.
SSD/HDD with this issue
just got this after a wake from sleep in 10.7.4. I have a 5 year old MacBook Pro with system/home folder on SSD (OCZ Vertex) with an HDD where the optical dive used to be, which is used for TimeMachine backups only.
General problem for me from time to time (Lion w SSD)
From time to time, my mac forgets who I am. I just got this error in TextMate 2; nice that they are smart enough to trap for it. When I'm am in a terminal window and I type "uid", it normal says "unknown uid: 502" (502 is my user id in the /etc/password file.
Anyway, that's my general experience. Typically, a reboot is required to fix the issue. Also, I normal cannot start any other applications and my process spikes to 100% usage.
Just a HDD
I have just a spinning drive. The error occurred for my when waking the computer up. I had nearly drained the battery before allowing it to charge overnight. The low-battery dialog had not appeared but it was moments away.
The disconcerting thing about the error is that it gives no indication that TextMate 2 is the application affected. I'm using TextMate 2 (9147).
I also have an HDD and an SSD
Very similar setup as oscar (first commenter). Textmate 2.0 (9064) and just woke up from sleep. Textmate has files open on the secondary disk.
I don't use Deep Sleep, nor do I have an SSD.
I just had this issue appear, running 10.7.4. It appeared after screensaver had been dismissed.
I am using Textmate 2.0 (9090).
I have an HDD and an SSD
Just experienced this on wake. I have an HDD where my optical drive was, but my OS, apps, and most of my home folder are on the SSD that replaced my original HDD.
Got it too just now, first time. I don't use Deep Sleep or other kinds of special sleep tools.
Deep Sleep
Just happened to me, fixed by restarting.
Version 2.0 (9064) on 10.7.3
Might be occurring more often?... I don't know.
Deep Sleep
I experience the same problems when Textmate 2.0 (8971) is opened combined with the usage of the Deep Sleep widget: http://deepsleep.free.fr/
Dual disks
I got it just now, (was on when I woke the computer so I don't know what may have caused it) But I have dual disks, an SSD with the system, programs etc and a secondary mechanical drive that holds the homefolder which is symlinked in the Users folder.
Don't know if this information will be of any assistance.