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

[1.6 servicing] EnsurePackage*Async() handling options.RegisterNewerIfAvailable(true). RegisterPackageByPackageFull/FamilyNameAsync crash. Test + Warning fixes (#4845) #4864

Merged

Conversation

DrusTheAxe
Copy link
Member

EnsurePackage*Async() not handling options.RegisterNewerIfAvailable(true)

RegisterPackageByPackageFullNameAsync() and RegisterPackageByPackageFullNameAsync() take their target parameter as const hstring& resulting in the reference captured by their implementations' co_await and not the actual value. The caller deallocates the memory before Register... is done with it potentially leading to BadMojo(TM). Tests don't notice it as they're too simple to notice this use-after-free -- the memory maybe deallocated but the memory's not overwritten (yet) in simple loads (like the tests). Larger scale (real world) use with more diverse memory patterns notice the problem (usually as a crash).

ApplicationDataTests_Elevated test cases were blocked state due to user context vs environmental statevs access control (ACLs whee!). Changed RunAs and associated test process setup to play nice together.

Fixed some PackageManagerTests that had incomplete state setup potentially causing false errors if a past previous test failed.

Fixed 400+ build warnings (mostly CS8305 due to [Experimental] attribute, almost all from OAuth generat
ed C#/WinRT)

Removed redundant .props import (fixing a VS warning)

Fixed misleading log message

Removed wrong test cases

Added diagnostics to all Setup fixtures to hunt down Setup failures

Change IsReady tests to RunAs RestrictedUser

Fixed compiler warnings

Split ApplicationDataTests_Elevated to separate source file. Added diagnostics to ApplicationDataTests[_Elevated]. Moved TAEF display+compare support for C++/WinRT hstring into shared file (test/inc/WindowsAppRuntime.Test.TAEF.cppwinrt.h). Added Parameters to ApplicationData tests to (hopefully) troubleshoot failure.

Added whomi /all to build pipeline test output. Changed ApplicationData tests' default to IsolationLevel=Class (not TAEF's default =Module)

Changed PackageManager tests' default to IsolationLevel=Class (not TAEF's default =Module)

Factored tests into separate runs to aid troubleshooting failures

Added suppression of CS8305 (Feature is experimental... duh) as not helpful and negatively helpful (400+ warnings that are, for us, features).

https://task.ms/54835036
https://task.ms/54858998
https://task.ms/54884960

cherry-pick 60a18ba

…. RegisterPackageByPackageFull/FamilyNameAsync crash. Test + Warning fixes (#4845)

EnsurePackage*Async() not handling options.RegisterNewerIfAvailable(true)

RegisterPackageByPackageFullNameAsync() and RegisterPackageByPackageFullNameAsync() take their target parameter as const hstring& resulting in the reference captured by their implementations' co_await and not the actual value. The caller deallocates the memory before Register... is done with it potentially leading to BadMojo(TM). Tests don't notice it as they're too simple to notice this use-after-free -- the memory may be deallocated but the memory's not overwritten (yet) in simple loads (like the tests). Larger scale (real world) use with more diverse memory patterns notice the problem (usually as a crash).

ApplicationDataTests_Elevated test cases were blocked state due to user context vs environmental state vs access control (ACLs whee!). Changed RunAs and associated test process setup to play nice together.

Fixed some PackageManagerTests that had incomplete state setup potentially causing false errors if a past previous test failed.

Fixed 400+ build warnings (mostly CS8305 due to [Experimental] attribute, almost all from OAuth generated C#/WinRT)

Removed redundant .props import (fixing a VS warning)

Fixed misleading log message

Removed wrong test cases

Added diagnostics to all Setup fixtures to hunt down Setup failures

Change IsReady tests to RunAs RestrictedUser

Fixed compiler warnings

Split ApplicationDataTests_Elevated to separate source file. Added diagnostics to ApplicationDataTests[_Elevated]. Moved TAEF display+compare support for C++/WinRT hstring into shared file (test/inc/WindowsAppRuntime.Test.TAEF.cppwinrt.h). Added Parameters to ApplicationData tests to (hopefully) troubleshoot failure.

Added whomi /all to build pipeline test output. Changed ApplicationData tests' default to IsolationLevel=Class (not TAEF's default =Module)

Changed PackageManager tests' default to IsolationLevel=Class (not TAEF's default =Module)

Factored tests into separate runs to aid troubleshooting failures

Added suppression of CS8305 (Feature is experimental... duh) as not helpful and negatively helpful (400+ warnings that are, for us, features).

https://task.ms/54835036
https://task.ms/54858998
https://task.ms/54884960
@DrusTheAxe DrusTheAxe added the area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged) label Nov 8, 2024
@DrusTheAxe DrusTheAxe added this to the 1.6 milestone Nov 8, 2024
@DrusTheAxe DrusTheAxe requested a review from kythant November 8, 2024 20:53
@DrusTheAxe DrusTheAxe self-assigned this Nov 8, 2024
@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

@DrusTheAxe DrusTheAxe closed this Nov 8, 2024
@DrusTheAxe DrusTheAxe reopened this Nov 8, 2024
@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe DrusTheAxe requested a review from codendone November 8, 2024 23:35
@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe DrusTheAxe merged commit 244c0b6 into release/1.6-stable Nov 9, 2024
26 checks passed
@DrusTheAxe DrusTheAxe deleted the user/drustheaxe/registernewerifavailable-1.6 branch November 9, 2024 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged) needs-triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PackageDeploymentManager.RegisterPackageAsync() fails while WinRT RegisterPackageByFullNameAsync() succeeds
2 participants