Microsoft Edge Engineers Helped Google Track Down a Bug That Was Wiping Chrome User Profiles

Microsoft Edge Engineers Helped Google Track Down a Bug That Was Wiping Chrome User Profiles

A bug lurking inside Chromium — the open-source engine powering Google Chrome, Microsoft Edge, and dozens of other browsers — has been silently wiping user profile settings for years. Google is now preparing a fix, and Microsoft’s engineers spotted the scale of the problem first.

The issue left users opening their browser to what appeared to be a fresh installation. Bookmarks and saved passwords remained intact, but browser preferences and other profile data vanished without warning.

What Was Going Wrong

At the center of the failure is a file called `Local State`, which stores browser-wide settings.

Each time Chromium updates that file, Windows calls a system function — `ReplaceFile` — to swap the old version with the new one. Under normal conditions, that swap takes milliseconds.

Problems arise when a second application, such as antivirus software or a file-indexing tool, locks the directory at precisely the wrong moment. Windows then returns an error code: `ERROR_UNABLE_TO_MOVE_REPLACEMENT_2`.

At that point, the old `Local State` file has already been moved aside but the new one cannot be written in. The browser starts up with no valid settings file, and the profile appears reset.

Microsoft Measured the Damage

Microsoft Edge engineer Ting Shao filed a Chromium bug report earlier this year that put hard numbers on the problem.

Shao said Edge telemetry — anonymized diagnostic data collected from users who opt in — showed the failure sequence hitting roughly 100,000 users on Edge’s stable release channel. Because Edge and Chrome share the same Chromium codebase, engineers from both companies began collaborating on a solution.

A first fix arrived in March. Developers introduced a backup file into the replacement process so the original `Local State` file would not be lost if something interrupted the update mid-write.

That change reduced failures substantially. Still, Microsoft’s telemetry showed the problem persisting for approximately 0.016% of Edge users — a small share of a large user base, but a meaningful number in absolute terms.

The New Fix

Chromium developer Greg Thompson has now submitted a patch that adds another layer of resilience.

Under the new code, when Windows refuses to complete the file replacement, the browser does not give up immediately. Instead, it retries the operation repeatedly, giving any background process — an antivirus scan, an indexing job — time to release its lock on the directory.

If those retries fail, Chromium will make an additional attempt to restore the original file. That fallback reduces the chance the `Local State` file disappears entirely.

The patch does not change how Windows handles file locking at the system level. It makes Chromium more capable of working around that behavior when it occurs.

What Comes Next

The update has cleared initial code review approvals inside the Chromium project and will reach Chromium Canary builds — nightly experimental releases used for early testing — before rolling out to stable versions of Chrome, Edge, and other Chromium-based browsers.

Users will not gain the additional protection until their browser receives that update.

Chromium itself is maintained by Google but accepts contributions from external engineers, including those at Microsoft, which has developed Edge on top of the engine since 2020.

Deepak Gupta

Deepak Gupta is a technologist who loves diving into software development, cybersecurity, and new tech. He aims to make complex topics easy to understand, sharing practical insights with fellow tech enthusiasts. Read more about me at LinkedIn.

Leave a Reply

Your email address will not be published. Required fields are marked *

catbet казино