The sips tool suddenly stopped working when called from Apache

Originator:dgatwood42
Number:rdar://17020383 Date Originated:23-May-2014
Status:Duplicate of 16880048 (Open) Resolved:
Product:OS X Product Version:10.9.2/13C1021
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
In 10.9.2 and later with the latest Camera RAW, sips no longer works when run from a CGI script.  As a result, you've completely broken my website.

Steps to Reproduce:
Use the sips command-line tool to process an image from a Canon 6D and convert it into a JPEG file:

/usr/bin/sips -s format jpeg --rotate 0 /path/to/filename.CR2 --out /path/to/filename.jpg

Now repeat that from a PHP script on your webserver:

<?php

	system("/usr/bin/sips -s format jpeg --rotate 0 /path/to/filename.CR2 --out /path/to/filename.jpg");

?>


Expected Results:
I expected sips to process the image, just as it has since I started using it back in OS X v10.5.


Actual Results:
CVMServer crashes, with the attached crash logs.  The sips process then returns:

/path/to/IMG_9049.CR2 Error: Failed to build program executable: table_calc setUpNoiseOpenCLEnvironment: compileOpenCLPrograms failed /path/to/IMG_9049.jpg

Version:
Occurs in both 10.9.2 and 10.9.3.  Did not occur when I processed content in March, so is either a 10.9.2 regression or a very recent Camera Raw regression.


Notes:

Configuration:
    Hardware Overview:

      Model Name: Mac mini
      Model Identifier: Macmini4,1
      Processor Name: Intel Core 2 Duo
      Processor Speed: 2.66 GHz
      Number of Processors: 1
      Total Number of Cores: 2
      L2 Cache: 3 MB
      Memory: 4 GB
      Bus Speed: 1.07 GHz
      Boot ROM Version: MM41.0042.B03
      SMC Version (system): 1.65f2
      Serial Number (system): C07DR0CUDD6K
      Hardware UUID: 2BD0BEEC-CA6D-53D1-A9B0-E165697B4F2F


Attachments:
'CVMServer_2014-05-23-095044_brmini.crash' was successfully uploaded.

Comments

After further investigation...

After a lot of digging, I realized that the crash long contained a very poorly worded hint about what was wrong. It turns out that sips can't run as the "nobody" user for some reason. Changing the web server user to _www (and fixing a lot of ownership issues as a result) avoids the crash.

By dgatwood42 at Oct. 22, 2014, 12:19 a.m. (reply...)

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!