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

Data race in scratch.SetInMap #7230

Open
bep opened this issue May 1, 2020 · 2 comments
Open

Data race in scratch.SetInMap #7230

bep opened this issue May 1, 2020 · 2 comments
Labels
Milestone

Comments

@bep
Copy link
Member

bep commented May 1, 2020

Building sites … fatal error: concurrent map writes

goroutine 63 [running]:
runtime.throw(0x596c369, 0x15)
        /usr/local/go/src/runtime/panic.go:1112 +0x72 fp=0xc003917d60 sp=0xc003917d30 pc=0x4036372
runtime.mapassign_faststr(0x568c460, 0xc003886e40, 0xc0002f2635, 0x8, 0xc001a4f048)
        /usr/local/go/src/runtime/map_faststr.go:291 +0x3de fp=0xc003917dc8 sp=0xc003917d60 pc=0x4015b2e
github.com/gohugoio/hugo/common/maps.(*Scratch).SetInMap(0xc0039080e0, 0xc0002f262e, 0x4, 0xc0002f2635, 0x8, 0x558df40, 0xc001e0b760, 0x0, 0x0)
        /Users/bep/dev/go/gohugoio/hugo/common/maps/scratch.go:119 +0xe5 fp=0xc003917e18 sp=0xc003917dc8 pc=0x442ca35
runtime.call128(0xc002f6bbc0, 0xc003415248, 0xc003022fa0, 0x3800000048)
        /usr/local/go/src/runtime/asm_amd64.s:541 +0x52 fp=0xc003917ea8 sp=0xc003917e18 pc=0x40670a2
reflect.Value.call(0x57475e0, 0xc0039080e0, 0x1613, 0x59092b0, 0x4, 0xc003022f50, 0x3, 0x3, 0xc001e0b760, 0x97, ...)
        /usr/local/go/src/reflect/value.go:460 +0x8ab fp=0xc0039180c0 sp=0xc003917ea8 pc=0x40c908b
reflect.Value.Call(0x57475e0, 0xc0039080e0, 0x1613, 0xc003022f50, 0x3, 0x3, 0x5681000, 0xc0039181b0, 0xc0039181b0)
        /usr/local/go/src/reflect/value.go:321 +0xb4 fp=0xc003918140 sp=0xc0039180c0 pc=0x40c8594
github.com/gohugoio/hugo/tpl/internal/go_templates/texttemplate.safeCall(0x57475e0, 0xc0039080e0, 0x1613, 0xc003022f50, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/bep/dev/go/gohugoio/hugo/tpl/internal/go_templates/texttemplate/funcs.go:352 +0xbd fp=0xc0039181c0 sp=0xc003918140 pc=0x4a437dd
github.com/gohugoio/hugo/tpl/internal/go_templates/texttemplate.(*state).evalCall(0xc003918db8, 0x558df40, 0xc001e

/cc @regisphilibert

@bep bep added the Bug label May 1, 2020
@bep bep modified the milestones: v0.70, v0.71 May 1, 2020
@bep
Copy link
Member Author

bep commented May 1, 2020

Looking at the case in question, I'm hesitant to add a general fix for this -- as it would hurt performance for the common case.

We may consider adding some copy functions so you can do scratch.Get "data" | shallowCopy or something.

@regisphilibert
Copy link
Member

Or... #7232

@bep bep modified the milestones: v0.71, v0.72 May 18, 2020
@bep bep modified the milestones: v0.72, v0.73 May 31, 2020
@bep bep modified the milestones: v0.73, v0.74 Jun 23, 2020
@bep bep modified the milestones: v0.74, v0.75 Jul 13, 2020
@bep bep modified the milestones: v0.75, v0.76 Sep 14, 2020
@bep bep modified the milestones: v0.76, v0.77 Oct 6, 2020
@bep bep modified the milestones: v0.77, v0.78 Oct 30, 2020
@bep bep modified the milestones: v0.78, v0.83 Apr 23, 2021
@bep bep modified the milestones: v0.83, v0.84 May 3, 2021
@bep bep modified the milestones: v0.84, v0.85 Jun 18, 2021
@bep bep removed this from the v0.85 milestone Jul 5, 2021
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 4, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep modified the milestones: v0.122.0, v0.123.0, v0.124.0 Jan 27, 2024
@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@bep bep modified the milestones: v0.125.0, v0.126.0 Apr 23, 2024
@bep bep modified the milestones: v0.126.0, v0.127.0 May 15, 2024
@bep bep modified the milestones: v0.127.0, v0.128.0 Jun 8, 2024
@bep bep modified the milestones: v0.128.0, v0.129.0 Jun 21, 2024
@bep bep modified the milestones: v0.129.0, v0.131.0 Jul 22, 2024
@bep bep modified the milestones: v0.131.0, v0.133.0 Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants