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

Continuously spawning php subprocess calls to OS eventually leading to memory exhaustion #59

Open
Kilill opened this issue Nov 7, 2021 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Kilill
Copy link

Kilill commented Nov 7, 2021

  • OS: Win 10
  • Php: 8 / 7 does not matter

Process growth can easly be seen in eiter Process Explorer or Task Manger
LaravlExtra

there seems to be 3 different commands at least 2 of wich repeat, all of them starts with:

C:\Windows\\system32\WindowsPowerShell\v1.0\powershell.exe -c "E:\php\php -r \"define('LARAVEL_START', microtime(true)); require_once 'w:\test/vendor/autoload.php'; $app = require_once 'w:\test/bootstrap/app.php'; class VscodeLaravelExtraIntellisenseProvider extends \Illuminate\Support\ServiceProvider { public function register() {} public function boot() { if (method_exists($this->app['log'], 'setHandlers')) { $this->app['log']->setHandlers([new \Monolog\Handler\NullHandler()]); } } } $app->register(new VscodeLaravelExtraIntellisenseProvider($app)); $kernel = $app->make(Illuminate\Contracts\Console\Kernel::class); $status = $kernel->handle($input = new Symfony\Component\Console\Input\ArgvInput,new Symfony\Component\Console\Output\ConsoleOutput); echo '___VSCODE_LARAVEL_EXTRA_INSTELLISENSE_OUTPUT___';*

then follows one of the following:

echo json_encode(array_map(function ($route) { return ['method' => implode('|', array_filter($route->methods(), function ($method) { return $method != 'HEAD'; })), 'uri' => $route->uri(), 'name' => $route->getName(), 'action' => str_replace('App\\Http\\Controllers\\', '', $route->getActionName()), 'parameters' => $route->parameterNames() ]; }, app('router')->getRoutes()->getRoutes()));echo '___VSCODE_LARAVEL_EXTRA_INSTELLISENSE_END_OUTPUT___';\""

or

$middlewares = array_merge(app('Illuminate\Contracts\Http\Kernel') ->getMiddlewareGroups(), app('Illuminate\Contracts\Http\Kernel') ->getRouteMiddleware()); foreach($middlewares as $key => &$value) { if (is_array($value)){ $value = null; }else{ $parameters = array_filter((new ReflectionMethod($value, 'handle')) ->getParameters(), function ($rc) { return $rc->getName() != 'request' && $rc->getName() != 'next'; }); $value=implode(',', array_map(function ($rh) { return $rh->getName().($rh->isVariadic()?'...':''); }, $parameters)); if(empty($value)){ $value=null; } }; } echo json_encode($middlewares);echo '___VSCODE_LARAVEL_EXTRA_INSTELLISENSE_END_OUTPUT___';\""

or

echo json_encode( array_merge( array_keys(Illuminate\Support\Facades\Gate::abilities()), array_values( array_filter( array_unique( Illuminate\Support\Arr::flatten( array_map( function ($val, $key) { return array_map( function ($rm) { return $rm->getName(); }, (new ReflectionClass($val))->getMethods() ); }, Illuminate\Support\Facades\Gate::policies(), array_keys(Illuminate\Support\Facades\Gate::policies()) ) )), function ($an) { return !in_array($an, ['allow', 'deny']); } ) ) ) ); echo '___VSCODE_LARAVEL_EXTRA_INSTELLISENSE_END_OUTPUT___';\""

@amir9480 amir9480 added bug Something isn't working help wanted Extra attention is needed labels Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants