View Issue Details

IDProjectCategoryView StatusLast Update
0001699XdebugProfilingpublic2019-10-31 10:44
ReporterLobzek Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSWindowsOS Version10
Product Version2.8.0beta1 
Fixed in Version2.8.0 
Summary0001699: Crash during debugging Phalcon project
Description

During debugging my project that uses Phalcon framework, in step-by-step mode once any Phalcon's function/class initiated the Xdebug stop working (actually the whole Apache process crashes).

That doesn't happens when debugging pure PHP project.

Checked on different IDEs: Netbeans 11 & PhpStrom 2019.2
Checked with different PHP versions: 7.3 & 7.2
Checked with different Xdebug versions: 2.7.2 & 2.8.0-beta1
Checked with different Phalcon versions: 3.4.4 & 3.2.2

Steps To Reproduce

Run step-by-step debugging of following test script:

$test = 5;
$config = new \Phalcon\Config(['test' => 45]); // <--- After that line debugger stop working
$yyy = $config->get('test');

Additional Information

First I saw the crash in Apache error log:

[mpm_winnt:notice] [pid 11116:tid 720] AH00428: Parent: child process 10172 exited with status 3221225477 -- Restarting.

After that I checked windows event viewer and found following information:

Application Error:
Faulting application name: httpd.exe, version: 2.4.39.0, time stamp: 0x5cee4f90
Faulting module name: php_xdebug.dll, version: 2.8.0.3, time stamp: 0x5d39da6b
Exception code: 0xc0000005
Fault offset: 0x000000000002a59e
Faulting process id: 0x27bc
Faulting application start time: 0x01d55a810f670989
Faulting application path: C:\xampp\apache\bin\httpd.exe
Faulting module path: C:\xampp\php\ext\php_xdebug.dll
Report Id: 6d3d0f47-e119-4f9d-b1fb-2c3c96cd4753
Faulting package full name:
Faulting package-relative application ID:

And here the windows crash report:

Fault bucket 1758042406467703038, type 4
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: httpd.exe
P2: 2.4.39.0
P3: 5cee4f90
P4: php_xdebug.dll
P5: 2.8.0.3
P6: 5d39da6b
P7: c0000005
P8: 000000000002a59e
P9:
P10:

Analysis symbol:
Rechecking for solution: 0
Report Id: 6d3d0f47-e119-4f9d-b1fb-2c3c96cd4753
Report Status: 268435456
Hashed bucket: 664f7f3c97ed31187865d241119490fe
Cab Guid: 0

Windows report file attached to the issue.

Tagsphalcon
Operating SystemWindows 10
PHP Version7.3.5-7.3.9

Activities

StudioMaX

2019-08-26 14:28

reporter   ~0005125

I've got the same issue on the newly installed vagrant box with Ubuntu 16.04.
Phalcon: 3.4.4
PHP: 7.3.8
Xdebug: 2.7.2 (also tested the current master branch with 3.0.0-dev)
Everything works without any issues in case Xdebug enabled in php.ini but XDEBUG_SESSION was not provided to the server.
Earlier I used Phalcon 3.3.1 with PHP 7.1.x and there were no such problems.

StudioMaX

2019-08-26 14:43

reporter   ~0005126

Remote debugging log with this script

<?php

$test = 5;
$config = new \Phalcon\Config(['test' => 45]); // <--- After that line debugger stop working
$yyy = $config->get('test');
var_dump($yyy);

derick

2019-08-26 18:06

administrator   ~0005127

I've tried to reproduce this, but I can't. @StudioMaX, can you share the Vagrant file?

StudioMaX

2019-08-27 08:08

reporter   ~0005128

You can test it here: https://github.com/StudioMaX/phalcon-xdebug
Just for your info:

  • ssh keys are located in /ssh
  • add 192.168.56.124 phalcon.test to your hosts
  • test script located in /var/www/public/phalcon.php, can be accessed from http://phalcon.test/phalcon.php
  • Phalcon v3.4.4 was compiled from source, you can recompile it via sudo compile-phalcon.sh
  • sometimes Apache doesn't shartup on boot so you need to run sudo systemctl restart apache2

derick

2019-08-27 17:03

administrator   ~0005129

I haven't tried yet, but is it possible to reproduce on the CLI as well? /cc @StudioMaX

StudioMaX

2019-08-27 17:36

reporter   ~0005130

Well, when I run the Symfony Console in my app, which uses the Phalcon dependency manager, there are no issues. It also works if xdebug is enabled, but I do not use step-by-step debugging. But when I use step-by-step debugging, moved onto line $config = new \Phalcon\Config(['test' => 45]); and press F8, then Apache shows the HTTP 503 error page and writes "AH00491: caught SIGTERM, shutting down" into error.log. I can reproduce this error all the time.
A few days ago I upgraded PhpStorm to 2019.2.1, maybe this is related somehow.

StudioMaX

2019-08-30 15:00

reporter   ~0005131

@derick are you able to reproduce this case?

StudioMaX

2019-09-02 16:53

reporter   ~0005132

Well, it also crashes in CLI when using step-by-step debugging at the same breakpoint:
XDEBUG_CONFIG="idekey=PHPSTORM remote_autostart=1" PHP_IDE_CONFIG="serverName=phalcon_xdebug_cli" SITE_ENV="dev" php -dxdebug.remote_host=192.168.56.1 /var/www/public/phalcon.php

derick

2019-09-16 15:33

administrator   ~0005140

I tried to reproduce this again, but still no luck. Beyond Vagrant not working (it says something about not being able to find the provider?), it works locally without a hitch. However, this is with that latest RC candidate of Xdebug. Perhaps you can try that?

StudioMaX

2019-09-16 17:07

reporter   ~0005142

Yes, this still occurs on 2.8.0beta2.

Beyond Vagrant not working (it says something about not being able to find the provider?)
I use Windows as host and Ubuntu as guest in Virtualbox with Vagrant, maybe this is related somehow. But looks like the topic starter used native DLLs on Windows, so this is not related to Windows/Linux.

derick

2019-09-16 17:24

administrator   ~0005143

Could you provide something I can ssh into?

derick

2019-09-17 09:39

administrator   ~0005146

Hi there! I could successfully reproduce it with your Vagrant machine, and I know why I could reproduce it there, and not at home. At home I had compiled a beta of phalcon 4.0.0 (the master in git), and you were using 3.4.4. The 4 beta version handles data differently (or rather, correctly). I believe the bug is really in phalcon itself, but there is a workaround that I have that works around this. I'll have that committed later today (after it's gone through all the CI tests).

derick

2019-09-17 16:47

administrator   ~0005147

This is now fixed in GIT, for Xdebug 2.8.0beta3/RC1.