php / php/php-src

Stack overflow no location

Open
#23,089 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Extension: standard Status: Verified
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

The following code:

<?php
$a=[]; for($i=0;$i<1000000;$i++){ $a=['k'=>$a]; }
$b=array_merge_recursive($a,$a);
echo "ok\n";

Resulted in this output:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==56==ERROR: AddressSanitizer: stack-overflow on address 0x7ffffca8dff8 (pc 0x7f0bfc038c33 bp 0x7ffffca8e000 sp 0x7ffffca8e000 T0)
    <empty stack>

SUMMARY: AddressSanitizer: stack-overflow
==56==ABORTING
USE_ZEND_ALLOC=0 php -d "opcache.enable=1" -d "opcache.enable_cli=1" -d "opcache.jit=tracing" -d "opcache.jit_hot_loop=1" -d "opcache.jit_hot_func=1" poc.php
PHP Version
8.6.0
Operating System

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided poc.php reproducer with the listed PHP 8.6.0 and opcache JIT command. Trace the array_merge_recursive stack-overflow path and determine how the missing location should be reported. Done means the failure has a useful location or diagnostic and the reproducer is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.