Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-851

Segfault when ReadPreference tag sets are an immutable array

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.2
    • Affects Version/s: 1.2.0, 1.2.1
    • Component/s: None
    • None
    • Environment:

      Starting with 1.2.0 there is a segmentation fault in php-fpm when ssl is activated. The first request works, all subsequent requests fail.

      Core dump

      Core was generated by `php-fpm: pool community                                                      '.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00007fe02785a23d in object_to_bson (object=object@entry=0x7fdfd0f17318, flags=flags@entry=PHONGO_BSON_NONE, key=key@entry=0x7fdfbeed5c38 "0", key_len=key_len@entry=1, bson=bson@entry=0x7fe03c4e5c60)
          at /tmp/pear/temp/mongodb/src/bson.c:853
      853	/tmp/pear/temp/mongodb/src/bson.c: No such file or directory.
      (gdb) bt
      #0  0x00007fe02785a23d in object_to_bson (object=object@entry=0x7fdfd0f17318, flags=flags@entry=PHONGO_BSON_NONE, key=key@entry=0x7fdfbeed5c38 "0", key_len=key_len@entry=1, bson=bson@entry=0x7fe03c4e5c60)
          at /tmp/pear/temp/mongodb/src/bson.c:853
      #1  0x00007fe02785a8dd in phongo_bson_append (bson=bson@entry=0x7fe03c4e5c60, flags=flags@entry=PHONGO_BSON_NONE, key=key@entry=0x7fdfbeed5c38 "0", key_len=1, entry=entry@entry=0x7fdfd0f17318)
          at /tmp/pear/temp/mongodb/src/bson.c:1085
      #2  0x00007fe027859d11 in phongo_zval_to_bson (data=0x7fe036816c20, flags=flags@entry=PHONGO_BSON_NONE, bson=bson@entry=0x7fe03c4e5c60, bson_out=bson_out@entry=0x0)
          at /tmp/pear/temp/mongodb/src/bson.c:1294
      #3  0x00007fe02786719e in zim_ReadPreference___construct (execute_data=0x7fe036816bb0, return_value=<optimized out>) at /tmp/pear/temp/mongodb/src/MongoDB/ReadPreference.c:90
      #4  0x00007fe03946c2e4 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:844
      #5  0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #6  0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #7  0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #8  0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #9  0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #10 0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #11 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #12 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #13 0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #14 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #15 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #16 0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #17 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #18 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #19 0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #20 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #21 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #22 0x00007fe0393e42ca in zend_call_function (fci=fci@entry=0x7fffbee70bc0, fci_cache=fci_cache@entry=0x7fffbee70b90) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_execute_API.c:858
      #23 0x00007fe0392ee73e in zim_reflection_method_invokeArgs (execute_data=<optimized out>, return_value=0x7fe036816670) at /build/php7.0-nK_jRR/php7.0-7.0.13/ext/reflection/php_reflection.c:3346
      #24 0x00007fe03946c2e4 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:844
      #25 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #26 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #27 0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #28 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #29 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #30 0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #31 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #32 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #33 0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #34 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #35 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #36 0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #37 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #38 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #39 0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #40 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #41 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #42 0x00007fe03946bfb0 in ZEND_DO_FCALL_SPEC_HANDLER () at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:800
      #43 0x00007fe03942e59b in execute_ex (ex=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:414
      #44 0x00007fe0393e2a29 in dtrace_execute_ex (execute_data=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_dtrace.c:83
      #45 0x00007fe039477e0f in zend_execute (op_array=op_array@entry=0x7fe036879000, return_value=return_value@entry=0x0) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend_vm_execute.h:458
      #46 0x00007fe0393f1fd4 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /build/php7.0-nK_jRR/php7.0-7.0.13/Zend/zend.c:1427
      #47 0x00007fe0393958c8 in php_execute_script (primary_file=0x7fffbee73640) at /build/php7.0-nK_jRR/php7.0-7.0.13/main/main.c:2494
      #48 0x00007fe039284c1c in main (argc=<optimized out>, argv=<optimized out>) at /build/php7.0-nK_jRR/php7.0-7.0.13/sapi/fpm/fpm/fpm_main.c:1968
      

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            bashofmann Bastian Hofmann
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: