Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console hangs when running PHP console scripts #1079

Closed
Maximus5 opened this issue Jul 31, 2015 · 27 comments
Closed

Console hangs when running PHP console scripts #1079

Maximus5 opened this issue Jul 31, 2015 · 27 comments

Comments

@Maximus5
Copy link
Owner

Originally reported on Google Code with ID 1079

Required information!
OS version: Win7 Pro   SP1   x64
ConEmu version: 130523
Far version (if you are using Far Manager): ?

*Bug description*
I am running some PHP console scripts to perform some migration actions on our business
database and applications. I decided to try ConEmu because I wanted to maximize the
window and see more output on the screen. When running scripts, ConEmu doesn't freeze
per se, but it kept PHP running at 100% for 30+ minutes. I originally thought it was
the script, but after testing it in standard Windows console, it ran within a few seconds.
I only had this hanging when using ConEmu. I'm echo'ing data to the screen and using
PHP_EOL for line breaks.

*Steps to reproduction*
1. cd to "C:\Program Files\PHP\v5.4.14\"
2. php.exe C:\migrations\conversion_lsp.php
3.


Reported by jeff@thoughtreactor.com on 2013-05-28 13:52:12

@Maximus5
Copy link
Owner Author

Open Settings->Info and look into "Processes" list box during script execution. What
happens?

Also, I need full memory dump of php.exe process (actually, I need dump of active process
in the console).

Reported by ConEmu.Maximus5 on 2013-05-28 14:31:54

@Maximus5
Copy link
Owner Author

One more thought: try to disable "Inject ConEmuHk". Smth changed?

Reported by ConEmu.Maximus5 on 2013-05-28 14:33:28

@Maximus5
Copy link
Owner Author

I unchecked "Inject ConEmuHk" and it seems to work just fine now. What exactly does
that option do?

Reported by jeff@thoughtreactor.com on 2013-05-28 15:02:43

@Maximus5
Copy link
Owner Author

It's responsible for many features, ANSI processing, for example.
Read FAQ for more information.

However you have seen strange behavior, it must not slow down so much...
May be your script runs thousands of external applications per minute? That's why I've
asked about Info page.

Reported by ConEmu.Maximus5 on 2013-05-28 15:09:15

@Maximus5
Copy link
Owner Author

I've attached a dump file using Sysinternals procdump. This is what shows up in the
Info window in the Processes box:

(*)[1.0] ConEmuC64.exe
(*)[1.1] conhost.exe
(*)[1.2] cmd.exe
(*)[1.3] php.exe

Reported by jeff@thoughtreactor.com on 2013-05-28 15:47:12


- _Attachment: [php_130528_114458.dmp](https://storage.googleapis.com/google-code-attachments/conemu-maximus5/issue-1079/comment-5/php_130528_114458.dmp)_

@Maximus5
Copy link
Owner Author

Can't detect the problem by static minidump, unfortunately.
May be you can create some test php project, that I can process on my PC?
Our may be you can help with debugging?

Reported by ConEmu.Maximus5 on 2013-05-31 14:36:35

@Maximus5
Copy link
Owner Author

Hi, I have the same problem here.
** my english is not so good - but I'll try it :)

The problem is "Inject ConEmuHk". if I disable this option all is fine - but the console
output looks terribly.

With "Inject ConEmuHk":  http://ishark.tk/v5QfdGet6MnTFwlr458ZIw.jpg
Without: http://ishark.tk/clDhLgWUGLuJK64Y8Luk6A.jpg

I use Composer (http://getcomposer.org/) this work with PHP. 
I just only call the command "composer" and my php.exe process use 100% :/


Reported by patrick.romowicz on 2013-06-20 10:37:13

@Maximus5
Copy link
Owner Author

@ patrick.romowicz
What I need to install, to get php 100 % ?
Step-by-step with links?

Reported by ConEmu.Maximus5 on 2013-06-20 10:54:57

@Maximus5
Copy link
Owner Author

PHP - http://windows.php.net/download/ 
I use 5.3.24
Composer - http://getcomposer.org/Composer-Setup.exe
-- 
Start ConEmu and run "composer".

Reported by patrick.romowicz on 2013-06-20 11:03:48

@Maximus5
Copy link
Owner Author

Can't reproduce "composer" hung.
Checked php 5.3.26 and current composer.
When I run "composer" from ConEmu-cmd prompt - it show its "help" with colors output.

If you notice that constantly - please provide more "debug" info...
Dumps of all ConEmu-spawned processes;
May be log files from "Process Monitor" utility;
Log from "Debug" page of settings dialog with "Shell" option enabled;
Screenshot of hunged instance with Real console visible (CtrlWinAltSpace to show it
before running composer)

Reported by ConEmu.Maximus5 on 2013-06-25 14:04:15

@Maximus5
Copy link
Owner Author

Screenshot http://ishark.tk/f6xtkeLaX_5Na6X9ERu47w.jpg

Reported by patrick.romowicz on 2013-06-26 06:29:00

@Maximus5
Copy link
Owner Author

Dump http://www.file-upload.net/download-7760597/full-dumps.7z.html

Reported by patrick.romowicz on 2013-06-26 07:08:44

@Maximus5
Copy link
Owner Author

Dump of php.exe is missed in full-dumps.7z

Reported by ConEmu.Maximus5 on 2013-06-26 08:06:44

@Maximus5
Copy link
Owner Author

Sorry. I have found the problem -> Xdebug.
If I disable the extension all works fine.

I have install PHP 5.4.16 with Xdebug 2.2.3 (php_xdebug-2.2.3-5.4-vc9-nts.dll) and
run a clean symfony2 with php built-in web server. 
Howto: http://symfony.com/doc/current/quick_tour/the_big_picture.html

If Xdebug is enabled - my php.exe run with 100% CPU.

dumps : http://www.file-upload.net/download-7760760/all-dumps-symfony.7z.html


Reported by patrick.romowicz on 2013-06-26 08:33:33

@Maximus5
Copy link
Owner Author

problem is not in xdebug, or at least not only xdebug. in my case it's totally good
when i run composer from cmd.exe and extremelly slow when run from far in conemu.

Reported by spectorius on 2013-08-05 07:07:24

@Maximus5
Copy link
Owner Author

@ spectorius, are you sure running last ConEmu build? "Stable" version may produce lags
when "Inject ConEmuHk" is checked.

Reported by ConEmu.Maximus5 on 2013-08-05 11:16:03

@Maximus5
Copy link
Owner Author

I have option "Inject ConEmuHk" unchecked, but running composer under FAR under ConEmu
gets it extremely slow. ConEmu version is 130625.

Reported by spectorius on 2013-08-10 08:56:11

@Maximus5
Copy link
Owner Author

Hard to believe
1. 625 is obsolete build, upgrade
2. What do you mean with "slow"?

Reported by ConEmu.Maximus5 on 2013-08-10 08:59:33

@Maximus5
Copy link
Owner Author

The problem is observable with php 5.3 and 5.5 and Xdebug extension 2.2.0 and 2.2.3
(even when xdebug settings flags are disabled). Both disabling Xdebug extension or
disabling Inject ConEmuHk can help. Without doing this, Composer performs several tens
of times slower.
The latest conemu release was used.

Reported by normalmapping on 2013-09-02 16:59:23

@Maximus5
Copy link
Owner Author

I'm getting this as well. Windows 7. Composer runs terribly slow while it runs fine
in Console2 and CMD.

Also when I run with composer Powershell via ConEmu and I have ansiconx64 installed
permanently it mentions something like: "ConEmu blocks ANSICON injection". What does
that mean? This doesn't happen in CMD.

Reported by roger.qiu@polycademy.com on 2013-09-14 12:20:54

@Maximus5
Copy link
Owner Author

ConEmu has internal support of ANSI sequences.
Ansicon has a bug leading to crashes if your console apps running in ConEmu
Of course, it was blocked 

Reported by ConEmu.Maximus5 on 2013-09-14 13:04:42

@Maximus5
Copy link
Owner Author

same thing happens with me Win7 , when running composer and enabling inject coEmuHK
it slows down the process alot. But looks good when i enable it :)

wish there was a solution

Reported by bumstyla on 2013-10-09 10:53:05

@Maximus5
Copy link
Owner Author

+Me too 

I noticed that PEAR was running very slow (i.e. php.exe process takes 100% CPU for
long lengths of time). I have tried this with xdebug enabled and disabled. I have not
yet tried disabling ConEmuHk. 


The problem occurs when ConEmu wraps tcc.exe or cmd.exe. When running under normal
cmd, pear is fast/normal. 

Win 7 x64
ConEmu version: 130604


PHP 5.5.0 (cli) (built: Jun 19 2013 16:13:16)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0-dev, Copyright (c) 1998-2013 Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans





Reported by vishal.doshi on 2013-10-23 01:07:34

@Maximus5
Copy link
Owner Author

Sorry for posting twice. 

The problem goes away when I disable ConEmuHK injection. Perhaps it should be possible
to selectively disable injecting into php.exe till a better solution is found?

Reported by vishal.doshi on 2013-10-23 01:12:26

@Maximus5
Copy link
Owner Author

I need to reproduce that on my test PC to check that. Seems like simple php install
is not enough...
It would be great if anyone may create some test env (or exact instructions how to
create it).

As current workaround you may use -cur_console:i or ConEmuEnvironment to disable hooks
temporarily.

Reported by ConEmu.Maximus5 on 2013-10-23 06:43:20

@Maximus5
Copy link
Owner Author

Reported by ConEmu.Maximus5 on 2013-11-02 00:46:41

  • Status changed: Started

@Maximus5
Copy link
Owner Author

131103

Reported by ConEmu.Maximus5 on 2013-11-04 03:18:35

  • Status changed: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant