php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80079 dl("ffi") report "malloc_consolidate(): invalid chunk size" when enable zts
Submitted: 2020-09-08 12:00 UTC Modified: -
From: hark110 at 163 dot com Assigned:
Status: Open Package: ffi (PECL)
PHP Version: master-Git-2020-09-08 (Git) OS: Fedora 32
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-09-08 12:00 UTC] hark110 at 163 dot com
Description:
------------
When php enable zts and debug,
then use dl() function load ffi extension in php code
when after ffi module shutdown, will report "malloc_consolidate(): invalid chunk size"
This bug only occurs when the dl() loads FFI. 
1.does not occurs when php non-zts
2.does not occurs when php enable zts and  static COMPILE ,
3.does not occur when set "extension=" configuration option
GDB message:
Stack trace of thread 443691:
 #0  0x00007fc2e8c7d9e5 __GI_raise (libc.so.6 + 0x3c9e5)
                #1  0x00007fc2e8c66895 __GI_abort (libc.so.6 + 0x25895)
                #2  0x00007fc2e8cc1857 __libc_message (libc.so.6 + 0x80857)
                #3  0x00007fc2e8cc8d7c malloc_printerr (libc.so.6 + 0x87d7c)
                #4  0x00007fc2e8cc9c48 malloc_consolidate (libc.so.6 + 0x88c48)
                #5  0x00007fc2e8cca3f0 _int_free (libc.so.6 + 0x893f0)
                #6  0x0000000000927ea5 n/a (./sapi/cli/php + 0x527ea5)
                #7  0x000000000090ed98 n/a (./sapi/cli/php + 0x50ed98)
                #8  0x0000000000865217 n/a (./sapi/cli/php + 0x465217)
                #9  0x000000000090fd50 n/a (./sapi/cli/php + 0x50fd50)
                #10 0x000000000086ae0c n/a (./sapi/cli/php + 0x46ae0c)
                #11 0x00000000009ffbf5 n/a (./sapi/cli/php + 0x5ffbf5)
                #12 0x00007fc2e8c68042 __libc_start_main (libc.so.6 + 0x27042)
                #13 0x000000000060171e n/a (./sapi/cli/php + 0x20171e)
......................
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	  return ret;
.....................................


Test script:
---------------
Test command:
../../sapi/cli/php -d enable_dl=1 -d extension_dir=./ffi/modules test.php

test.php code:
<?php
dl('ffi');


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Oct 25 03:01:24 2020 UTC