MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001496XdebugRemote Debuggingpublic2017-11-23 06:312017-11-23 18:30
Reporterildar 
Assigned Toderick 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionno change required 
PlatformOSarchlinuxOS Version
Product Version 
Target VersionFixed in Version 
Summary0001496: Server Error 500 related to throw new \Exception
DescriptionThe script does not work on PHP Version 7.2.0RC6
and git xdebug

<code>
class XCLowOpensslCryptor
{
    public function decryptString($in, $key, $fmt = null)
    {//{{{
        throw new \Exception(__METHOD__ . ' - Not an openssl cipher');
    }//}}}
}
    
try {
    $low_cryptor = new XCLowOpensslCryptor();
    $res = $low_cryptor->decryptString(1, 2);
} catch (Exception $e) {
}

echo 'Test Passed';
die();

</code>

The fix is
-zend_extension=/opt/phpfarm/inst/php-7.2.0RC6/lib/php/extensions/xdebug2xrc6.so
+;zend_extension=/opt/phpfarm/inst/php-7.2.0RC6/lib/php/extensions/xdebug2xrc6.so

in
/opt/phpfarm/inst/php-7.2.0RC6/lib/php.ini
Steps To Reproducecompiled on
aim-server[~/tmp/xdebug]$ git log -1
commit e0652e9fb0e945677d01396616688826c2037733 (HEAD -> master, origin/master, origin/HEAD)
Merge: e4f9c54e 31f33c5c
Author: Derick Rethans <github@derickrethans.nl>
Date: Wed Nov 22 23:59:27 2017 +0000

    Merged pull request 0000383
aim-server[~/tmp/xdebug]$ git branch
* master



via

/opt/phpfarm/inst/php-7.2.0RC6/bin/phpize
./configure --enable-xdebug --with-php-config=/opt/phpfarm/inst/php-7.2.0RC6/bin/php-config
make
cpi modules/xdebug.so /opt/phpfarm/inst/php-7.2.0RC6/lib/php/extensions/xdebug2x.so
sudo -E vim /opt/phpfarm/inst/php-7.2.0RC6/lib/php.ini
zend_extension=/opt/phpfarm/inst/php-7.2.0RC6/lib/php/extensions/xdebug2x.so
Additional InformationIf I remove the line
        throw new \Exception(__METHOD__ . ' - Not an openssl cipher');
the 500 error will be disappeared.


/var/log/httpd/error_log shows
[Thu Nov 23 10:16:30.475332 2017] [fastcgi:error] [pid 16035:tid 139965534172928] (104)Connection reset by peer: [client 192.168.69.3:53800] FastCGI: comm with server "/srv/http/bin/php-fastcgi5329" aborted: read failed
[Thu Nov 23 10:16:30.475481 2017] [fastcgi:error] [pid 16035:tid 139965534172928] [client 192.168.69.3:53800] FastCGI: incomplete headers (0 bytes) received from server "/srv/http/bin/php-fastcgi5329"
TagsNo tags attached.
Operating SystemLinux aim-server.crtdev.local 4.13.12-1-ARCH #1 SMP PREEMPT Wed Nov 8 11:54:06 CET 2017 x86_64 GNU/Linux
PHP Version7.2-dev
Attached Filestxt file icon phpinfo.txt [^] (49,114 bytes) 2017-11-23 06:31 [Show Content]
txt file icon gdb.txt [^] (11,100 bytes) 2017-11-23 11:55 [Show Content]

- Relationships

-  Notes
(0004481)
ildar (reporter)
2017-11-23 06:33

The fix is
-zend_extension=/opt/phpfarm/inst/php-7.2.0RC6/lib/php/extensions/xdebug2x.so
+;zend_extension=/opt/phpfarm/inst/php-7.2.0RC6/lib/php/extensions/xdebug2x.so
(0004482)
derick (administrator)
2017-11-23 10:27

I'm not having success reproducing this.

Can you reproduce this on the command line?
Does this happen always? Or does a debugging session need to be active?
(0004483)
ildar (reporter)
2017-11-23 11:28

It happens always.

aim-server[~/public_html]$ /opt/phpfarm/inst/php-7.2.0RC6/bin/php p.php
zsh: segmentation fault (core dumped) /opt/phpfarm/inst/php-7.2.0RC6/bin/php p.php
aim-server[~/public_html]$ cat p.php
<?php

class XCLowOpensslCryptor
{
    public function decryptString($in, $key, $fmt = null)
    {//{{{
        throw new \Exception(__METHOD__ . ' - Not an openssl cipher');
    }//}}}
}

try {
    $low_cryptor = new XCLowOpensslCryptor();
    $res = $low_cryptor->decryptString(1, 2);
} catch (Exception $e) {
}

echo 'Test Passed';
die();
aim-server[~/public_html]$
(0004484)
ildar (reporter)
2017-11-23 11:29

It works without exception

aim-server[~/public_html]$ /opt/phpfarm/inst/php-7.2.0RC6/bin/php p.php
Test Passed% aim-server[~/public_html]$ cat p.php
<?php

class XCLowOpensslCryptor
{
    public function decryptString($in, $key, $fmt = null)
    {//{{{
    }//}}}
}

try {
    $low_cryptor = new XCLowOpensslCryptor();
    $res = $low_cryptor->decryptString(1, 2);
} catch (Exception $e) {
}

echo 'Test Passed';
die();
(0004485)
ildar (reporter)
2017-11-23 11:45
edited on: 2017-11-23 11:48

I have used
git bisect to find the first bad commit.
https://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git [^]

It shows

aim-server[~/tmp/xdebug]$ git bisect bad
669a81c9ba59905b2177c4dde77899027a7a8953 is the first bad commit
commit 669a81c9ba59905b2177c4dde77899027a7a8953
Author: Derick Rethans <github@derickrethans.nl>
Date: Sat Nov 18 17:14:00 2017 +0000

    Implemented issue 0001323: Add setting to configure the formatting of filenames

:100644 100644 d278ac14c635c5b4d5c7acfd70edf2d0aed8ac96 da488fa6ae1e975fc768d375ed886261f8a126f1 M php_xdebug.h
:040000 040000 51444c54743c6d7d0f4d145a95e6a43cca1ebdc9 f1dccd4319f34bcc73cc9088d9b71c9e8b82d6f1 M tests
:100644 100644 11eb255edaddedad3f63b8a17f96b7475527f13e 27ee9fec95b1b935349775c490c701e7b3ae1380 M usefulstuff.c
:100644 100644 04b05896ecd090a74c1b4f729157817ca8e05444 0777d9313964dc6de3a12ca32c406f2484e22f39 M usefulstuff.h
:100644 100644 3041c7d9dbe30dbc446a7e2589f952f191b1a276 d87fb01e03cd883709863f9d74ec8e2c0aad7644 M xdebug.c
:100644 100644 3593414a4efb0dca30fbde67d6bbc905a3cdbe6d 771786a53cef53e7c2b77bba077ebda574aa15cc M xdebug_stack.c




So it works on the commit
aim-server[~/tmp/xdebug]$ git checkout 669a81c9ba59905b2177c4dde77899027a7a8953^1


but it doesn't work
on this commit

aim-server[~/tmp/xdebug]$ git checkout 669a81c9ba59905b2177c4dde77899027a7a8953

(0004486)
derick (administrator)
2017-11-23 11:47

OK, as you're running this with PHP having debug enabled, could you run this with gdb:

gdb --args /opt/phpfarm/inst/php-7.2.0RC6/bin/php p.php

end then on the GDB prompt:

run

and when it crashes:

bt full

and add all the output as a file to this ticket.
(0004487)
ildar (reporter)
2017-11-23 11:55

I have uploaded gdb.txt
(0004488)
derick (administrator)
2017-11-23 13:00

Can you run the following in the Xdebug source directory:

phpize && ./configure && make clean && make -j 5 all

(and then copy the generated xdebug.so to the right place, or use "make install")

I am thinking it might not have picked up a change in a .h file.
(0004489)
ildar (reporter)
2017-11-23 13:14

I have tried

1)
/opt/phpfarm/inst/php-7.2.0RC6/bin/phpize
./configure --enable-xdebug --with-php-config=/opt/phpfarm/inst/php-7.2.0RC6/bin/php-config
make clean
make -j 5 all

As result it works!

2)
/opt/phpfarm/inst/php-7.2.0RC6/bin/phpize
./configure --enable-xdebug --with-php-config=/opt/phpfarm/inst/php-7.2.0RC6/bin/php-config
make clean
make

It works in this way too.

It seems
'make clean' must be launched every time.

Sorry for the false bug request.

Thank you.
(0004490)
ildar (reporter)
2017-11-23 13:16

I have changed my instruction to build

/opt/phpfarm/inst/php-7.2.0RC6/bin/phpize
./configure --enable-xdebug --with-php-config=/opt/phpfarm/inst/php-7.2.0RC6/bin/php-config
make clean;make
cpi modules/xdebug.so /opt/phpfarm/inst/php-7.2.0RC6/lib/php/extensions/xdebug2x.so
sudo -E vim /opt/phpfarm/inst/php-7.2.0RC6/lib/php.ini
zend_extension=/opt/phpfarm/inst/php-7.2.0RC6/lib/php/extensions/xdebug2x.so
(0004491)
ildar (reporter)
2017-11-23 13:20

May be
make clean should be added here
https://xdebug.org/docs/install [^] ?
(0004492)
ildar (reporter)
2017-11-23 13:21

and here
https://github.com/derickr/xdebug [^]
(0004493)
derick (administrator)
2017-11-23 18:30

Thanks for the great report. And good to know it wasn't actually a bug after all.

The "make clean" is only really needed when you have already compiled Xdebug in the same directory before *and* I have changed a header file. There is a "./rebuild.sh" script in Xdebug's source checkout to do all the steps for you.

I've updated the documentation at https://github.com/xdebug/xdebug#xdebug [^]

- Issue History
Date Modified Username Field Change
2017-11-23 06:31 ildar New Issue
2017-11-23 06:31 ildar File Added: phpinfo.txt
2017-11-23 06:33 ildar Note Added: 0004481
2017-11-23 10:27 derick Note Added: 0004482
2017-11-23 10:27 derick Assigned To => derick
2017-11-23 10:27 derick Status new => feedback
2017-11-23 11:28 ildar Note Added: 0004483
2017-11-23 11:28 ildar Status feedback => assigned
2017-11-23 11:29 ildar Note Added: 0004484
2017-11-23 11:45 ildar Note Added: 0004485
2017-11-23 11:47 derick Note Added: 0004486
2017-11-23 11:47 derick Status assigned => feedback
2017-11-23 11:48 ildar Note Edited: 0004485 View Revisions
2017-11-23 11:55 ildar File Added: gdb.txt
2017-11-23 11:55 ildar Note Added: 0004487
2017-11-23 11:55 ildar Status feedback => assigned
2017-11-23 13:00 derick Note Added: 0004488
2017-11-23 13:00 derick Status assigned => feedback
2017-11-23 13:14 ildar Note Added: 0004489
2017-11-23 13:14 ildar Status feedback => assigned
2017-11-23 13:16 ildar Note Added: 0004490
2017-11-23 13:20 ildar Note Added: 0004491
2017-11-23 13:21 ildar Note Added: 0004492
2017-11-23 18:30 derick Note Added: 0004493
2017-11-23 18:30 derick Status assigned => resolved
2017-11-23 18:30 derick Resolution open => no change required


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker