Bug #77395 [NEW]: segfault about array_multisort ?

From: Date: Wed, 02 Jan 2019 03:18:32 +0000
Subject: Bug #77395 [NEW]: segfault about array_multisort ?
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218721@lists.php.net to get a copy of this message
From:             954983536 at qq dot com
Operating system: Ubuntu
PHP version:      7.3.0
Package:          *General Issues
Bug Type:         Bug
Bug description:segfault about array_multisort ?

Description:
------------
My English is poor, just look the php script. 
I test php7.3.0 php7.2.3 php7.1.10, all of them cause a segfault in fpm
and cli.

Test script:
---------------
<?php

function error_handle($level, $message, $file = '', $line = 0){
    $a = [1,2,3];
    $b = [3,2,1];
    array_multisort($a, SORT_ASC, $b); // if comment this line, no
segfault happen
}
set_error_handler('error_handle');
$data = [['aa'=> 'bb',], ['aa'=> 'bb',],];
array_multisort(array_column($data, 'bb'),SORT_DESC, $data); // PHP
Warning error 


Expected result:
----------------
no segfault happen 

Actual result:
--------------
Program terminated with signal SIGSEGV, Segmentation fault.
#0  malloc_consolidate (av=av@entry=0x7fa1af1a6b20 <main_arena>) at
malloc.c:4169
4169    malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7fa1af1a6b20 <main_arena>) at
malloc.c:4169
#1  0x00007fa1aee62678 in _int_free (av=0x7fa1af1a6b20 <main_arena>,
p=<optimized out>, have_lock=0) at malloc.c:4075
#2  0x00007fa1aee6653c in __GI___libc_free (mem=<optimized out>) at
malloc.c:2968
#3  0x0000000000c0dc1e in _efree (ptr=0x2b9d530,
__zend_filename=0x15319d8 "/home/soft/php-7.3.0/Zend/zend_arena.h",
__zend_lineno=46, __zend_orig_filename=0x0, __zend_orig_lineno=0) at
/home/soft/php-7.3.0/Zend/zend_alloc.c:2508
#4  0x0000000000c0fe90 in zend_arena_destroy (arena=0x2b9d530) at
/home/soft/php-7.3.0/Zend/zend_arena.h:46
#5  0x0000000000c11b62 in shutdown_compiler () at
/home/soft/php-7.3.0/Zend/zend_compile.c:382
#6  0x0000000000c4fa3a in zend_deactivate () at
/home/soft/php-7.3.0/Zend/zend.c:1111
#7  0x0000000000b8962e in php_request_shutdown (dummy=0x0) at
/home/soft/php-7.3.0/main/main.c:1926
#8  0x0000000000d40773 in do_cli (argc=2, argv=0x28f59b0) at
/home/soft/php-7.3.0/sapi/cli/php_cli.c:1164
#9  0x0000000000d4111a in main (argc=2, argv=0x28f59b0) at
/home/soft/php-7.3.0/sapi/cli/php_cli.c:1389

-- 
Edit bug report at https://bugs.php.net/bug.php?id=77395&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=77395&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=77395&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=77395&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=77395&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=77395&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=77395&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=77395&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=77395&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=77395&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=77395&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=77395&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=77395&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=77395&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77395&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=77395&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=77395&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=77395&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77395&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=77395&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=77395&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#218721) next »