Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-3251

Segmentation fault in ClassMetadataInfo.php

    Details

    • Type: Bug Bug
    • Status: Awaiting Feedback
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:

      Description

      I'm seeing a segfault when doing a EntityManager->merge(). Specifically, when on this line in ClassmetadataInfo.php. Details below.

      $value = $this->reflFields[$this->identifier[0]]->getValue($entity);
      

      /var/log/messages

      Aug 12 08:39:01 dev1 kernel: [62152.629221] php[3539]: segfault at f434172bd1 ip 00007ff432c3aae9 sp 00007fffa060b1b0 error 4 in php[7ff4329e7000+38c000]
      

      strace

      --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xc4f1053d11} ---
      +++ killed by SIGSEGV ++
      

      gdb backtrace:

      (gdb) bt
      #0  0x00007f8c8f5ceae9 in zend_std_read_property ()
      #1  0x00007f8c8f5b61d7 in zend_read_property ()
      #2  0x00007f8c8f4ab66e in zim_reflection_property_getValue ()
      #3  0x00007f8c8f59a4ab in dtrace_execute_internal ()
      #4  0x00007f8c8abb9a46 in xdebug_execute_internal () from /usr/lib64/php/modules/xdebug.so
      #5  0x00007f8c8f65a895 in zend_do_fcall_common_helper_SPEC ()
      #6  0x00007f8c8f5d45c8 in execute_ex ()
      #7  0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #8  0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #9  0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #10 0x00007f8c8f5d45c8 in execute_ex ()
      #11 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #12 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #13 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #14 0x00007f8c8f5d45c8 in execute_ex ()
      #15 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #16 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #17 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #18 0x00007f8c8f5d45c8 in execute_ex ()
      #19 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #20 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #21 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #22 0x00007f8c8f5d45c8 in execute_ex ()
      #23 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #24 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #25 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #26 0x00007f8c8f5d45c8 in execute_ex ()
      #27 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #28 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #29 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #30 0x00007f8c8f5d45c8 in execute_ex ()
      #31 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #32 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #33 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #34 0x00007f8c8f5d45c8 in execute_ex ()
      #35 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #36 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #37 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #38 0x00007f8c8f5d45c8 in execute_ex ()
      #39 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #40 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #41 0x00007f8c8f659852 in ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER ()
      #42 0x00007f8c8f5d45c8 in execute_ex ()
      #43 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #44 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #45 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #46 0x00007f8c8f5d45c8 in execute_ex ()
      #47 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #48 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #49 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #50 0x00007f8c8f5d45c8 in execute_ex ()
      #51 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #52 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      ---Type <return> to continue, or q <return> to quit---
      #53 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #54 0x00007f8c8f5d45c8 in execute_ex ()
      #55 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #56 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #57 0x00007f8c8f659852 in ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER ()
      #58 0x00007f8c8f5d45c8 in execute_ex ()
      #59 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #60 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #61 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #62 0x00007f8c8f5d45c8 in execute_ex ()
      #63 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #64 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #65 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #66 0x00007f8c8f5d45c8 in execute_ex ()
      #67 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #68 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #69 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #70 0x00007f8c8f5d45c8 in execute_ex ()
      #71 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #72 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #73 0x00007f8c8f659852 in ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER ()
      #74 0x00007f8c8f5d45c8 in execute_ex ()
      #75 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #76 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #77 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #78 0x00007f8c8f5d45c8 in execute_ex ()
      #79 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #80 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #81 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #82 0x00007f8c8f5d45c8 in execute_ex ()
      #83 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #84 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #85 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #86 0x00007f8c8f5d45c8 in execute_ex ()
      #87 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #88 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #89 0x00007f8c8f659852 in ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER ()
      #90 0x00007f8c8f5d45c8 in execute_ex ()
      #91 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #92 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #93 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #94 0x00007f8c8f5d45c8 in execute_ex ()
      #95 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #96 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #97 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #98 0x00007f8c8f5d45c8 in execute_ex ()
      #99 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #100 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #101 0x00007f8c8f65aee0 in zend_do_fcall_common_helper_SPEC ()
      #102 0x00007f8c8f5d45c8 in execute_ex ()
      #103 0x00007f8c8f59a3a9 in dtrace_execute_ex ()
      #104 0x00007f8c8abb8fcc in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so
      #105 0x00007f8c8f5abed0 in zend_execute_scripts ()
      ---Type <return> to continue, or q <return> to quit---
      #106 0x00007f8c8f54bc65 in php_execute_script ()
      #107 0x00007f8c8f65c8a8 in do_cli ()
      #108 0x00007f8c8f436420 in main ()
      
      

      xdebug trace:

         54.4457   16731856                                           -> Tekelec\DVAT\Service\TagService->createTag() /home/vagrant/dvat/library/Tekelec/DVAT/Service/TagService.php:51
         54.4457   16731856                                             -> Doctrine\ORM\EntityManager->merge() /home/vagrant/dvat/library/Tekelec/DVAT/Service/TagService.php:28
         54.4457   16731904                                               -> is_object() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:632
         54.4457   16731856                                               -> Doctrine\ORM\EntityManager->errorIfClosed() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:636
         54.4457   16731856                                               -> Doctrine\ORM\UnitOfWork->merge() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:638
         54.4458   16731992                                                 -> Doctrine\ORM\UnitOfWork->doMerge() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1701
         54.4458   16732136                                                   -> spl_object_hash() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1744
         54.4458   16732448                                                   -> get_class() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1752
         54.4458   16732496                                                   -> Doctrine\ORM\EntityManager->getClassMetadata() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1752
         54.4458   16732496                                                     -> Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:268
         54.4458   16732448                                                   -> Doctrine\ORM\UnitOfWork->getEntityState() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1760
         54.4458   16732496                                                     -> spl_object_hash() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1367
         54.4458   16732400                                                   -> Doctrine\ORM\Mapping\ClassMetadataInfo->getIdentifierValues() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1766
         54.4458   16732448                                                     -> ReflectionProperty->getValue() /home/vagrant/dvat/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:672
      

      The reproducing steps are complicated and require propriety code, but this happens most of the time (80+ percent).

      Here is the php bug for this: https://bugs.php.net/bug.php?id=67828

        Activity

        Hide
        Marco Pivetta added a comment -

        Did you try clearing your opcode caches? Is this reproducible in insulated environment?

        Show
        Marco Pivetta added a comment - Did you try clearing your opcode caches? Is this reproducible in insulated environment?
        Hide
        Kshitij Parajuli added a comment - - edited

        Yes, I tried clearing the opcode caches (and clearing proxies and restarting the server). This was also reproducible in multiple servers (one production and one development).

        It is not yet reproducible in isolated environment, but I am looking at it. Will update the ticket if I find easy reproducing steps.

        Show
        Kshitij Parajuli added a comment - - edited Yes, I tried clearing the opcode caches (and clearing proxies and restarting the server). This was also reproducible in multiple servers (one production and one development). It is not yet reproducible in isolated environment, but I am looking at it. Will update the ticket if I find easy reproducing steps.
        Hide
        Benjamin Eberlei added a comment -

        Please try without xdebug, this is enabled according to stacktrace.

        Show
        Benjamin Eberlei added a comment - Please try without xdebug, this is enabled according to stacktrace.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Kshitij Parajuli
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: