Skip to content

Windows replacement can leave an owned backup #1352

Backlog

Description

DISCLOSURE: LLM-GENERATED TEXT

On Windows, a successful DurableFile.TryWriteAllBytes can leave the generated backup indefinitely when the previous file has a live image section. ReplaceFile publishes the new bytes successfully. The following delete of the owned backup fails, and the staging cleanup helper suppresses that error. Replacement path on main

A native Unity 6000.6.7f1 control on Windows 11 build 26300 stages new bytes over a disposable PE file while holding an image-section mapping on the previous file. The package reports success, the destination has the exact new bytes, and its .<guid>.bak with the previous bytes remains after closing the mapping. A direct Win32 replacement control followed by independent cleanup reproduced the reason. Ordinary deletion and the extended deletion mode both returned access denied while the mapping was held. Both also respected a separate reader that denied delete sharing. Normal cleanup passed after the corresponding handle closed.

Acceptance

  • Exercise the real Windows replacement entry point with and without the mapped image control. Verify that published bytes and any retained backup are internally consistent.
  • Give callers a defined outcome for cleanup refusal and establish when the package can reclaim its own backup. Preserve a successful publication and the existing recovery contract for failed publication.
  • Preserve exclusive ownership, normal immediate cleanup and ordinary sharing restrictions. Exercise repeat writes and cleanup when the handle closes.

Related to #1155 and #1302. The separate historical prefab replacement failure remains under #1155.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions