Details
-
Type: Bug
-
Status: In Progress
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 4.6.28, 4.7.20
-
Fix Version/s: Unscheduled
-
Component/s: None
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Sprint:4.7.11 Drupal, 4.7.10 Developery stuff
-
Funding Source:Contributed Code
Description
CiviCRM has patched Smarty.class.php with a validateCompilePath() method.
This method is not safe for concurrent processes which may be using the same compiled templates, because it actually truncates the compiled template which it is validating. If another process is including the template which is being validated/truncated, it'll fail with a cryptic "bus error".
My initial hack was to avoid the bus error on concurrent processes by opening the file for appending, which avoids truncating the file in place.
The PR has now been updated to remove the broken validateCompilePath() method altogether. Instead, a sha256 hash is generated and used as the filename. This resolves additional race conditions: 1) creating an empty file that is expected to be a compiled template and 2) unlinking a compiled template that was expected to be there.
Attachments
Issue Links
- supplements
-
CRM-11189 When CiviMail renders smarty templates for mailing, it saves them to disk
- Won't Do
- links to