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

CLI crash when creating emulator account #1902

Closed
j1010001 opened this issue Mar 23, 2025 · 2 comments
Closed

CLI crash when creating emulator account #1902

j1010001 opened this issue Mar 23, 2025 · 2 comments
Assignees

Comments

@j1010001
Copy link
Member

Problem

CLI v2.2.7 crashed when creating account on emulator

Steps to Reproduce

in a newly created project (after flow init)
run: flow accounts create

stack trace:

runtime error: invalid memory address or nil pointer dereference
[] []
map[device:map[arch:arm64 num_cpu:14] os:map[name:darwin] runtime:map[go_maxprocs:14 go_numcgocalls:13 go_numroutines:35 name:go version:go1.24.1] trace:map[span_id:3e897b5703539772 trace_id:b8ba43042de2f872e6123344ec9129e0]]
goroutine 1 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:26 +0x64
github.com/onflow/flow-cli/internal/command.initCrashReporting.func1(0x14001cb0008, 0x14001295560)
	github.com/onflow/flow-cli/internal/command/command.go:355 +0x1c8
github.com/getsentry/sentry-go.(*Client).processEvent(0x140011f9c20, 0x14001cb0008?, 0x14001295560, {0x106e7f500, 0x140000e6580})
	github.com/getsentry/[email protected]/client.go:628 +0x26c
github.com/getsentry/sentry-go.(*Client).CaptureEvent(...)
	github.com/getsentry/[email protected]/client.go:444
github.com/getsentry/sentry-go.(*Client).RecoverWithContext(0x140011f9c20, {0x0, 0x0}, {0x1069f2aa0?, 0x1084ce250?}, 0x106d12740?, {0x106e7f500, 0x140000e6580})
	github.com/getsentry/[email protected]/client.go:495 +0x198
github.com/getsentry/sentry-go.(*Client).Recover(0x16c19b20847e0?, {0x1069f2aa0?, 0x1084ce250?}, 0x104257510?, {0x106e7f500?, 0x140000e6580?})
	github.com/getsentry/[email protected]/client.go:459 +0x80
github.com/getsentry/sentry-go.(*Hub).Recover(0x14000ebcfc0, {0x1069f2aa0?, 0x1084ce250?})
	github.com/getsentry/[email protected]/hub.go:330 +0xbc
github.com/getsentry/sentry-go.Recover()
	github.com/getsentry/[email protected]/sentry.go:68 +0x40
panic({0x1069f2aa0?, 0x1084ce250?})
	runtime/panic.go:792 +0x124
math/big.(*Int).Sign(...)
	math/big/int.go:48
crypto/ecdsa.pointFromAffine({0x106eaa758?, 0x1084d0970?}, 0x0, 0x0)
	crypto/ecdsa/ecdsa.go:416 +0x38
crypto/ecdsa.privateKeyToFIPS[...](0x1400155d200, 0x14001543980)
	crypto/ecdsa/ecdsa.go:405 +0x3c
crypto/ecdsa.signFIPS[...](0x1400155d200, 0x10683ada0, {0x106e811c0?, 0x14000992370}, {0x140001e5de0, 0x20, 0x20})
	crypto/ecdsa/ecdsa.go:244 +0x70
crypto/ecdsa.SignASN1({0x106e811c0, 0x14000992370}, 0x14001543980, {0x140001e5de0, 0x20, 0x20})
	crypto/ecdsa/ecdsa.go:227 +0x234
crypto/ecdsa.Sign({0x106e811c0?, 0x14000992370?}, 0x1?, {0x140001e5de0?, 0x14000fed238?, 0x104933828?})
	crypto/ecdsa/ecdsa_legacy.go:65 +0x2c
github.com/onflow/crypto.(*prKeyECDSA).signHash(0x14000b67938, {0x140001e5de0?, 0x1087a8c40?, 0x14000f8f600?})
	github.com/onflow/[email protected]/ecdsa.go:80 +0x54
github.com/onflow/crypto.(*prKeyECDSA).Sign(0x14000b67938, {0x14000f8f600, 0xd11, 0xd80}, {0x106eaa710, 0x140009bbc80})
	github.com/onflow/[email protected]/ecdsa.go:118 +0x1c0
github.com/onflow/flow-go-sdk/crypto.InMemorySigner.Sign(...)
	github.com/onflow/[email protected]/crypto/crypto.go:133
github.com/onflow/flow-go-sdk.(*Transaction).SignEnvelope(0x140001f2900, {0xf8, 0xd6, 0xe0, 0x58, 0x6b, 0xa, 0x20, 0xc7}, 0x0, ...)
	github.com/onflow/[email protected]/transaction.go:325 +0xc8
github.com/onflow/flowkit/v2/transactions.(*Transaction).Sign(0x14000acce58)
	github.com/onflow/flowkit/[email protected]/transactions/transaction.go:345 +0xa0
github.com/onflow/flowkit/v2.(*Flowkit).prepareTransaction(0x140014b0d80, {0x106e9fa50, 0x1087dc5c0}, 0x14000acce58, 0x140013ef8f0)
	github.com/onflow/flowkit/[email protected]/flowkit.go:244 +0xdc
github.com/onflow/flowkit/v2.(*Flowkit).CreateAccount(0x140014b0d80, {0x106e9fa50, 0x1087dc5c0}, 0x140013ef8f0, {0x14001517410?, 0x106bd5a60?, 0x1068c0a01?})
	github.com/onflow/flowkit/[email protected]/flowkit.go:183 +0x270
github.com/onflow/flow-cli/internal/accounts.createEmulatorAccount(0x14000fed848?, {0x106ecb6b8, 0x140014b0d80}, {0x140017c0e90, 0xc}, {0x106eadec0, 0x14000accca8})
	github.com/onflow/flow-cli/internal/accounts/create-interactive.go:184 +0xd8
github.com/onflow/flow-cli/internal/accounts.createInteractive(0x140013ef920)
	github.com/onflow/flow-cli/internal/accounts/create-interactive.go:78 +0x3c0
github.com/onflow/flow-cli/internal/accounts.create({0x14000feda08?, 0x0?, 0x0?}, {{0x0, 0x0}, {0x105f947cc, 0x4}, {0x0, 0x0}, {0x0, ...}, ...}, ...)
	github.com/onflow/flow-cli/internal/accounts/create.go:66 +0x34
github.com/onflow/flow-cli/internal/command.Command.AddToParent.func1(0x1400125d300?, {0x1087dc5c0, 0x0, 0x0})
	github.com/onflow/flow-cli/internal/command/command.go:147 +0x4b4
github.com/spf13/cobra.(*Command).execute(0x10852e520, {0x14000198590, 0x0, 0x0})
	github.com/spf13/[email protected]/command.go:989 +0x818
github.com/spf13/cobra.(*Command).ExecuteC(0x14000b98f08)
	github.com/spf13/[email protected]/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:1041
main.main()
	github.com/onflow/flow-cli/cmd/flow/main.go:131 +0xc2c
@jribbink
Copy link
Contributor

jribbink commented Mar 24, 2025

This is related to Homebrew/homebrew-core#216372. The Homebrew formulae is not pinned to a specfic Go version and has recently updated to go1.24.

The specific problem is likely in an upstream package (e.g. github.com/onflow/crypto) and will be resolved when this repo updates to go1.24 and makes the required changes.

For this reason, this bug only affects Homebrew builds, but manual installs remain functional.

jribbink added a commit to jribbink/homebrew-core that referenced this issue Mar 24, 2025
Pin the go dependency to 1.23 due to onflow/flow-cli#1902 and
create a new revision due to the faulty release causing CLI crashes
jribbink added a commit to jribbink/homebrew-core that referenced this issue Mar 25, 2025
Pin the go dependency to 1.23 due to onflow/flow-cli#1902 and
create a new revision due to the faulty release causing CLI crashes
@stefanb
Copy link

stefanb commented Mar 25, 2025

I suggest you to try fixing this, to not depend on Go 1.23, which will be supported only until August 2025 when Go 1.25 is scheduled for release and support for Go 1.23 will be dropped.
See https://go.dev/wiki/Go-Release-Cycle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants