Doctrine 1
  1. Doctrine 1
  2. DC-386

Doctrine_Hydrator_ArrayDriver may segfault Php when loaded by Zend Framework Autoloader

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1
    • Fix Version/s: None
    • Component/s: Query
    • Labels:
      None
    • Environment:
      Ubuntu 9.04 fully updated with Apache 2.2.11, Php 5.2.6, Zend Framework 1.9.6, Doctrine 1.2.1

      Description

      Apache and Php segfault with no error information in the logs and a white screen of death when I use Doctrine 1.2.1 in a Zend Framework controller.

      I've traced the problem to line 126 of Zend/Loader/Autoloader.php which only seemed to occur when it autoloaded Doctrine_Hydrator_ArrayDriver during a call to save() in the controller.

      I debugged with xdebug and have attached a simple test controller with no other code. The ZF page works fine when all Doctrine is commented out and a Doctrine test page with the same code but outside of ZF worked fine via Apache as did a CLI script.

      Workaround is to not push Doctrine to Zend Loader in the bootstrap.

      Here is the debug output just before a segfault, the stack and the variable values:

      Remote Launch (stepping)
      Library/Zend/Loader/Autoloader.php.Zend_Loader_Autoloader::autoload : lineno 126
      Library/Zend/Loader/Autoloader.php.is_subclass_of : lineno 0
      Library/Doctrine/Query.php.Doctrine_Query->processPendingFields : lineno 477
      Library/Doctrine/Query.php.Doctrine_Query->buildSqlQuery : lineno 1213
      Library/Doctrine/Query.php.Doctrine_Query->getSqlQuery : lineno 1122
      Library/Doctrine/Query/Abstract.php.Doctrine_Query_Abstract->_getDqlCallbackComponents : lineno 1137
      Library/Doctrine/Query/Abstract.php.Doctrine_Query_Abstract->_preQuery : lineno 1106
      Library/Doctrine/Query/Abstract.php.Doctrine_Query_Abstract->execute : lineno 1001
      Library/Doctrine/Template/Listener/Sluggable.php.Doctrine_Template_Listener_Sluggable->getUniqueSlug : lineno 207
      Library/Doctrine/Template/Listener/Sluggable.php.Doctrine_Template_Listener_Sluggable->buildSlugFromFields : lineno 120
      Library/Doctrine/Template/Listener/Sluggable.php.Doctrine_Template_Listener_Sluggable->preInsert : lineno 65
      Library/Doctrine/Record/Listener/Chain.php.Doctrine_Record_Listener_Chain->preInsert : lineno 342
      Library/Doctrine/Record.php.Doctrine_Record->invokeSaveHooks : lineno 355
      Library/Doctrine/Connection/UnitOfWork.php.Doctrine_Connection_UnitOfWork->insert : lineno 551
      Library/Doctrine/Connection/UnitOfWork.php.Doctrine_Connection_UnitOfWork->saveGraph : lineno 81
      Library/Doctrine/Record.php.Doctrine_Record->save : lineno 1691
      Application/controllers/TestingController.php.TestingController->indexAction : lineno 20
      Library/Zend/Controller/Action.php.Zend_Controller_Action->dispatch : lineno 513
      Library/Zend/Controller/Dispatcher/Standard.php.Zend_Controller_Dispatcher_Standard->dispatch : lineno 289
      Library/Zend/Controller/Front.php.Zend_Controller_Front->dispatch : lineno 946
      Library/Zend/Application/Bootstrap/Bootstrap.php.Zend_Application_Bootstrap_Bootstrap->run : lineno 77
      Application/Bootstrap.php.Bootstrap->run : lineno 52
      Library/Zend/Application.php.Zend_Application->run : lineno 346
      Public/index.php.

      {main}

      : lineno 26

      =====-=

      $class Doctrine_Hydrator_ArrayDriver
      $object Zend_Loader_Autoloader
      _autoloaders Array [1]
      0 Array [2]
      0 Doctrine
      1 autoload
      _defaultAutoloader Array [2]
      0 Zend_Loader
      1 loadClass
      _fallbackAutoloader false
      _internalAutoloader Array [2]
      0 Zend_Loader_Autoloader
      1 _autoload
      _namespaces Array [5]
      Zend_ true
      ZendX_ true
      Lisantra_ true
      Persistence_ true
      Doctrine_ true
      _namespaceAutoloaders Array [1]
      Array [1]
      0 Array [2]
      0 Doctrine
      1 autoload
      _suppressNotFoundWarnings false
      $self Zend_Loader_Autoloader
      _autoloaders Array [1]
      0 Array [2]
      0 Doctrine
      1 autoload
      _defaultAutoloader Array [2]
      0 Zend_Loader
      1 loadClass
      _fallbackAutoloader false
      _internalAutoloader Array [2]
      0 Zend_Loader_Autoloader
      1 _autoload
      _namespaces Array [5]
      Zend_ true
      ZendX_ true
      Lisantra_ true
      Persistence_ true
      Doctrine_ true
      _namespaceAutoloaders Array [1]
      Array [1]
      0 Array [2]
      0 Doctrine
      1 autoload
      _suppressNotFoundWarnings false
      $method _autoload
      $autoloader Array [0]

      1. doctrine_trace.txt.xt
        1.64 MB
        Michael Gatto
      2. Doctrine.php
        6 kB
        Michael Gatto
      3. TestingController.php
        0.8 kB
        Michael Gatto

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Michael Gatto
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: