Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-11038

eZP might go into an infinite loop if MySQL closes it connections causing apache to segfault

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 3.8.8, 3.9.2
    • Fix Version/s: 3.10.0alpha1, 3.8.9, 3.9.3, 4.3.0beta1
    • Component/s: Database related
    • Labels:
      None
    • Environment:

      Operating System: Linux
      PHP Version: (please be specific, like '4.4.3' or '5.1.5'): 4.4.4
      Database and version: MySQL 4.1.14

      Description

      For reasons still unknown to me MySQL keeps closing connection every now and then.

      Query error: MySQL server has gone away. Query: UPDATE ezsession
                          SET expiration_time='<timestamp>', data=<data>'
                          WHERE session_key='<key>'
      

      These messages ends up in /var/log/error.log instead of /ezp-root/var/log/error.log. To see these messages do the following:

      $ touch /var/log/error.log
      $ chown <apache user> /var/log/error.log
      

      In lib/ezdb/classes/ezmysqldb.php, if no result from the query is returned query() assumes something went wrong and calls $this->unlock(); which again calls $this->query();. If something wrongs happens while executing $this->unlock() it will be called again! This infinite loop will eventually cause Apache to crash with a "Segmentation Fault".

      There are numerous reasons why MySQL might close the connection, some which might be eZP faults:
      "You tried to run a query after closing the connection to the server. This indicates a logic error in the application that should be corrected."

      However most of them is related to hosting environment and/or MySQL: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html

        Attachments

          Activity

            People

            • Assignee:
              gl (inactive) Gunnstein Lye
              Reporter:
              oh Ole Morten Halvorsen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: