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

Review all recursive file operations - could cause issues on deep folder hierarchies beyond 100 #8476

Closed
1 task
DeepDiver1975 opened this issue May 6, 2014 · 7 comments

Comments

@DeepDiver1975
Copy link
Member

@karlitschek @icewind1991

Looks like we currently have a limitation on the folder structure depth we can handle due to php's max recursion handling.

We could either limit ownCloud's folder depth or replace all recursions with different implementations.

Open question:

  • is the max recursion count a matter of configuration or php compile option? @bantu any idea
Empty test suite.
PHP Fatal error:  Maximum function nesting level of '100' reached, aborting! in /home/deepdiver/Development/ownCloud/core/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php on line 85
PHP Stack trace:
PHP   1. {main}() /tmp/ide-phpunit.php:0
PHP   2. IDE_Base_PHPUnit_TextUI_Command::main() /tmp/ide-phpunit.php:506
PHP   3. PHPUnit_TextUI_Command->run() /tmp/ide-phpunit.php:268
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:176
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:349
PHP   6. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
PHP   7. PHPUnit_Framework_TestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:775
PHP   8. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:776
PHP   9. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHPUnit/Framework/TestResult.php:648
PHP  10. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:831
PHP  11. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:976
PHP  12. Test\Files\View->testLongPath() /usr/share/php/PHPUnit/Framework/TestCase.php:976
PHP  13. OC\Files\Cache\Scanner->scan() /home/deepdiver/Development/ownCloud/core/tests/lib/files/view.php:595
PHP  14. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:184
PHP  15. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  16. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  17. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  18. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  19. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  20. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  21. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  22. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  23. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  24. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  25. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  26. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  27. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  28. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  29. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  30. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  31. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  32. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  33. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  34. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  35. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  36. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  37. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  38. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  39. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  40. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  41. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  42. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  43. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  44. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  45. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  46. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  47. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  48. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  49. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  50. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  51. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  52. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  53. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  54. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  55. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  56. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  57. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  58. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  59. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  60. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  61. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  62. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  63. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  64. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  65. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  66. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  67. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  68. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  69. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  70. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  71. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  72. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  73. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  74. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  75. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  76. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  77. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  78. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  79. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  80. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  81. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  82. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  83. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  84. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  85. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  86. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  87. OC\Files\Cache\Scanner->scanChildren() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:259
PHP  88. OC\Files\Cache\Scanner->scanFile() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:221
PHP  89. OC\Files\Cache\Cache->put() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/scanner.php:159
PHP  90. OC_DB::insertid() /home/deepdiver/Development/ownCloud/core/lib/private/files/cache/cache.php:244
PHP  91. OC\DB\Connection->lastInsertId() /home/deepdiver/Development/ownCloud/core/lib/private/db.php:311
PHP  92. OC\DB\AdapterOCI8->lastInsertId() /home/deepdiver/Development/ownCloud/core/lib/private/db/connection.php:145
PHP  93. OC\DB\Connection->realLastInsertId() /home/deepdiver/Development/ownCloud/core/lib/private/db/adapteroci8.php:18
PHP  94. Doctrine\DBAL\Connection->lastInsertId() /home/deepdiver/Development/ownCloud/core/lib/private/db/connection.php:151
PHP  95. Doctrine\DBAL\Driver\OCI8\OCI8Connection->lastInsertId() /home/deepdiver/Development/ownCloud/core/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:877
PHP  96. Doctrine\DBAL\Driver\OCI8\OCI8Connection->query() /home/deepdiver/Development/ownCloud/core/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php:128
PHP  97. Doctrine\DBAL\Driver\OCI8\OCI8Connection->prepare() /home/deepdiver/Development/ownCloud/core/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php:83
PHP  98. Doctrine\DBAL\Driver\OCI8\OCI8Statement->__construct() /home/deepdiver/Development/ownCloud/core/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php:71
PHP  99. Doctrine\DBAL\Driver\OCI8\OCI8Statement::convertPositionalToNamedPlaceholders() /home/deepdiver/Development/ownCloud/core/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php:57
@DeepDiver1975 DeepDiver1975 added this to the ownCloud 7 milestone May 6, 2014
@bantu
Copy link

bantu commented May 6, 2014

@DeepDiver1975 In this case it seems to be XDebug's xdebug.max_nesting_level setting aborting the execution. I am not sure whether there is a recursion function call limit in PHP.

I suspect the proper solution to this is to just get rid of recursive function calls and use Iterators, e.g. see RecursiveDirectoryIterator http://www.php.net/manual/de/class.recursivedirectoryiterator.php

@datashaman
Copy link

PHP has a max input nesting level, which is for the depth of the input variables GET and POST.
The function nesting level is from xdebug, which should only affect you locally... and can be changed by changing your xdebug.max_nesting_level (details here: http://xdebug.org/docs/all_settings#max_nesting_level)

@DeepDiver1975
Copy link
Member Author

Ah - it's xdebug - did not know this - thx

@bantu bantu added the Low label May 8, 2014
@bantu
Copy link

bantu commented May 8, 2014

I am tagging this "Low" since this should not happen in practise due
a) there not being a limit for recursive function calls (you will nevertheless run out of memory at some point)
b) directory depth of 100 being rather uncommon

@bantu
Copy link

bantu commented Jun 9, 2014

@DeepDiver1975 Unschedule this for oC7? Nobody is supposed to have xdebug in production.

@MTRichards MTRichards modified the milestones: ownCloud 7.0.1, ownCloud 7 Jun 20, 2014
@craigpg craigpg modified the milestones: 2014-sprint-03-next, 2014-sprint-02-current, ownCloud 7 backlog, 2014-sprint-03-current Sep 2, 2014
@craigpg
Copy link

craigpg commented Sep 4, 2014

@DeepDiver1975, is this still a valid issue?

@PVince81 PVince81 mentioned this issue Nov 28, 2014
22 tasks
@DeepDiver1975 DeepDiver1975 modified the milestones: ownCloud 7 backlog, backlog Jan 8, 2015
@ghost ghost removed the p4-low label Jul 28, 2015
@lock
Copy link

lock bot commented Aug 4, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants