Skip to content

Fix stack overflow in BehaviorServiceAdornerCollectionEnumerator#9411

Merged
dreddy-work merged 2 commits intodotnet:mainfrom
elachlan:BehaviorServiceAdornerCollectionEnumerator-StackOverflow
Jul 3, 2023
Merged

Fix stack overflow in BehaviorServiceAdornerCollectionEnumerator#9411
dreddy-work merged 2 commits intodotnet:mainfrom
elachlan:BehaviorServiceAdornerCollectionEnumerator-StackOverflow

Conversation

@elachlan
Copy link
Contributor

@elachlan elachlan commented Jul 3, 2023

Fixes #9410 - The parameter must be cast first before calling GetEnumerator.
Repeated frames:

System.Windows.Forms.Design.dll!System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollectionEnumerator.BehaviorServiceAdornerCollectionEnumerator(System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection mappings) Line 13	C#
 	System.Windows.Forms.Design.dll!System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.GetEnumerator() Line 217	C#
System.Windows.Forms.Design.dll!System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollectionEnumerator.BehaviorServiceAdornerCollectionEnumerator(System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection mappings) Line 15	C#
 	[The 2 frame(s) above this were repeated 9584 times]	

Caused by #9341

Microsoft Reviewers: Open in CodeFlow

@elachlan elachlan requested a review from a team as a code owner July 3, 2023 08:03
@ghost ghost assigned elachlan Jul 3, 2023
@elachlan
Copy link
Contributor Author

elachlan commented Jul 3, 2023

CC: @halgab

@elachlan
Copy link
Contributor Author

elachlan commented Jul 3, 2023

@Nora-Zhou01 I have tested this fix and it works. Can you please verify?

@Nora-Zhou01
Copy link
Contributor

@elachlan This issue has been fixed, SplitContainer splitter and other controls can now be moved in size.

fix.mp4

@Nora-Zhou01
Copy link
Contributor

Nora-Zhou01 commented Jul 3, 2023

@elachlan I can't change the size of the picturebox control in the designer workspace, but can resized it by that properties window. I found two errors when resizing picturebox control under DemoConsole application without your this PR change. Can you please look at the issue about resizing pictureBox control in designer by mouse?

Without PR: Two errors when changing the size of the picture box control or dragging it
image
image

Call stack:
System.StackOverflowException
HResult=0x800703E9
Message=Exception of type 'System.StackOverflowException' was thrown.

With PR: cannot change the size of the picturebox control in the designer workspace, but can resize it through the properties window.

WITH.mp4

@elachlan
Copy link
Contributor Author

elachlan commented Jul 3, 2023

Related: #8522

@Tanya-Solyanik
Copy link
Contributor

@Nora-Zhou01 - could you please open an issue for picturebox resizing, if there is none yet.

Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you jumping on this crash, @elachlan!

@Tanya-Solyanik Tanya-Solyanik added the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Jul 3, 2023
Copy link
Contributor

@dmitrii-drobotov dmitrii-drobotov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dreddy-work dreddy-work merged commit 9c4aaae into dotnet:main Jul 3, 2023
@ghost ghost added this to the 8.0 Preview7 milestone Jul 3, 2023
@ghost ghost removed the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Jul 3, 2023
@elachlan elachlan deleted the BehaviorServiceAdornerCollectionEnumerator-StackOverflow branch July 3, 2023 22:09
@ghost ghost locked as resolved and limited conversation to collaborators Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Moving the SplitContainer splitter size at runtime crashes the DemoConsole application.

5 participants