Photoshop crash when saving to an AFP server
- Document Type:
A Photoshop crash occurs when saving file to an AFP server from a Mac OS X 10.4.6 client.
Steps to Reproduce:
Photoshop uses a Carbon call to PBDTGetCommentSync to get Finder comments. In Mac OS X 10.4.6 there appears to be a problem with the call to PBDTGetCommentSync writing a random number of zeros into the calling application’s memory space – which will then cause the calling application to crash in different places soon after the memory smash. MacOS versions 10.4.5 and earlier do not have the overwrite behavior, and thus will not crash. This will need be fixed in a future Mac OS X update.
These are the facts we were able to determine via packet traces and standard testing:
The AFP 3.1 specification supports comments of up to 199 characters. In addition AFP 2.2 in Mac OS 9 personal file sharing also allows comments of up to 199 characters. However servers running Mac OS X 10.3 and 10.4 do not permit comments over 128 characters (this may be true in earlier versions of Mac OS X, but we did not test them).
Since ExtremeZ-IP and most other AFP servers conform to the AFP spec they send the full 199 characters of a comment allowed. Upon receiving the comment from the AFP server, the Mac OS X 10.4.6 AFP client will pass the comment to the OS, and it in turn to Photoshop which will then crash when its memory is randomly overwritten.
This is not seen when saving to the XServe, because it never creates comments if they exceed 128 characters. Therefore the change to the AFP client and PBDTGetCommentSync in Mac OS X 10.4.6 would not affect Photoshop when saving to an Xserve.
Please note that a fix is now available from Apple. See below.
Although ExtremeZ-IP is following the AFP 3 specification, Group Logic has a workaround for the issue. In order to have the least impact on any other applications, we added an optional setting called ServerTruncatesOS9Comments in ExtremeZ-IP 4.2.2. When that setting is enabled, ExtremeZ-IP will truncate all Mac OS 9 comments to 128 characters. This will prevent the bug in Photoshop from being triggered until Apple fixes the issue.
To enable this option, create a DWORD type registry key named: ServerTruncatesOS9Comments at the following location (it is in Registry import format):
Windows Registry Editor Version 5.00
After adding the Registry key to make it take effect, use the Refresh Registry button in the ExtremeZ-IP Administrator to read in the new setting. If you want to later disable this feature you can do so by deleting the key or setting it’s value to 0. Detailed instructions for setting this and other registry based options can be found in the online help for ExtremeZ-IP.
If you are using ExtremeZ-IP in a cluster, the ServerTruncatesOS9Comments registry key needs to be manually added to each ExtremeZ-IP service. For example, if the cluster has 2 instances of EZIP running there will be 2 corresponding sections of the registry to add the ServerTruncatesOS9Comments key:
With the release of the Mac OS X 10.4.7 update, Apple has fixed the issue that causes this Photoshop crash. If it is possible to update all your Macs using Photoshop to 10.4.7 you will not need to add the ServerTruncatesOS9Comments registry key. If you have previously enabled this workaround on your server but have updated all your Macs to 10.4.7, you can disable the workaround by removing the registry key.