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

Phan doesn't play nice with XDebug enabled #58

Closed
scaytrase opened this issue Dec 13, 2015 · 4 comments
Closed

Phan doesn't play nice with XDebug enabled #58

scaytrase opened this issue Dec 13, 2015 · 4 comments
Labels
bug A crash in Phan, a recent change causing incorrect analysis results, etc.

Comments

@scaytrase
Copy link
Contributor

When scanning symfony-based project (all files, but vendor exluded with -3 option) I'm getting recursion limit exception.

On 300 levels I got:

   96.5956  768976816 294. Phan\Language\AST::backwardCompatibilityCheck() C:\Work\Tools\phan\src\Phan\Language\AST.php:306
   96.5956  768976816 295. Phan\Language\AST::backwardCompatibilityCheck() C:\Work\Tools\phan\src\Phan\Language\AST.php:306
   96.5956  768976816 296. Phan\Language\AST::backwardCompatibilityCheck() C:\Work\Tools\phan\src\Phan\Language\AST.php:306
   96.5956  768976816 297. Phan\Language\AST::backwardCompatibilityCheck() C:\Work\Tools\phan\src\Phan\Language\AST.php:306
   96.5956  768976816 298. Phan\Language\AST::backwardCompatibilityCheck() C:\Work\Tools\phan\src\Phan\Language\AST.php:306
   96.5956  768976816 299. Phan\Language\AST::backwardCompatibilityCheck() C:\Work\Tools\phan\src\Phan\Language\AST.php:306
   96.5956  768976816 300. Phan\Language\AST::backwardCompatibilityCheck() C:\Work\Tools\phan\src\Phan\Language\AST.php:306

on 1000 levels deep I got:

PHP  79. Phan\Phan->analyzeNodeInContext() C:\Work\Tools\phan\src\Phan\Phan.php:395
PHP  80. Phan\Phan->analyzeNodeInContext() C:\Work\Tools\phan\src\Phan\Phan.php:395
PHP  81. Phan\Phan->analyzeNodeInContext() C:\Work\Tools\phan\src\Phan\Phan.php:395
PHP  82. Phan\Phan->analyzeNodeInContext() C:\Work\Tools\phan\src\Phan\Phan.php:395
PHP  83. Phan\Phan->analyzeNodeInContext() C:\Work\Tools\phan\src\Phan\Phan.php:395
PHP  84. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Phan.php:405
PHP  85. Phan\Analyze\BreadthFirstVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
PHP  86. Phan\Language\AST::classMethodFromNodeInContext() C:\Work\Tools\phan\src\Phan\Analyze\BreadthFirstVisitor.php:814
PHP  87. Phan\Language\AST::classFromNodeInContext() C:\Work\Tools\phan\src\Phan\Language\AST.php:455
PHP  88. Phan\Language\AST::classNameFromNode() C:\Work\Tools\phan\src\Phan\Language\AST.php:392
PHP  89. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Language\AST.php:103
PHP  90. Phan\Analyze\ClassNameVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
PHP  91. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Analyze\ClassNameVisitor.php:179
PHP  92. Phan\Analyze\ClassName\MethodCallVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113

And recusing in

  360.4971 1576100672 972. Phan\Analyze\ClassName\MethodCallVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
  360.4971 1576100672 973. Phan\Language\UnionType::fromNode() C:\Work\Tools\phan\src\Phan\Analyze\ClassName\MethodCallVisitor.php:247
  360.4971 1576100808 974. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Language\UnionType.php:156
  360.4971 1576100808 975. Phan\Analyze\UnionTypeVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
  360.4971 1576100808 976. Phan\Language\AST::classNameFromNode() C:\Work\Tools\phan\src\Phan\Analyze\UnionTypeVisitor.php:824
  360.4971 1576100944 977. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Language\AST.php:103
  360.4971 1576100944 978. Phan\Analyze\ClassNameVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
  360.4971 1576101080 979. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Analyze\ClassNameVisitor.php:179
  360.4971 1576101080 980. Phan\Analyze\ClassName\MethodCallVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
  360.4971 1576101080 981. Phan\Language\UnionType::fromNode() C:\Work\Tools\phan\src\Phan\Analyze\ClassName\MethodCallVisitor.php:247
  360.4971 1576101216 982. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Language\UnionType.php:156
  360.4971 1576101216 983. Phan\Analyze\UnionTypeVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
  360.4971 1576101216 984. Phan\Language\AST::classNameFromNode() C:\Work\Tools\phan\src\Phan\Analyze\UnionTypeVisitor.php:824
  360.4971 1576101352 985. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Language\AST.php:103
  360.4971 1576101352 986. Phan\Analyze\ClassNameVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
  360.4971 1576101488 987. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Analyze\ClassNameVisitor.php:179
  360.4971 1576101488 988. Phan\Analyze\ClassName\MethodCallVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
  360.4971 1576101488 989. Phan\Language\UnionType::fromNode() C:\Work\Tools\phan\src\Phan\Analyze\ClassName\MethodCallVisitor.php:247
  360.4971 1576101624 990. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Language\UnionType.php:156
  360.4971 1576101624 991. Phan\Analyze\UnionTypeVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
  360.4971 1576101624 992. Phan\Language\AST::classNameFromNode() C:\Work\Tools\phan\src\Phan\Analyze\UnionTypeVisitor.php:824
  360.4971 1576101760 993. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Language\AST.php:103
  360.4971 1576101760 994. Phan\Analyze\ClassNameVisitor->visitMethodCall() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:113
  360.4972 1576101896 995. Phan\Language\AST\Element->acceptKindVisitor() C:\Work\Tools\phan\src\Phan\Analyze\ClassNameVisitor.php:179
  360.4972 1576101896 996. Phan\Analyze\ClassName\MethodCallVisitor->visitVar() C:\Work\Tools\phan\src\Phan\Language\AST\Element.php:163
  360.4972 1576101896 997. Phan\Language\UnionType->nonGenericArrayTypes() C:\Work\Tools\phan\src\Phan\Analyze\ClassName\MethodCallVisitor.php:122
  360.4972 1576102408 998. array_filter() C:\Work\Tools\phan\src\Phan\Language\UnionType.php:532
  360.4972 1576102464 999. Phan\Language\UnionType->Phan\Language\{closure}() C:\Work\Tools\phan\src\Phan\Language\UnionType.php:532
  360.4972 1576102464 1000. Phan\Language\Type->isGenericArray() C:\Work\Tools\phan\src\Phan\Language\UnionType.php:531
@rlerdorf
Copy link
Collaborator

Yes, Phan is heavily recursive. Although I wouldn't think we'd go a 1000 levels deep, but perhaps for complex code we could. If you set it to 10000, how does it do?

@scaytrase
Copy link
Contributor Author

I've set 20k to be sure, works well

@rlerdorf
Copy link
Collaborator

Ok, so I don't see that there is anything to do here other than perhaps document the fact that you need to set your recursion limit high if you have xdebug loaded

@scaytrase
Copy link
Contributor Author

I think you can also trigger a warning that xdebug has performance impact on phan. Like composer do

@morria morria added the bug A crash in Phan, a recent change causing incorrect analysis results, etc. label Dec 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash in Phan, a recent change causing incorrect analysis results, etc.
Projects
None yet
Development

No branches or pull requests

3 participants