mongo-php-driver: Upgrading 1.4.4 to 1.5.0 cause apache segfault (docker php7.1-apache)

Description

After upgrading mongodb driver from 1.4.4 to 1.5.0 cause segmentation fault on apache docker (1% of requests)

[core:notice] [pid 1] AH00052: child pid 20 exit signal Segmentation fault (11)

The downgrade to 1.4.4 resolve the issue.

Environment

Dockerfile

FROM php:7.1-apache
RUN apt-get update \
    && apt-get install libssl-dev curl git zlib1g-dev unzip libpng-dev libjpeg-dev libpq-dev libicu-dev libmemcached-dev libmagickwand-dev netcat  -y
RUN pecl install mongodb \
    && pecl install redis \
    && pecl install apcu \
    && pecl install memcached \
    && pecl install imagick \
    && docker-php-ext-enable mongodb redis apcu memcached imagick

RUN docker-php-ext-install gd mbstring opcache pdo pdo_mysql zip bcmath intl`
MongoDB extension version | 1.5.0
-- | --
MongoDB extension stability | stable
libbson bundled version | 1.11.0
libmongoc bundled version | 1.11.0
libmongoc SSL | enabled
libmongoc SSL library | OpenSSL
libmongoc crypto | enabled
libmongoc crypto library | libcrypto
libmongoc crypto system profile | disabled
libmongoc SASL | enabled
libmongoc ICU | enabled
libmongoc compression | enabled
libmongoc compression snappy | disabled
libmongoc compression zlib | enabled

Test Script

Sorry but we’re currently unable to retrieve backtrace or more logs… We will continue to investigate, and we will post more information later.

DEBUG OR BACKTRACE

Debug Log

[core:notice] [pid 1] AH00052: child pid 20 exit signal Segmentation fault (11) 

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15 (7 by maintainers)

Most upvoted comments

How much longer do we need to wait for 1.5.3?

We’re expecting a 1.5.3 release on Wednesday, September 19.

1.5.3 has been released and includes the fix for this issue.

10 days after what I would call a major bug we have no new release? How much longer do we need to wait for 1.5.3?

As it’s only supported with the MongoDB 4.0 according to MongoDB Compatibility matrix: https://docs.mongodb.com/ecosystem/drivers/php/#compatibility

Yes, we can take the fix and patch it and etc, but it’s not really as nice as just changing the version number, using patched version requires extra work.

So please, release 1.5.3 or at least some 1.5.2.1 or something that has this bug fixed.

This has now been fixed through #924

@taisph — I’ve been able to reproduce this with the example data. It doesn’t crash on its own, but valgrind does give the warning, which I guess in some cases leads to a crash. I’ve created a Jira ticket @ https://jira.mongodb.org/browse/PHPC-1266 to track the work on this.

The full (smallest) case I could manage was:

<?php
$a = <<<ENDJSON
{
    "value" : {     
        "payload" : {
            "PayloadMasterDataMeteringPointPartyEvent" : {
                "MeteringPointPartyDetailMeteringPointPartyCharacteristic" : {
                    "AdministrativePartyMPAdministrativeParty" : [
                        {
                            "AdministrativePartyAddressLocationAddress" : {
                                "StreetCode" : {
                                }
                            }
                        }
                    ]
                }
            }
        }
    }
}   
ENDJSON;

$bson = MongoDB\BSON\fromJSON($a);
var_dump(MongoDB\BSON\toPHP($bson));

And run with: USE_ZEND_ALLOC=0 valgrind php test.php