Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-1504

Segfault connecting to authenticated RS after non-auth connections

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.6.12
    • Fix Version/s: 1.6.13
    • Component/s: pecl-mongo
    • Labels:
      None
    • # Replies:
      5
    • Last comment by Customer:
      true

      Description

      Hello,
      we are trying to add authentication to mongo server.
      We have several environments so we wanted to add authentication to these env by phases with compatible logging. (try to login with credentials otherwise without)
      We were getting random segfaults and minimal code is

       
      for ($i = 1; $i < 3; $i++) {
          try {
              $m = new MongoClient("mongodb://some:password@mongodb01:27017,mongodb02:27017,mongodb03:27017/?replicaSet=mongodb");
          } catch (\MongoException $e) {
              $m = new MongoClient("mongodb://mongodb01:27017,mongodb02:27017,mongodb03:27017/?replicaSet=mongodb");
          }
          var_dump($m);
      }
      

      output:

      $ php mongo.php
      /home/vagrant/mongo.php:9:
      class MongoClient#1 (4) {
        public $connected =>
        bool(true)
        public $status =>
        NULL
        protected $server =>
        NULL
        protected $persistent =>
        NULL
      }
      Segmentation fault
      

      gdb output in attachment

       pecl info mongo
      About pecl.php.net/mongo-1.6.12
      ===============================
      Release Type          PECL-style PHP extension (source code)
      Name                  mongo
      Channel               pecl.php.net
      Summary               MongoDB database driver
      Description           This package provides an interface for
                            communicating with the MongoDB database in PHP.
      Maintainers           Derick Rethans <derick@php.net> (lead)
                            Hannes Magnusson <bjori@php.net> (lead)
                            Jeremy Mikola <jmikola@php.net> (lead)
      Release Date          2015-11-25 17:29:16
      Release Version       1.6.12 (stable)
      API Version           1.6.12 (stable)
      License               Apache License
                            (http://www.apache.org/licenses/LICENSE-2.0)
      Release Notes         ** Bug
                                * [PHP-1494] - We don't allocate enough
                            space for the hash buffer
       
                            ** Task
                                * [PHP-1474] - Declare no support for PHP 7
      Required Dependencies PHP version 5.3.0-5.99.99
                            PEAR installer version 1.4.3 or newer
      package.xml version   2.0
      Last Modified         2016-02-04 14:25
      

        Attachments

          Activity

            People

            Assignee:
            jmikola Jeremy Mikola
            Reporter:
            kuba.simon@gmail.com Jakub Simon
            Participants:
            Last commenter:
            Rathi Gnanasekaran
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              4 years, 20 weeks, 4 days ago
              Date of 1st Reply: