Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

symbolic links get corrupted by system process?

Greetings Folks,


This was posted in another forum, so I'm reposting two messages here:


I am having a problem with symbolic links getting corrupted. I have a new Mac Pro running 10.7.3. I have defined symbolic links


/Users/walker/G2S -> /Volumes/L2A/G2S [this is pointing to a different partition on the same JBOD RAID]

/home -> /Users


The second link was created after unmounting /home and removing it from the /etc/auto_master file.


Both symbolic links worked for several days. But then for some reason, without a reboot, the links became corrupted:


> pwd

/Users/walker

> ls -al G2S

lrwxr-xr-x 1 walker staff 16 Mar 24 03:08 G2S -> X??G???Gҡ?G???G

> cd G2S

G2S: No such file or directory.


Same nonsensical definition for /home link. I repeat, this did not happen after a reboot. It first happened on /home. I thought that might have been related to a new OS handling of the "/home" label. So I deleted the /home link and did a clean reboot. The G2S link was created after that reboot, not before.


After the above two problems happened, I created a new symbolic link


/Users/walker/G2S2 -> /Volumes/L2A/G2S


I then did not use this new symbolic link in any of my processing scripts. A few weeks went by, then this link somehow got corrupted too:


lrwxr-xr-x 1 walker staff 16 Apr 2 17:22 G2S2 -> 꺄G???Gĺ?Gú?G


Does anyone here know how symbolic links are managed on a Mac (any process that controls their linking?), or have any information to help me figure out how to fix this? For example, could it be due to bad RAM? I have 32 GB.


Thank you,

Kris Walker

Mac Pro, Mac OS X (10.7.3)

Posted on Apr 20, 2012 3:44 PM

Reply
233 replies

Oct 18, 2012 9:20 AM in response to ktwalker69

Broken symbolic links have been plaguing me for the last week or so as well. I'm running Mountain Lion 10.8.2 without RAID or any other mounted disks (other than a time machine volume). In my case the problem shows up in the /usr/bin/gcc links:


1 root wheel 12 Oct 15 06:32 /usr/bin/gcc -> 341901130850

1 root wheel 21 Oct 15 06:32 /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/as ->


This is the third tiime these links have become corrupted; when I reinstall the XCode command line tools from ~/Library/Caches/com.apple.dt.Xcode/Downloads/Xcode.CLTools.10.8-4.5.6.dmg it fixes the problem for a few days, but then it returns.


This is on an iMac that has been up and running for ~5 years without problem and continues to run Photoshop, Pages, Aperture, iTunes, Filemaker, Acrobat, Mail, Calendar, ... without problems. Presumably these programs aren't relying on symbolic links.


I've run Disk Utility and verified the volume and it reports nothing wrong. It shows the S.M.A.R.T. status as verified (and the Raw Read Error Rate, Reallocated Sector Count, Seek Error Rate, Reallocation Event Count, Current Pending Sector Count, and UltraDMA CRC Error all show 0000000000000000).


I've checked all of the log files in /var/log and found no applicable error or warnings.


I've had failing computers and hard drives before and this does not _feel_ like a hardware issue. Since the problem appears to be occuring overnight, I'm going to reinstall the command line tools and setup a shell script to monitor the /usr/bin/gcc link and record the exact time it becomes corrupted (along with capturing output of ps -ef, on the hope that it's a software issue being caused by some periodic job).


marcos

Oct 18, 2012 9:24 AM in response to marcosw

marcosw wrote:


This is on an iMac that has been up and running for ~5 years without problem and continues to run Photoshop, Pages, Aperture, iTunes, Filemaker, Acrobat, Mail, Calendar, ... without problems. Presumably these programs aren't relying on symbolic links.



Not sure about the others, but Mail definitely uses symbolic links (at least in Mountain Lion). Since it is a sandboxed app, it has symlinks in its sandbox (/Users/yourlogin/Library/Containers/com.apple.mail/Data). I regularly see these get corrupted, which cause Mail to act really erratically (or sometimes not even start up at all).

Oct 18, 2012 2:23 PM in response to etresoft

Oh wow thanks for your deep insight!


If you had taken the time to actually read the bloody topic without assuming everyone else is being an idiot, you would have seen some interesting evidence that might contradict your judgement though. The problem seems to be persistent in certain configurations, surviving replacement of hard disks, or even the entire computer. Also, there is no evidence of anything BUT symlinks being corrupted. If files were randomly corrupted with the frequency seen in symlinks on affected configurations, we would have noticed a long time ago.

Oct 18, 2012 2:20 PM in response to etresoft

Déjà vu. You might as well say that files are just bits so if they're getting corrupted buy a new hard drive. The evidence implies that no one has any reports of SMART errors which is a fairly proven standard capable of detecting hardware errors on disks long before it actually causes a problem. All hard drives provide a very low level error correction that occurs at the firmware level. SMART detects and reports in these errors and its recommended that you replace a hard drive ASAP if it reports more than one such failure.


How do you reconcile the lack of SMART errors or the apparent fact that only symlinks are affected and not any/all other file types?

Oct 18, 2012 2:24 PM in response to etresoft

etresoft wrote:


A symbolic link is just a text file. If text files on your hard drive are spontaneously getting corrupted, you need a new hard drive.


Not exactly. Most modern UNIX implementations (of which I'm sure OS X is one of) store symlinks in the "inode" which is actually part of the filesystem's data structures.

Oct 18, 2012 2:25 PM in response to marcosw

My corrupted links were primarily evident in the /usr dir and its subdirs. I wonder if that is indicative or simply because there are more links in this area of the file system. There is another thread regarding users suddenly unable to run Mail.app which gas happened to me. I wonder also if dburr is on to something there regarding the use of symlinks in mail. Will rescan the drive tonight to see if more bad links pop up.


Jeff

Oct 18, 2012 2:40 PM in response to jas0nfl0yd

jas0nfl0yd wrote:


Looks like everyone beat me to telling this guy he's a moron 🙂


We've all tried replacing hard drives and ram, to no avail. I haven't seen this issue since upgrading to 10.8.2 however.


Unfortunately this issue has happened to me running 10.8.2. However, on my laptop (MacBook Pro 13" Unibody Mid-2009) this problem has (to my knowledge) not occurred at all. Lately I've been using my laptop a lot (partly because the symlink corruption has really made using my desktop irritating to use, partly because it's summer and I'm trying to reduce the number of heat-generating objects that are running in my office).


That got me to thinking, I wonder if this problem is being caused (or exacerbated) by hardware? Unfortunately there are a lot of hardware differences between my MBP and my desktop (Mac Pro Early 2008). An obvious difference (and a plausible source for this issue) is the SATA chipset that each machine uses. My Macbook Pro uses the NVidia MCP79 chipset whereas my Mac Pro uses the Intel 5400. I'd be curious to see what SATA chipsets other users who are experiencing this problem are running. (To find out, go to About This Mac, click More Info, click System Report, then click on the Serial-ATA section).

Oct 18, 2012 2:48 PM in response to dburr

dburr wrote:


Unfortunately this issue has happened to me running 10.8.2. However, on my laptop (MacBook Pro 13" Unibody Mid-2009) this problem has (to my knowledge) not occurred at all. Lately I've been using my laptop a lot (partly because the symlink corruption has really made using my desktop irritating to use, partly because it's summer and I'm trying to reduce the number of heat-generating objects that are running in my office).


That got me to thinking, I wonder if this problem is being caused (or exacerbated) by hardware? Unfortunately there are a lot of hardware differences between my MBP and my desktop (Mac Pro Early 2008). An obvious difference (and a plausible source for this issue) is the SATA chipset that each machine uses. My Macbook Pro uses the NVidia MCP79 chipset whereas my Mac Pro uses the Intel 5400. I'd be curious to see what SATA chipsets other users who are experiencing this problem are running. (To find out, go to About This Mac, click More Info, click System Report, then click on the Serial-ATA section).


I've only ever seen the issue on my Mac Pro (early 2008) but never on my early 2011 MBP.

Oct 18, 2012 3:23 PM in response to dburr

dburr wrote:


Not exactly. Most modern UNIX implementations (of which I'm sure OS X is one of) store symlinks in the "inode" which is actually part of the filesystem's data structures.

The details of how a symbolic link might (or might not) be implemented are based on the file system, not the operating system. In HFS+, a symbolic link is just a text file with special metadata.


Regardless, the full path the link points to must reside somewhere on the disk. The only way that data gets changed is if the hard drive physically fails or the data gets overwritten. Considering there are several million users of Mountain Lion not experiencing this problem, then the cause is either a failing hard disk or incompatible system-level software that the rest of us don't have.

Oct 18, 2012 4:03 PM in response to etresoft

etresoft wrote:


Regardless, the full path the link points to must reside somewhere on the disk. The only way that data gets changed is if the hard drive physically fails or the data gets overwritten. Considering there are several million users of Mountain Lion not experiencing this problem, then the cause is either a failing hard disk or incompatible system-level software that the rest of us don't have.


Malarky. It is a bug in the O.S. or HFS+ new to 10.7+. Facts supercede faith.

symbolic links get corrupted by system process?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.