# Pinned FRP shutdown compatibility patch

The original third_party/frp snapshot is unchanged. Builds/tests apply exact hash-bound replacements from client-shutdown-race.json via a Go build overlay, generated under target/frp-inprocess/overlay. It is not an executable or DLL.

The upstream v0.71.0 race is Service.stop assigning ctl=nil under ctlMu while keepControllerWorking reads it without ctlMu. A delayed worker can dereference nil. The patch takes a locked local pointer snapshot for each wait and uses the existing snapshot in UpdateAllConfigurer. It changes no auth/protocol/reconnect policy and does not suppress race instrumentation.

Run New-FrpBuildOverlay.ps1 and pass -overlay=<overlay.json> to all Go tests/builds. The source hash and unique anchors must match. Future FRP upgrades require review, never fuzzy patching. Build provenance must report compatibilityPatchApplied=true, even when upstreamSnapshotModified=false. Keep Apache-2.0 source/license notices. This is an explicit compatibility patch, not an unmodified upstream build or a claimed upstream fix.
