From a390f32bb46065cc5500a8164775004a92db9270 Mon Sep 17 00:00:00 2001 From: Lazizbek Ergashev Date: Tue, 17 Nov 2026 18:54:07 +0000 Subject: [PATCH] fix(routing): remove unsynchronized write in GetFuncInfo (#40409) `GetFuncInfo` wrote the friendly name into `funcInfoNameMap` once without holding `funcInfoMapMu`, right before the same locked write. Concurrent requests hitting that branch could then crash the process with `fatal error: concurrent map writes`. This drops the unlocked write. Fixes: https://github.com/go-gitea/gitea/issues/40407 Assisted-by: Claude Code:claude-opus-5-5 --------- Co-authored-by: Lunny Xiao --- modules/web/routing/funcinfo.go | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/web/routing/funcinfo.go b/modules/web/routing/funcinfo.go index 7776c975b24..932c4a93429 100644 --- a/modules/web/routing/funcinfo.go +++ b/modules/web/routing/funcinfo.go @@ -62,7 +62,6 @@ func GetFuncInfo(fn any, friendlyName ...string) *FuncInfo { info = copyFuncInfo(info) info.shortName = name - funcInfoNameMap[name] = info funcInfoMapMu.Lock() funcInfoNameMap[name] = info funcInfoMapMu.Unlock()