smarty-php / smarty-php/smarty

Unable to rename "Access denied"

Open
#705 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
2.3k
Forks
709
PR merge metrics
No merged PRs in 30d

Description

On Windows with Apache multi thread with PHP 8.0.13 we got error:

2022-01-08 10:19:24.961970 PHP Fatal error: Uncaught ErrorException: rename(.....,....): Access is denied (code: 5) in D:\...\Smarty\libs\sysplugins\smarty_internal_runtime_writefile.php:75 in D:\...\Smarty\libs\sysplugins\smarty_internal_runtime_writefile.php:75

The problem is that two processes are trying to write to the same file at the same time. The file is already locked by one process and the other could not write to the file.
ForceCompile ha no matter on result.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with libs/sysplugins/smarty_internal_runtime_writefile.php at line 75 and review how concurrent processes rename the same compiled file on Windows. Reproduce the Apache multi-threaded PHP 8.0.13 scenario if possible; the issue does not name a test or define the expected handling beyond avoiding the reported Access denied failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.