Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57127

PHP CSS parser runs out of memory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      Hide
      1. Use PHP 5.6
      2. Confirm that your memory_limit is set to 128MB
      3. Disable development mode
      4. Switch to Clean
      5. Switch to an RTL language
      6. Purge all caches
      7. Open your network tab
      8. Go to the home page
      9. Confirm that the styles come up
      10. Confirm that the request to styles.php/.../all-rtl did not fail
      Show
      Use PHP 5.6 Confirm that your memory_limit is set to 128MB Disable development mode Switch to Clean Switch to an RTL language Purge all caches Open your network tab Go to the home page Confirm that the styles come up Confirm that the request to styles.php/.../all-rtl did not fail
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57127-master

      Description

      When trying to change the language to a RTL language the PHP CSS parser runs out of memory. It tries to exceed the standard allocation size of 128mb as defined in the php.ini file which causes the server to return a 500 error.

      To replicate:

      • Make sure your php.ini file has the memory limit set to 128mb
      • Use clean theme
      • Install an RTL language pack
      • Make sure your cache is cleared so that parser needs to rebuild it
      • Change the language to the new RTL language

      To work around:
      Increase the memory limit in php.ini from 128mb to something larger

      The error in my apache logs is:
      [Thu Nov 24 02:07:31.101845 2016] [:error] [pid 11843] [client 10.0.2.2:64808] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/vagrant/moodles/stable_master/moodle/lib/php-css-parser/Parser.php on line 701

      The error in the browser console is:
      http://<moodle_url>/stable_master/theme/styles.php/clean/1479953989/all-rtl

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16