Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-11356

Race condition in template engine

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Major Major
    • 3.1.0-b1
    • None
    • None
    • None

      3.1 template engine, when it is able to write compiled template files, does the following:

      1. Opens source and compiled template files
      2. Performs compilation on streams
      3. Opens compiled file again and renders it

      Given concurrent access, one process may open the compiled file in step 3 when another process has the same file open in step 1. At that time the file is empty. There is locking to avoid corrupting files due to multiple concurrent writers, but readers do not lock and are able to obtain empty files as a result.

      Practical consequence of this is pages with parts of them missing.

      Reproduce code: https://github.com/p/test-repo/blob/master/phpbb/template-race/test.py (requires anonymous posting enabled on a forum and debug on for templates to be recompiled on each request)

            nickvergessen Joas Schilling
            Oleg Oleg [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: