-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Can't escape from Worksheet's cloning loop and exhausts memory #437
Labels
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I got this issue when the worksheet to clone content an image |
Please consider contributing a PR. The behavior was rather well explained
by OP and it should be possible to unit tests clone behavior rather easily.
|
5 tasks
PowerKiKi
pushed a commit
that referenced
this issue
Aug 5, 2018
When cloning `BaseDrawing`, its worksheet will be set as null and thus be orphaned. But when cloning the worksheet, it will re-assign itself as the new worksheet for the BaseDrawing. That way we avoid recursive cloning of a Worksheet that would clone a BaseDrawing that would clone a Worksheet etc. Fixes #437 Fixes #613
Dfred
pushed a commit
to Dfred/PhpSpreadsheet
that referenced
this issue
Nov 20, 2018
When cloning `BaseDrawing`, its worksheet will be set as null and thus be orphaned. But when cloning the worksheet, it will re-assign itself as the new worksheet for the BaseDrawing. That way we avoid recursive cloning of a Worksheet that would clone a BaseDrawing that would clone a Worksheet etc. Fixes PHPOffice#437 Fixes PHPOffice#613
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is:
File: /PhpSpreadsheet/Worksheet/Worksheet.php
Method: Worksheet->__clone()
Related: #92
What is the expected behavior?
I hope to succeed in copying Worksheet containing relatively many cells but it fails in whiteout as below.
What is the current behavior?
In Worksheet->__clone(), I can see the problem at 'drawingCollection' logic.
When $item is MemoryDrawing, it also has __clone() and try to clone own value. But in case that value is the Worksheet, it causes nested loop(= back to Worksheet->__clone(), to and fro). I haven't copied the sheet never once...
What are the steps to reproduce?
f99eb8d 's Message:
The latter is that but I don't grasp whether it has been solved.
I tried old code(previous of the commit), only declaring clone keyword.
It surely goes well, completed copying in my case but this is just a shallow copy? as the message said. So I would appreciate if you have another look at this issue.
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet: 1.2.0
PHP: 7.0.16
The text was updated successfully, but these errors were encountered: