m6w6 / ext-pq

PostgreSQL client library (libpq) binding
BSD 2-Clause "Simplified" License
39 stars 7 forks source link

raphf - is thread not safe #25

Closed uasan closed 7 years ago

uasan commented 7 years ago

Hello.

PHP 7.1.5 (cli) (built: May  9 2017 17:55:16) ( ZTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.5, Copyright (c) 1999-2017, by Zend Technologies

libuv Support => enabled
Version => 0.2.1
libuv Version => 1.10
<?php

$loop  = uv_default_loop();

$thread = function()
{
    echo "THREAD-CALL\n";
};

$after = function()
{
    echo "THREAD-CALL-AFTER\n";
};

uv_queue_work($loop, $thread, $after);
uv_queue_work($loop, $thread, $after);

$timer = uv_timer_init($loop);

uv_timer_start($timer, 1000, 1000, function()
{
    static $i = 0;

    echo "TIMER: $i\n";

    $i++;
});

uv_run($loop);
*** Error in `zts-php': double free or corruption (fasttop): 0x000055ae15c1b1f0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x791fb)[0x7f21dc3b81fb]
/lib64/libc.so.6(+0x8288a)[0x7f21dc3c188a]
/lib64/libc.so.6(cfree+0x4c)[0x7f21dc3c52bc]
zts-php(zend_hash_destroy+0x146)[0x55ae146ab706]
zts-php(tsrm_free_interpreter_context+0x4a)[0x55ae146218ea]
/usr/lib64/php-zts/modules/uv.so(+0x1fbb2)[0x7f21d0d23bb2]
/usr/lib64/php-zts/modules/uv.so(+0x1fc60)[0x7f21d0d23c60]
/lib64/libuv.so.1(+0x96d4)[0x7f21d0ae76d4]
/lib64/libpthread.so.0(+0x76ca)[0x7f21ddcd56ca]
/lib64/libc.so.6(clone+0x5f)[0x7f21dc446f7f]
======= Memory map: ========
....
Aborted (core dumped)

If delete raphf.so in php.ini then everything works well.

How to compile the pq without raff? We use pq in php-cli as daemon process, persistent connection do not need it.

Thank.

DaveRandom commented 7 years ago

tag @bwoebi, any chance you could take a look at this? ext/raphf is used by pecl/http and pecl/pq for resource persistence, since this is not (afaik) a problem generally, I'm guessing this is something to do with the way it is interacting with pecl/uv. I'm sure @m6w6 can give you more info on the rationale behind, and inner workings of raphf if required.

@uasan I'm confident that the first thing Bob will ask you for is a core dump, so it would be a good idea to make one available online somewhere and link it here if you can.

bwoebi commented 7 years ago

At a quick glance into the raphf src, I see no true globals being used, making it thread safe.

I don't think raphf itself is causing that crash, but rather something else … I'm wondering what USE_ZEND_ALLOC=0 valgrind php script.php has to say...

uasan commented 7 years ago

I don't think raphf itself is causing that crash, but rather something else … I'm wondering what USE_ZEND_ALLOC=0 valgrind php script.php has to say...

Run USE_ZEND_ALLOC=0 valgrind zts-php -n -c /var/www/Core/core.dev/Etc/php-zts.ini /var/www/Core/core.dev/Bin/uv_queue_work.php &>/var/www/valgrind.txt

php-zts.ini:

[Extension]
extension = json.so
extension = raphf.so
extension = pq.so
extension = uv.so

uv_queue_work.php:


<?php
$loop  = uv_default_loop();

$thread = function()
{
    echo "THREAD-CALL\n";
};

$after = function()
{
    echo "THREAD-CALL-AFTER\n";
};

uv_queue_work($loop, $thread, $after);
uv_queue_work($loop, $thread, $after);

$timer = uv_timer_init($loop);

uv_timer_start($timer, 1000, 1000, function() use($timer)
{
    uv_close($timer);

    echo "STOP\n";
});

uv_run($loop);

Out:

==15439== Memcheck, a memory error detector
==15439== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==15439== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==15439== Command: zts-php -n -c /var/www/Core/core.dev/Etc/php-zts.ini /var/www/Core/core.dev/Bin/uv_queue_work.php
==15439== 
THREAD-CALL
THREAD-CALL
==15439== Thread 4:
==15439== Invalid read of size 4
==15439==    at 0x38F657: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FC4C5: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid read of size 4
==15439==    at 0x38F676: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FC4C5: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b03a8 is 24 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid write of size 4
==15439==    at 0x38F67E: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FC4C5: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid write of size 4
==15439==    at 0x38F7BA: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FC4C5: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid read of size 4
==15439==    at 0x38E617: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x101FC4CD: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b03a8 is 24 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid read of size 4
==15439==    at 0x38E698: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x101FC4CD: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid read of size 4
==15439==    at 0x101FC490: php_resource_factory_dtor (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x101FC4D6: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b03f8 is 104 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid free() / delete / delete[] / realloc()
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0390 is 0 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x11F1AC5F: ??? (in /usr/lib64/php-zts/modules/uv.so)
==15439==    by 0x121306D3: ??? (in /usr/lib64/libuv.so.1.0.0)
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
THREAD-CALL-AFTER
THREAD-CALL-AFTER
STOP
==15439== Thread 1:
==15439== Invalid read of size 4
==15439==    at 0x38F657: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FD432: php_persistent_handle_cleanup (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10413AB1: zm_shutdown_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409BC6: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x3832D7: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid read of size 4
==15439==    at 0x38F676: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FD432: php_persistent_handle_cleanup (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10413AB1: zm_shutdown_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409BC6: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x3832D7: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b03a8 is 24 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid write of size 4
==15439==    at 0x38F67E: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FD432: php_persistent_handle_cleanup (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10413AB1: zm_shutdown_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409BC6: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x3832D7: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid write of size 4
==15439==    at 0x38F7BA: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FD432: php_persistent_handle_cleanup (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10413AB1: zm_shutdown_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409BC6: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x3832D7: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: zm_startup_pqconn (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x10409C3E: ??? (in /usr/lib64/php-zts/modules/pq.so)
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid read of size 4
==15439==    at 0x38F657: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FC4C5: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x30538A: ts_free_id (in /usr/bin/zts-php)
==15439==    by 0x38334C: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: ???
==15439==    by 0x10409C3E: ???
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid read of size 4
==15439==    at 0x38F676: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FC4C5: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x30538A: ts_free_id (in /usr/bin/zts-php)
==15439==    by 0x38334C: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b03a8 is 24 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: ???
==15439==    by 0x10409C3E: ???
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid write of size 4
==15439==    at 0x38F67E: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FC4C5: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x30538A: ts_free_id (in /usr/bin/zts-php)
==15439==    by 0x38334C: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: ???
==15439==    by 0x10409C3E: ???
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid write of size 4
==15439==    at 0x38F7BA: zend_hash_apply_with_argument (in /usr/bin/zts-php)
==15439==    by 0x101FC4C5: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x30538A: ts_free_id (in /usr/bin/zts-php)
==15439==    by 0x38334C: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: ???
==15439==    by 0x10409C3E: ???
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid read of size 4
==15439==    at 0x38E617: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x101FC4CD: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x30538A: ts_free_id (in /usr/bin/zts-php)
==15439==    by 0x38334C: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b03a8 is 24 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: ???
==15439==    by 0x10409C3E: ???
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid read of size 4
==15439==    at 0x38E698: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x101FC4CD: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x30538A: ts_free_id (in /usr/bin/zts-php)
==15439==    by 0x38334C: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0398 is 8 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: ???
==15439==    by 0x10409C3E: ???
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid read of size 4
==15439==    at 0x101FC490: php_resource_factory_dtor (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x101FC4D6: ??? (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x30538A: ts_free_id (in /usr/bin/zts-php)
==15439==    by 0x38334C: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b03f8 is 104 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: ???
==15439==    by 0x10409C3E: ???
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== Invalid free() / delete / delete[] / realloc()
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x30538A: ts_free_id (in /usr/bin/zts-php)
==15439==    by 0x38334C: ??? (in /usr/bin/zts-php)
==15439==    by 0x37ADFB: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F250: zend_hash_graceful_reverse_destroy (in /usr/bin/zts-php)
==15439==    by 0x37BD49: ??? (in /usr/bin/zts-php)
==15439==    by 0x308742: php_module_shutdown (in /usr/bin/zts-php)
==15439==    by 0x1D67DF: ??? (in /usr/bin/zts-php)
==15439==    by 0x825D400: (below main) (in /usr/lib64/libc-2.24.so)
==15439==  Address 0x92b0390 is 0 bytes inside a block of size 112 free'd
==15439==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==15439==    by 0x38E755: zend_hash_destroy (in /usr/bin/zts-php)
==15439==    by 0x3048F9: tsrm_free_interpreter_context (in /usr/bin/zts-php)
==15439==    by 0x11F1ABB1: ???
==15439==    by 0x11F1AC5F: ???
==15439==    by 0x121306D3: ???
==15439==    by 0x6A5D739: start_thread (in /usr/lib64/libpthread-2.24.so)
==15439==    by 0x8344E7E: clone (in /usr/lib64/libc-2.24.so)
==15439==  Block was alloc'd at
==15439==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==15439==    by 0x34ABC8: __zend_malloc (in /usr/bin/zts-php)
==15439==    by 0x101FCE03: php_persistent_handle_provide (in /usr/lib64/php-zts/modules/raphf.so)
==15439==    by 0x10414BCF: ???
==15439==    by 0x10409C3E: ???
==15439==    by 0x381229: zend_startup_module_ex (in /usr/bin/zts-php)
==15439==    by 0x38130B: ??? (in /usr/bin/zts-php)
==15439==    by 0x38F409: zend_hash_apply (in /usr/bin/zts-php)
==15439==    by 0x3815F9: zend_startup_modules (in /usr/bin/zts-php)
==15439==    by 0x307F4A: php_module_startup (in /usr/bin/zts-php)
==15439==    by 0x43077C: ??? (in /usr/bin/zts-php)
==15439==    by 0x1D6698: ??? (in /usr/bin/zts-php)
==15439== 
==15439== 
==15439== HEAP SUMMARY:
==15439==     in use at exit: 1,574 bytes in 32 blocks
==15439==   total heap usage: 27,215 allocs, 27,185 frees, 4,594,874 bytes allocated
==15439== 
==15439== LEAK SUMMARY:
==15439==    definitely lost: 0 bytes in 0 blocks
==15439==    indirectly lost: 0 bytes in 0 blocks
==15439==      possibly lost: 0 bytes in 0 blocks
==15439==    still reachable: 1,574 bytes in 32 blocks
==15439==         suppressed: 0 bytes in 0 blocks
==15439== Rerun with --leak-check=full to see details of leaked memory
==15439== 
==15439== For counts of detected and suppressed errors, rerun with: -v
==15439== ERROR SUMMARY: 22 errors from 20 contexts (suppressed: 0 from 0)
m6w6 commented 7 years ago

Ugh, does uv_queue_work really just work with PHP? Isn't it creating threads by its own?

bwoebi commented 7 years ago

It is… sigh.

https://github.com/bwoebi/php-uv/issues/46#issuecomment-307522312 … … …

m6w6 commented 7 years ago

Thanks, closing then.