Run emulator and attempt to deploy a contract. A simple contract like the following deploys with v2.2.12, but results in the reported error with the latest v2.2.13
Deploying any contract or contract interface with deployment-related CLI commands succeeds.
❯ flow accounts add-contract cadence/contracts/A.cdc
❌ Crash detected!
✔ No
Please help us improve the Flow CLI by opening an issue on https://github.com/onflow/flow-cli/issues,
and pasting the output as well as a description of the actions you took that resulted in this crash.
runtime error: invalid memory address or nil pointer dereference
[] []
map[device:map[arch:arm64 num_cpu:8] os:map[name:darwin] runtime:map[go_maxprocs:8 go_numcgocalls:13 go_numroutines:21 name:go version:go1.24.2] trace:map[span_id:ecaf62888c753177 trace_id:8d0a2c98b942a930429ea97eb7991b59]]
goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x64
github.com/onflow/flow-cli/internal/command.initCrashReporting.func1(0x1400062d908, 0x1400197dc80)
github.com/onflow/flow-cli/internal/command/command.go:355 +0x1c8
github.com/getsentry/sentry-go.(*Client).processEvent(0x14000dc4d20, 0x1400062d908?, 0x1400197dc80, {0x1035a4cc0, 0x14001142000})
github.com/getsentry/sentry-go@v0.32.0/client.go:628 +0x26c
github.com/getsentry/sentry-go.(*Client).CaptureEvent(...)
github.com/getsentry/sentry-go@v0.32.0/client.go:444
github.com/getsentry/sentry-go.(*Client).RecoverWithContext(0x14000dc4d20, {0x0, 0x0}, {0x10310e2c0?, 0x104e5d0d0?}, 0x103436300?, {0x1035a4cc0, 0x14001142000})
github.com/getsentry/sentry-go@v0.32.0/client.go:495 +0x198
github.com/getsentry/sentry-go.(*Client).Recover(0x2ad30e6d54d0?, {0x10310e2c0?, 0x104e5d0d0?}, 0x10092fed0?, {0x1035a4cc0?, 0x14001142000?})
github.com/getsentry/sentry-go@v0.32.0/client.go:459 +0x80
github.com/getsentry/sentry-go.(*Hub).Recover(0x14001100b40, {0x10310e2c0?, 0x104e5d0d0?})
github.com/getsentry/sentry-go@v0.32.0/hub.go:330 +0xbc
github.com/getsentry/sentry-go.Recover()
github.com/getsentry/sentry-go@v0.32.0/sentry.go:68 +0x40
panic({0x10310e2c0?, 0x104e5d0d0?})
runtime/panic.go:792 +0x124
math/big.(*Int).Sign(...)
math/big/int.go:48
crypto/ecdsa.pointFromAffine({0x1035d0fa0?, 0x104e5f810?}, 0x0, 0x0)
crypto/ecdsa/ecdsa.go:416 +0x38
crypto/ecdsa.privateKeyToFIPS[...](0x140008fe500, 0x140017cf080)
crypto/ecdsa/ecdsa.go:405 +0x3c
crypto/ecdsa.signFIPS[...](0x140008fe500, 0x1400004b078, {0x1035a68c0?, 0x140001879c0}, {0x14001516120, 0x20, 0x20})
crypto/ecdsa/ecdsa.go:244 +0x70
crypto/ecdsa.SignASN1({0x1035a68c0, 0x140001879c0}, 0x140017cf080, {0x14001516120, 0x20, 0x20})
crypto/ecdsa/ecdsa.go:227 +0x234
crypto/ecdsa.Sign({0x1035a68c0?, 0x140001879c0?}, 0x1?, {0x14001516120?, 0x1400004b198?, 0x101015e08?})
crypto/ecdsa/ecdsa_legacy.go:65 +0x2c
github.com/onflow/crypto.(*prKeyECDSA).signHash(0x14001420810, {0x14001516120?, 0x14000680008?, 0x140013c0000?})
github.com/onflow/crypto@v0.25.2/ecdsa.go:80 +0x54
github.com/onflow/crypto.(*prKeyECDSA).Sign(0x14001420810, {0x140013c0000, 0x15a, 0x160}, {0x1035d0f58, 0x14000f04780})
github.com/onflow/crypto@v0.25.2/ecdsa.go:118 +0x1c0
github.com/onflow/flow-go-sdk/crypto.InMemorySigner.Sign(...)
github.com/onflow/flow-go-sdk@v1.3.3/crypto/crypto.go:133
github.com/onflow/flow-go-sdk.(*Transaction).SignEnvelope(0x140010a6000, {0xf8, 0xd6, 0xe0, 0x58, 0x6b, 0xa, 0x20, 0xc7}, 0x0, ...)
github.com/onflow/flow-go-sdk@v1.3.3/transaction.go:325 +0xc8
github.com/onflow/flowkit/v2/transactions.(*Transaction).Sign(0x14000a34210)
github.com/onflow/flowkit/v2@v2.3.4/transactions/transaction.go:383 +0xa0
github.com/onflow/flowkit/v2.(*Flowkit).prepareTransaction(0x1400197cd80, {0x1035c5af0, 0x104f23820}, 0x14000a34210, 0x140017c4540)
github.com/onflow/flowkit/v2@v2.3.4/flowkit.go:244 +0xdc
github.com/onflow/flowkit/v2.(*Flowkit).AddContract(0x1400197cd80, {0x1035c5af0, 0x104f23820}, 0x140017c4540, {{0x1400107a000, 0x19, 0x219}, {0x0, 0x0, 0x0}, ...}, ...)
github.com/onflow/flowkit/v2@v2.3.4/flowkit.go:342 +0x5bc
github.com/onflow/flow-cli/internal/accounts.init.deployContract.func3({0x14001838e50, 0x1, 0x1}, {{0x0, 0x0}, {0x1026950b3, 0x4}, {0x0, 0x0}, {0x0, ...}, ...}, ...)
github.com/onflow/flow-cli/internal/accounts/contract-add.go:94 +0x2dc
github.com/onflow/flow-cli/internal/command.Command.AddToParent.func1(0x14000dd4800?, {0x14001838e50, 0x1, 0x1})
github.com/onflow/flow-cli/internal/command/command.go:147 +0x4b4
github.com/spf13/cobra.(*Command).execute(0x104ebd4a0, {0x1400004e130, 0x1, 0x1})
github.com/spf13/cobra@v1.9.1/command.go:1019 +0x810
github.com/spf13/cobra.(*Command).ExecuteC(0x14000d27208)
github.com/spf13/cobra@v1.9.1/command.go:1148 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.9.1/command.go:1071
main.main()
github.com/onflow/flow-cli/cmd/flow/main.go:131 +0xce8
Problem
When deploying contracts using
flow deployorflow accounts add-contract, get anil pointer dereferenceSteps to Reproduce
Run emulator and attempt to deploy a contract. A simple contract like the following deploys with v2.2.12, but results in the reported error with the latest v2.2.13
Acceptance Criteria
Deploying any contract or contract interface with deployment-related CLI commands succeeds.
Context
VM bridge deployment
Stack trace