View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002350 | Xdebug | Stacktraces | public | 2025-05-20 07:47 | 2025-06-13 15:07 |
| Reporter | f.bosch@genkgo.nl | Assigned To | derick | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | resolved | Resolution | duplicate | ||
| Platform | Docker | OS | Alpine | OS Version | 3.20.6 |
| Product Version | 3.4.2 | ||||
| Fixed in Version | 3.4.4 | ||||
| Summary | 0002350: Crash when a certain page generates an exception since Xdebug 3.4.3 | ||||
| Description | A certain page generates an exception and that causes Xdebug to crash, resulting in a 502 Bad Gateway. I am on Xdebug 3.4.3 by the way, could only pick 3.4.2 from the list. This is the stacktrace. | ||||
| Additional Information | PHP 8.3.21 (cli) (built: May 19 2025 14:17:50) (NTS) | ||||
| Tags | No tags attached. | ||||
| Operating System | Ubuntu + Docker Alpine | ||||
| PHP Version | 8.3.10-8.3.19 | ||||
|
|
Can you please provide steps on how I can reproduce this? I have seen this reported a few times not, but never with an example that shows the issue — not even with a generally too large example. |
|
|
Derick, I wish I could do that, but once I extract the bits of code, it doesn't crash anymore. I can share my minimal example that does not crash though. |
|
|
Now as attachment. But again, it does not crash. I was not able to create a reproducible crashing example. test.php (2,124 bytes)
<?php
class Placeholders {
/**
* @var \Closure(): (self)|null
*/
private ?\Closure $value = null;
public function __construct(private array $collection = [], private array $scopedCollection = [])
{
}
public function withCallbackScope(string $scope, \Closure $callback): Placeholders
{
$clone = clone $this;
$clone->scopedCollection[$scope] = new self();
$clone->scopedCollection[$scope]->value = $callback;
return $clone;
}
public function getScope(string $scope): Placeholders
{
if (!isset($this->scopedCollection[$scope])) {
throw new \InvalidArgumentException('Cannot find key ' . $scope);
}
return $this->scopedCollection[$scope];
}
public function get(string $key): string
{
if ($this->value !== null) {
$value = \call_user_func($this->value);
$this->collection = $value->collection;
$this->value = null;
}
if (!isset($this->collection[$key])) {
// return ''; // <- solves the crash
throw new \InvalidArgumentException('Cannot find key ' . $key); // <- here is the crash
}
return $this->collection[$key];
}
}
$placeholders = (new Placeholders())
->withCallbackScope('x', fn () => new Placeholders([
'letterhead' => 'letterhead',
'street' => 'street',
'postalcode' => 'postalcode',
'city' => 'city',
]));
class Resolver {
public function resolve(Placeholders $placeholders)
{
$result = '';
try {
$result .= $placeholders->getScope('x')->get('letterhead');
$result .= $placeholders->getScope('x')->get('street');
$result .= $placeholders->getScope('x')->get('postalcode');
$result .= $placeholders->getScope('x')->get('city');
$result .= $placeholders->getScope('x')->get('country');
} catch (\InvalidArgumentException) {
}
return $result;
}
}
$resolver = new Resolver();
echo $resolver->resolve($placeholders);
echo "end";
|
|
|
I confirm the crash. |
|
|
Okay, if there is no reproducible example, I can not find this bug, nor fix it. Until then, I will leave this issue in Feedback. It's possible that issue 0002352 is the same too. A way to make it easier to crash, is to turn of Zend's memory manager before you run the script (on the command line): |
|
|
looks like a duplicate of https://bugs.xdebug.org/view.php?id=2349 |
|
|
A fix for this has now been merged. It would be great if you could check out the latest code on GitHub (The |
|
|
My problem has been resolved derick. Thank you for the work and the work! |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2025-05-20 07:47 | f.bosch@genkgo.nl | New Issue | |
| 2025-05-20 18:19 | derick | Assigned To | => derick |
| 2025-05-20 18:19 | derick | Status | new => feedback |
| 2025-05-20 18:19 | derick | Note Added: 0007289 | |
| 2025-05-20 19:48 | f.bosch@genkgo.nl | Note Added: 0007290 | |
| 2025-05-20 19:48 | f.bosch@genkgo.nl | Status | feedback => assigned |
| 2025-05-20 19:53 | f.bosch@genkgo.nl | Note Added: 0007291 | |
| 2025-05-20 19:53 | f.bosch@genkgo.nl | File Added: test.php | |
| 2025-05-22 13:07 | SR | Note Added: 0007292 | |
| 2025-06-02 14:53 | derick | Note Added: 0007298 | |
| 2025-06-02 14:53 | derick | Note Edited: 0007290 | |
| 2025-06-02 14:53 | derick | Note Edited: 0007298 | |
| 2025-06-02 14:54 | derick | Status | assigned => feedback |
| 2025-06-05 10:46 | acran | Note Added: 0007301 | |
| 2025-06-11 11:12 | derick | Status | feedback => resolved |
| 2025-06-11 11:12 | derick | Resolution | open => duplicate |
| 2025-06-11 11:12 | derick | Fixed in Version | => 3.4dev |
| 2025-06-11 11:12 | derick | Relationship added | duplicate of 0002349 |
| 2025-06-11 11:12 | derick | Note Added: 0007309 | |
| 2025-06-12 11:46 | derick | Fixed in Version | 3.4dev => 3.4.4 |
| 2025-06-12 11:50 | derick | Summary | [3.4.3] Crash when a certain page generates an exception => Crash when a certain page generates an exception since Xdebug 3.4.3 |
| 2025-06-13 15:07 | f.bosch@genkgo.nl | Note Added: 0007318 |