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

encoding/json: Implementing Value() while using json.Marshal on Map Alias throws Panic #59302

Closed
renevall opened this issue Mar 29, 2023 · 6 comments

Comments

@renevall
Copy link

What version of Go are you using (go version)?

$ go version
1.20.2

Does this issue reproduce with the latest release?

I tested both 1.20.1 and 1.20.2. It happened in both.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/reneval/Library/Caches/go-build"
GOENV="/Users/reneval/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/reneval/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/reneval/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.20.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.20.2/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.2"
GCCGO="gccgo"
AR="ar"
CC="cc"
CXX="c++"
CGO_ENABLED="1"
GOMOD="/Users/reneval/Development/getit/bug/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/cz/x7rj1_cs583gjqzy3848j11h0000gn/T/go-build1855770337=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I created a custom type based on a map(an Alias) to store in the database as json. The code ends up looking like:

# definition.go
package main

import (
	"database/sql/driver"
	"encoding/json"
	"errors"
	"fmt"
)

type Content struct {
	Title       string
	Description string
}

type Versions map[string]Content

func (v Versions) Scan(value interface{}) error {
	bytes, ok := value.([]byte)
	if !ok {
		return errors.New(fmt.Sprint("Failed to unmarshal JSONB value:", value))
	}

	return json.Unmarshal(bytes, &v)
}

func (v Versions) Value() (driver.Value, error) {
	if len(v) == 0 {
		return "{}", nil
	}
	return json.Marshal(v)
}

# test.go

func TestVersions_Value(t *testing.T) {
	tests := []struct {
		name    string
		v       Versions
		want    driver.Value
		wantErr bool
	}{
		{
			name: "if the versions are empty, we should return an empty string",
			v:    Versions{},
			want: "{}",
		},
		{
			name: "if the versions are not empty, we should return a string with the versions",
			v: Versions{
				"key": {
					Title:       "Key Title",
					Description: "Key Description",
				},
			},
			want: `{"key":{"title":"Key Title","description":"Key Description"}}`,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			got, err := tt.v.Value()
			if (err != nil) != tt.wantErr {
				t.Errorf("Versions.Value() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if !reflect.DeepEqual(got, tt.want) {
				t.Errorf("Versions.Value() = %v, want %v", got, tt.want)
			}
		})
	}
}

I tracked down the panic to the return json.Marshal(v), getting an error that looks like:

runtime: sp=0x140204e0370 stack=[0x140204e0000, 0x140404e0000]
fatal error: stack overflow

runtime stack:
runtime.throw({0x10114cc52?, 0x1017982e0?})
	/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/panic.go:1047 +0x40 fp=0x16f4e6d20 sp=0x16f4e6cf0 pc=0x100c04aa0
runtime.newstack()
	/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/stack.go:1105 +0x460 fp=0x16f4e6ed0 sp=0x16f4e6d20 pc=0x100c1ed00
runtime.morestack()
	/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:316 +0x70 fp=0x16f4e6ed0 sp=0x16f4e6ed0 pc=0x100c37250

After a while I tried to reproduce the bug on the playground:

https://go.dev/play/p/SlWjiWP2FaB

But I could not reproduce it.

I then tried to run the test in my ubuntu(under wsl2) computer and the bug was showing there.

My next test was to isolate the code in my machine, new project folder, new go mod, just two files. The test runs as intended.

After that, I figure I could try creating a new package/folder under the real app, and put the two files that worked on the side project. The test worked.

So I decided to test the opposite, take all the files of the package giving the error on the real app and past it to the side project. Because this is the "domain" package, I did not need to copy any of the rest of the files of the real app.

You guessed it, the errors shows.

My guess as this point is/was that there could be some low level optimization making the json.Marshall function call the Value() function, entering an endless loop. This would trigger either by the package size or by the imported dependencies.

Finally, changing the Value() to the following bypasses the bug:

func (v Versions) Value() (driver.Value, error) {
	if len(v) == 0 {
		return "{}", nil
	}
	data := make(map[string]interface{})
	for k, v := range v {
		data[k] = v
	}
	return json.Marshal(data)
}

What did you expect to see?

The Value() would return the json encoded version of the map.

What did you see instead?

Output
Running tool: /opt/homebrew/bin/go test -timeout 30s -run ^TestVersions_Value$ example.com/bug/domain

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0x14020700370 stack=[0x14020700000, 0x14040700000]
fatal error: stack overflow

runtime stack:
runtime.throw({0x10509ffee?, 0x10587cda0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/panic.go:1047 +0x40 fp=0x16b8cad20 sp=0x16b8cacf0 pc=0x1049c4aa0
runtime.newstack()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/stack.go:1105 +0x460 fp=0x16b8caed0 sp=0x16b8cad20 pc=0x1049ded00
runtime.morestack()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:316 +0x70 fp=0x16b8caed0 sp=0x16b8caed0 pc=0x1049f7340

goroutine 9 [running]:
sync.(*poolChain).popTail(0x1400074c110?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/sync/poolqueue.go:271 +0xcc fp=0x14020700370 sp=0x14020700370 pc=0x104a04b4c
sync.(*Pool).getSlow(0x10593c680, 0x1)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/sync/pool.go:163 +0x80 fp=0x140207003b0 sp=0x14020700370 pc=0x104a03da0
sync.(*Pool).Get(0x10593c680)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/sync/pool.go:140 +0x80 fp=0x140207003f0 sp=0x140207003b0 pc=0x104a03cc0
encoding/json.newEncodeState()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:303 +0x24 fp=0x14020700420 sp=0x140207003f0 pc=0x104ad9d64
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:158 +0x3c fp=0x140207004e0 sp=0x14020700420 pc=0x104ad952c
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020700500 sp=0x140207004e0 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03800, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020700590 sp=0x14020700500 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020700618?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0xa0?, 0xfa?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x140207005d0 sp=0x14020700590 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x14020700620 sp=0x140207005d0 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03800?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020700680 sp=0x14020700620 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x14020700700 sp=0x14020700680 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x140207007c0 sp=0x14020700700 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x140207007e0 sp=0x140207007c0 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03780, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020700870 sp=0x140207007e0 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x140207008f8?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0x70?, 0xfa?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x140207008b0 sp=0x14020700870 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x14020700900 sp=0x140207008b0 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03780?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020700960 sp=0x14020700900 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x140207009e0 sp=0x14020700960 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020700aa0 sp=0x140207009e0 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020700ac0 sp=0x14020700aa0 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03700, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020700b50 sp=0x14020700ac0 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020700bd8?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0x40?, 0xfa?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020700b90 sp=0x14020700b50 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x14020700be0 sp=0x14020700b90 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03700?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020700c40 sp=0x14020700be0 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x14020700cc0 sp=0x14020700c40 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020700d80 sp=0x14020700cc0 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020700da0 sp=0x14020700d80 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03680, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020700e30 sp=0x14020700da0 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020700eb8?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0x10?, 0xfa?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020700e70 sp=0x14020700e30 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x14020700ec0 sp=0x14020700e70 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03680?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020700f20 sp=0x14020700ec0 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x14020700fa0 sp=0x14020700f20 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020701060 sp=0x14020700fa0 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020701080 sp=0x14020701060 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03600, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020701110 sp=0x14020701080 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020701198?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0xe0?, 0xf9?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020701150 sp=0x14020701110 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x140207011a0 sp=0x14020701150 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03600?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020701200 sp=0x140207011a0 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x14020701280 sp=0x14020701200 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020701340 sp=0x14020701280 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020701360 sp=0x14020701340 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03580, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x140207013f0 sp=0x14020701360 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020701478?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0xb0?, 0xf9?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020701430 sp=0x140207013f0 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x14020701480 sp=0x14020701430 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03580?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x140207014e0 sp=0x14020701480 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x14020701560 sp=0x140207014e0 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020701620 sp=0x14020701560 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020701640 sp=0x14020701620 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03500, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x140207016d0 sp=0x14020701640 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020701758?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0x80?, 0xf9?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020701710 sp=0x140207016d0 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x14020701760 sp=0x14020701710 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03500?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x140207017c0 sp=0x14020701760 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x14020701840 sp=0x140207017c0 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020701900 sp=0x14020701840 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020701920 sp=0x14020701900 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03480, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x140207019b0 sp=0x14020701920 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020701a38?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0x50?, 0xf9?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x140207019f0 sp=0x140207019b0 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x14020701a40 sp=0x140207019f0 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03480?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020701aa0 sp=0x14020701a40 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x14020701b20 sp=0x14020701aa0 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020701be0 sp=0x14020701b20 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020701c00 sp=0x14020701be0 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03400, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020701c90 sp=0x14020701c00 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020701d18?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0x20?, 0xf9?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020701cd0 sp=0x14020701c90 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x14020701d20 sp=0x14020701cd0 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03400?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020701d80 sp=0x14020701d20 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x14020701e00 sp=0x14020701d80 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020701ec0 sp=0x14020701e00 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020701ee0 sp=0x14020701ec0 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03380, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020701f70 sp=0x14020701ee0 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020701ff8?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0xf0?, 0xf8?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020701fb0 sp=0x14020701f70 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x14020702000 sp=0x14020701fb0 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03380?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020702060 sp=0x14020702000 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x140207020e0 sp=0x14020702060 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x140207021a0 sp=0x140207020e0 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x140207021c0 sp=0x140207021a0 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03300, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020702250 sp=0x140207021c0 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x140207022d8?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0xc0?, 0xf8?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020702290 sp=0x14020702250 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x140207022e0 sp=0x14020702290 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03300?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020702340 sp=0x140207022e0 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x140207023c0 sp=0x14020702340 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020702480 sp=0x140207023c0 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x140207024a0 sp=0x14020702480 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03280, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020702530 sp=0x140207024a0 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x140207025b8?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0x90?, 0xf8?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020702570 sp=0x14020702530 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x140207025c0 sp=0x14020702570 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03280?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020702620 sp=0x140207025c0 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x140207026a0 sp=0x14020702620 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020702760 sp=0x140207026a0 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020702780 sp=0x14020702760 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03200, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020702810 sp=0x14020702780 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020702898?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0x60?, 0xf8?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020702850 sp=0x14020702810 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x140207028a0 sp=0x14020702850 pc=0x104ae74b4
encoding/json.(*encodeState).reflectValue(0x14007c03200?, {0x1052b5b60?, 0x14000504d80?, 0x104ad9dc8?}, {0x78?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:358 +0x70 fp=0x14020702900 sp=0x140207028a0 pc=0x104ada3f0
encoding/json.(*encodeState).marshal(0x0?, {0x1052b5b60?, 0x14000504d80?}, {0x0?, 0x0?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:330 +0x110 fp=0x14020702980 sp=0x14020702900 pc=0x104ad9f40
encoding/json.Marshal({0x1052b5b60, 0x14000504d80})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:161 +0x94 fp=0x14020702a40 sp=0x14020702980 pc=0x104ad9584
example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020702a60 sp=0x14020702a40 pc=0x10508db58
encoding/json.marshalerEncoder(0x14007c03180, {0x1052b5b60?, 0x14000504d80?, 0x10536b040?}, {0x60?, 0x5b?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:477 +0xb8 fp=0x14020702af0 sp=0x14020702a60 pc=0x104adaca8
encoding/json.condAddrEncoder.encode({0x10537af40?, 0x10537af90?}, 0x14020702b78?, {0x1052b5b60?, 0x14000504d80?, 0x1052b5b60?}, {0x30?, 0xf8?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/encoding/json/encode.go:960 +0x78 fp=0x14020702b30 sp=0x14020702af0 pc=0x104ade338
encoding/json.condAddrEncoder.encode-fm(0x1052b5b60?, {0x1052b5b60?, 0x14000504d80?, 0x80?}, {0x78?, 0x0?})
:1 +0x54 fp=0x14020702b80 sp=0x14020702b30 pc=0x104ae74b4
...additional frames elided...
created by testing.(*T).Run
/opt/homebrew/Cellar/go/1.20.2/libexec/src/testing/testing.go:1629 +0x370

goroutine 1 [chan receive]:
runtime.gopark(0x1400011e098?, 0x0?, 0xf8?, 0xf9?, 0x10499c93c?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x14001ae5970 sp=0x14001ae5950 pc=0x1049c7470
runtime.chanrecv(0x140000440e0, 0x1400063fa7f, 0x1)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/chan.go:583 +0x468 fp=0x14001ae5a00 sp=0x14001ae5970 pc=0x104995df8
runtime.chanrecv1(0x10593c660?, 0x10523fc40?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/chan.go:442 +0x14 fp=0x14001ae5a30 sp=0x14001ae5a00 pc=0x104995954
testing.(*T).Run(0x140006831e0, {0x1050a37ae?, 0x1fe22cef03ac?}, 0x10537b0f8)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/testing/testing.go:1630 +0x384 fp=0x14001ae5af0 sp=0x14001ae5a30 pc=0x104aa4024
testing.runTests.func1(0x140006831e0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/testing/testing.go:2036 +0x48 fp=0x14001ae5b40 sp=0x14001ae5af0 pc=0x104aa5e08
testing.tRunner(0x140006831e0, 0x1400063fc68)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/testing/testing.go:1576 +0x104 fp=0x14001ae5b90 sp=0x14001ae5b40 pc=0x104aa3314
testing.runTests(0x14000278500?, {0x10592b6e0, 0x9, 0x9}, {0x14000048a00?, 0x40?, 0x10593d300?})
/opt/homebrew/Cellar/go/1.20.2/libexec/src/testing/testing.go:2034 +0x3c4 fp=0x14001ae5c90 sp=0x14001ae5b90 pc=0x104aa5d04
testing.(*M).Run(0x14000278500)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/testing/testing.go:1906 +0x530 fp=0x14001ae5ee0 sp=0x14001ae5c90 pc=0x104aa4a10
main.main()
_testmain.go:63 +0x1a8 fp=0x14001ae5f70 sp=0x14001ae5ee0 pc=0x105095dd8
runtime.main()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:250 +0x200 fp=0x14001ae5fd0 sp=0x14001ae5f70 pc=0x1049c7060
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x14001ae5fd0 sp=0x14001ae5fd0 pc=0x1049f96d4

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x1400006afa0 sp=0x1400006af80 pc=0x1049c7470
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:387
runtime.forcegchelper()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:305 +0xb0 fp=0x1400006afd0 sp=0x1400006afa0 pc=0x1049c72c0
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x1400006afd0 sp=0x1400006afd0 pc=0x1049f96d4
created by runtime.init.6
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:293 +0x24

goroutine 3 [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x1400006b760 sp=0x1400006b740 pc=0x1049c7470
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:387
runtime.bgsweep(0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgcsweep.go:319 +0x100 fp=0x1400006b7b0 sp=0x1400006b760 pc=0x1049b2970
runtime.gcenable.func1()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:178 +0x28 fp=0x1400006b7d0 sp=0x1400006b7b0 pc=0x1049a7968
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x1400006b7d0 sp=0x1400006b7d0 pc=0x1049f96d4
created by runtime.gcenable
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:178 +0x6c

goroutine 4 [GC scavenge wait]:
runtime.gopark(0x14000044070?, 0x1051bbd88?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x1400006bf50 sp=0x1400006bf30 pc=0x1049c7470
runtime.goparkunlock(...)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:387
runtime.(*scavengerState).park(0x10593d380)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgcscavenge.go:400 +0x5c fp=0x1400006bf80 sp=0x1400006bf50 pc=0x1049b083c
runtime.bgscavenge(0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgcscavenge.go:633 +0xa8 fp=0x1400006bfb0 sp=0x1400006bf80 pc=0x1049b0df8
runtime.gcenable.func2()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:179 +0x28 fp=0x1400006bfd0 sp=0x1400006bfb0 pc=0x1049a7908
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x1400006bfd0 sp=0x1400006bfd0 pc=0x1049f96d4
created by runtime.gcenable
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:179 +0xac

goroutine 17 [finalizer wait]:
runtime.gopark(0x1400006a5a8?, 0x600001049a5918?, 0x88?, 0x1b?, 0x1?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x1400006a580 sp=0x1400006a560 pc=0x1049c7470
runtime.runfinq()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mfinal.go:193 +0x100 fp=0x1400006a7d0 sp=0x1400006a580 pc=0x1049a6a30
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x1400006a7d0 sp=0x1400006a7d0 pc=0x1049f96d4
created by runtime.createfing
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mfinal.go:163 +0x80

goroutine 18 [select]:
runtime.gopark(0x14000066778?, 0x3?, 0x0?, 0x0?, 0x14000066762?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x14000066610 sp=0x140000665f0 pc=0x1049c7470
runtime.selectgo(0x14000066778, 0x1400006675c, 0x1400020d100?, 0x0, 0x0?, 0x1)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/select.go:327 +0x68c fp=0x14000066720 sp=0x14000066610 pc=0x1049d7a5c
go.opencensus.io/stats/view.(*worker).start(0x1400020d100)
/Users/reneval/go/pkg/mod/go.opencensus.io@v0.24.0/stats/view/worker.go:292 +0x88 fp=0x140000667b0 sp=0x14000066720 pc=0x105028b88
go.opencensus.io/stats/view.init.0.func1()
/Users/reneval/go/pkg/mod/go.opencensus.io@v0.24.0/stats/view/worker.go:34 +0x28 fp=0x140000667d0 sp=0x140000667b0 pc=0x105027ee8
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x140000667d0 sp=0x140000667d0 pc=0x1049f96d4
created by go.opencensus.io/stats/view.init.0
/Users/reneval/go/pkg/mod/go.opencensus.io@v0.24.0/stats/view/worker.go:34 +0xa0

goroutine 19 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x14000066f40 sp=0x14000066f20 pc=0x1049c7470
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1275 +0xe4 fp=0x14000066fd0 sp=0x14000066f40 pc=0x1049a9744
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x14000066fd0 sp=0x14000066fd0 pc=0x1049f96d4
created by runtime.gcBgMarkStartWorkers
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1199 +0x28

goroutine 33 [GC worker (idle)]:
runtime.gopark(0x1fe2539ada65?, 0x3?, 0x8?, 0x60?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x14000592740 sp=0x14000592720 pc=0x1049c7470
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1275 +0xe4 fp=0x140005927d0 sp=0x14000592740 pc=0x1049a9744
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x140005927d0 sp=0x140005927d0 pc=0x1049f96d4
created by runtime.gcBgMarkStartWorkers
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1199 +0x28

goroutine 20 [GC worker (idle)]:
runtime.gopark(0x1fe2539aad26?, 0x3?, 0x1e?, 0xc0?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x14000067740 sp=0x14000067720 pc=0x1049c7470
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1275 +0xe4 fp=0x140000677d0 sp=0x14000067740 pc=0x1049a9744
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x140000677d0 sp=0x140000677d0 pc=0x1049f96d4
created by runtime.gcBgMarkStartWorkers
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1199 +0x28

goroutine 34 [GC worker (idle)]:
runtime.gopark(0x1fe2539ab4cc?, 0x3?, 0x83?, 0x77?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x14000592f40 sp=0x14000592f20 pc=0x1049c7470
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1275 +0xe4 fp=0x14000592fd0 sp=0x14000592f40 pc=0x1049a9744
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x14000592fd0 sp=0x14000592fd0 pc=0x1049f96d4
created by runtime.gcBgMarkStartWorkers
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1199 +0x28

goroutine 21 [GC worker (idle)]:
runtime.gopark(0x1059759c0?, 0x1?, 0xa8?, 0xde?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x14000067f40 sp=0x14000067f20 pc=0x1049c7470
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1275 +0xe4 fp=0x14000067fd0 sp=0x14000067f40 pc=0x1049a9744
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x14000067fd0 sp=0x14000067fd0 pc=0x1049f96d4
created by runtime.gcBgMarkStartWorkers
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1199 +0x28

goroutine 5 [GC worker (idle)]:
runtime.gopark(0x1fe2539b4eee?, 0x3?, 0x27?, 0xbc?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x1400006c740 sp=0x1400006c720 pc=0x1049c7470
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1275 +0xe4 fp=0x1400006c7d0 sp=0x1400006c740 pc=0x1049a9744
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x1400006c7d0 sp=0x1400006c7d0 pc=0x1049f96d4
created by runtime.gcBgMarkStartWorkers
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1199 +0x28

goroutine 22 [GC worker (idle)]:
runtime.gopark(0x1fe2539ab59c?, 0x3?, 0xd3?, 0x38?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x14000068740 sp=0x14000068720 pc=0x1049c7470
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1275 +0xe4 fp=0x140000687d0 sp=0x14000068740 pc=0x1049a9744
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x140000687d0 sp=0x140000687d0 pc=0x1049f96d4
created by runtime.gcBgMarkStartWorkers
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1199 +0x28

goroutine 6 [GC worker (idle)]:
runtime.gopark(0x1fe2539ab137?, 0x1?, 0x3c?, 0xec?, 0x0?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x1400006cf40 sp=0x1400006cf20 pc=0x1049c7470
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1275 +0xe4 fp=0x1400006cfd0 sp=0x1400006cf40 pc=0x1049a9744
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x1400006cfd0 sp=0x1400006cfd0 pc=0x1049f96d4
created by runtime.gcBgMarkStartWorkers
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/mgc.go:1199 +0x28

goroutine 7 [chan receive]:
runtime.gopark(0x1400011e0a8?, 0x0?, 0xa8?, 0x4d?, 0x10499c93c?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/proc.go:381 +0xe0 fp=0x140000e4d20 sp=0x140000e4d00 pc=0x1049c7470
runtime.chanrecv(0x140000441c0, 0x140000e4e2f, 0x1)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/chan.go:583 +0x468 fp=0x140000e4db0 sp=0x140000e4d20 pc=0x104995df8
runtime.chanrecv1(0x10593c660?, 0x10523fc40?)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/chan.go:442 +0x14 fp=0x140000e4de0 sp=0x140000e4db0 pc=0x104995954
testing.(*T).Run(0x14000683380, {0x1050c779f?, 0x10509dab1?}, 0x1400043efe0)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/testing/testing.go:1630 +0x384 fp=0x140000e4ea0 sp=0x140000e4de0 pc=0x104aa4024
example.com/bug/domain.TestVersions_Value(0x0?)
/Users/reneval/Development/getit/bug/domain/job_test.go:96 +0x14c fp=0x140000e4f60 sp=0x140000e4ea0 pc=0x10508f13c
testing.tRunner(0x14000683380, 0x10537b0f8)
/opt/homebrew/Cellar/go/1.20.2/libexec/src/testing/testing.go:1576 +0x104 fp=0x140000e4fb0 sp=0x140000e4f60 pc=0x104aa3314
testing.(*T).Run.func1()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/testing/testing.go:1629 +0x2c fp=0x140000e4fd0 sp=0x140000e4fb0 pc=0x104aa415c
runtime.goexit()
/opt/homebrew/Cellar/go/1.20.2/libexec/src/runtime/asm_arm64.s:1172 +0x4 fp=0x140000e4fd0 sp=0x140000e4fd0 pc=0x1049f96d4
created by testing.(*T).Run
/opt/homebrew/Cellar/go/1.20.2/libexec/src/testing/testing.go:1629 +0x370
FAIL example.com/bug/domain 1.191s
FAIL

@seankhliao
Copy link
Member

Just to be clear, the issue can happen with the exact test code you gave above?
Maybe upload the built binary? (go test -c)

@rittneje
Copy link

@renevall As per your stack trace, you have defined a custom MarshalJSON method on your Versions type. Not sure what the exact implementation is, but it is causing infinite recursion.

example.com/bug/domain.Versions.MarshalJSON(0x1052b5b60?)
/Users/reneval/Development/getit/bug/domain/job.go:95 +0x28 fp=0x14020700500 sp=0x140207004e0 pc=0x10508db58

@seankhliao
Copy link
Member

not an issue with the Go project then.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2023
@renevall
Copy link
Author

renevall commented Mar 29, 2023

@rittneje @seankhliao The exact implementation is the one you see in the ticket description. The only difference between the minimal code and the one in the real code is that there are other files in the same package. But those files are unrelated since the testing code triggers the bug. The testing code as seen on the description triggers the fatal/panic.

I'll give it another pass to look for more context

@rittneje
Copy link

@renevall Those other files are not unrelated. As per the stack trace, you defined the MarshalJSON method in a different file (job.go). Presumably, your MarshalJSONmethod was (incorrectly) implemented to call json.Marshal on itself, resulting in an infinite recursion.

@renevall
Copy link
Author

Thanks @rittneje. I ended up finding the source of the problem. I had this extra code that relates:

}
func (v Versions) MarshalJSON() ([]byte, error) {
 	return json.Marshal(v)
 }

So your explanation is correct. I was creating the issue myself.

Thank you so much.

@golang golang locked and limited conversation to collaborators Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants