Telescope infinite loop issue

Đang mở
#10,782 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

  • #11390 của @duncanmcclean — đã đóng, không merge

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
laravel, php
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
PHP
Star
4.9k
Fork
647
Merge trung bình
1 ngày 45 phút
Pull request đã merge (30 ngày)
221

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của statamic/cms

Tất cả issue của statamic/cms

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.