Telescope infinite loop issue

未关闭
#10,782 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #11390 来自 @duncanmcclean —— 已关闭,未合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
laravel, php
领域
backend

调研方向

Start with the linked reproduction repository and reproduce the cycle of two entries linking to each other. The stack trace points to Entry.php, AbstractAugmented.php, AugmentedCollection.php, and ArrayableLink.php; trace how link-field augmentation follows the reciprocal entry links. Done means the reproduced case no longer recurses or throws the stack-size error, with a regression test covering the cycle.

由索引模型根据 Issue 内容生成。

描述

laravel performance
Bug description

It seems that this issue is still happening: https://github.com/statamic/cms/issues/5752

My issue, if you are to create a Link field on Entry A that links to Entry B, then on Entry B make a link to Entry A, you get an exception

error_screen

I have reproduced the issue here: https://github.com/ScottPenhall98/Statamic-core-Recursive-Link-bug

I also notice some big performance issues when using Telescope

How to reproduce

if you are to create a Link field on Entry A that links to Entry B, then on Entry B make a link to Entry A

Logs
going into telescope I can see we get an infinite loop. This keeps on happening over and over, I have truncated the text:

[2024-09-10 04:59:55] local.ERROR: Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? {"userId":1,"exception":"[object] (Error(code: 0): Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? at /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php:20)
[stacktrace]
#0 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(328): Illuminate\\Support\\Arr::accessible(Array)
#1 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(666): Illuminate\\Support\\Arr::get(Array, 0, NULL)
#2 /app/vendor/laravel/framework/src/Illuminate/Routing/RouteUrlGenerator.php(204): Illuminate\\Support\\Arr::pull(Array, 0)
#3 [internal function]: Illuminate\\Routing\\RouteUrlGenerator->Illuminate\\Routing\\{closure}(Array)
#4 /app/vendor/laravel/framework/src/Illuminate/Routing/RouteUrlGenerator.php(198): preg_replace_callback('/\\\\{.*?\\\\}/', Object(Closure), 'cp/collections/...')
#5 /app/vendor/laravel/framework/src/Illuminate/Routing/RouteUrlGenerator.php(85): Illuminate\\Routing\\RouteUrlGenerator->replaceRouteParameters('cp/collections/...', Array)
#6 /app/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php(500): Illuminate\\Routing\\RouteUrlGenerator->to(Object(Illuminate\\Routing\\Route), Array, true)
#7 /app/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php(469): Illuminate\\Routing\\UrlGenerator->toRoute(Object(Illuminate\\Routing\\Route), Array, true)
#8 /app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(811): Illuminate\\Routing\\UrlGenerator->route('statamic.cp.col...', Array, true)
#9 /app/vendor/statamic/cms/src/Statamic.php(196): route('statamic.cp.col...', Array)
#10 /app/vendor/statamic/cms/src/helpers.php(9): Statamic\\Statamic::cpRoute('collections.ent...', Array)
#11 /app/vendor/statamic/cms/src/Entries/Entry.php(333): cp_route('collections.ent...', Array)
#12 /app/vendor/statamic/cms/src/Entries/Entry.php(287): Statamic\\Entries\\Entry->cpUrl('collections.ent...')
#13 /app/vendor/statamic/cms/src/Data/AbstractAugmented.php(141): Statamic\\Entries\\Entry->editUrl()
#14 /app/vendor/statamic/cms/src/Fields/Value.php(56): Statamic\\Data\\AbstractAugmented->Statamic\\Data\\{closure}(Object(Statamic\\Fields\\Value))
#15 /app/vendor/statamic/cms/src/Data/AbstractAugmented.php(78): Statamic\\Fields\\Value->resolve()
#16 /app/vendor/statamic/cms/src/Data/AbstractAugmented.php(52): Statamic\\Data\\AbstractAugmented->get('edit_url')
#17 /app/vendor/statamic/cms/src/Fields/Value.php(56): Statamic\\Data\\AbstractAugmented->Statamic\\Data\\{closure}(Object(Statamic\\Fields\\Value))
#18 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(53): Statamic\\Fields\\Value->resolve()
#19 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Object(Statamic\\Fields\\Value), 'edit_url')
#20 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map(Object(Closure), Array, Array)
#21 /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#22 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(53): Illuminate\\Support\\Collection->map(Object(Closure))
#23 /app/vendor/statamic/cms/src/Data/HasAugmentedInstance.php(35): Statamic\\Data\\AugmentedCollection->all()
#24 /app/vendor/statamic/cms/src/Fieldtypes/Link/ArrayableLink.php(17): Statamic\\Entries\\Entry->toAugmentedArray()
#25 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(87): Statamic\\Fieldtypes\\Link\\ArrayableLink->toArray()
#26 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Object(Statamic\\Fieldtypes\\Link\\ArrayableLink), 'link_field')
#27 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map(Object(Closure), Array, Array)
#28 /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#29 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(64): Illuminate\\Support\\Collection->map(Object(Closure))
#30 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(90): Statamic\\Data\\AugmentedCollection->toArray()
#31 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Array, 'link_field')
#32 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map(Object(Closure), Array, Array)
#33 /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#34 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(64): Illuminate\\Support\\Collection->map(Object(Closure))
#35 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(90): Statamic\\Data\\AugmentedCollection->toArray()
#36 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Array, 'link_field')
#37 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map(Object(Closure), Array, Array)
#38 /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#39 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(64): Illuminate\\Support\\Collection->map(Object(Closure))
#40 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(90): Statamic\\Data\\AugmentedCollection->toArray()
#41 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Array, 'link_field')
#42 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map(Object(Closure), Array, Array)
#43 /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#44 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(64): Illuminate\\Support\\Collection->map(Object(Closure))
#45 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(90): Statamic\\Data\\AugmentedCollection->toArray()
#46 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Array, 'link_field')```
Environment
Application Name: _
Laravel Version: 10.48.9
PHP Version: 8.3.6
Composer Version: 2.2.22
Environment: local
Debug Mode: ENABLED
URL: _
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: database
Session: file

Statamic
Addons: 2
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.20.0 Solo

Statamic Addons
jacksleight/statamic-bard-texstyle: 3.2.2
statamic/eloquent-driver: 4.14.1

Statamic Eloquent Driver
Asset Containers: eloquent
Assets: eloquent
Blueprints: file
Collection Trees: eloquent
Collections: eloquent
Entries: eloquent
Forms: file
Global Sets: eloquent
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: eloquent
Revisions: eloquent
Sites: file
Taxonomies: eloquent
Terms: eloquent
Tokens: file
Installation

Fresh statamic/statamic site via CLI

Additional details

No response

主要语言
PHP
星标
4.9k
派生
647
平均合并
1 天 45 分钟
30 天内合并 PR
221

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

statamic/cms 的其他 Issue

查看 statamic/cms 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。