ethereum-optimism / superchain-registry

An index of chains which serves as the source of truth for who’s in the Superchain Ecosystem
MIT License
84 stars 99 forks source link

ci: flakey nil pointer dereference during add-chain tests #635

Open parkgunou opened 1 month ago

parkgunou commented 1 month ago

Bug Description

Noticed a segmentation fault in one of the hourly CI workflow, for golang-test job.

This has not re-occurred since, but was unable to completely root cause the problem with the existing logs, so leaving an issue in case it re-occurs in the future.

The segmentation fault occurs with the urfave/cli library, where one of the inner methods that parse string receives a null value instead of a string during setup. I suspect there must have been some kind of memory corruption in the runtime that altered the string value, because no code changes were made around the time and all other executions completed without any issues.

Steps to Reproduce

Not reproducible

Expected behavior

No segmentation fault happens and the application runs fine for testing.

Environment Information:

Refer to CI job (#8583)’s golang test (golang-test (32820) job).

Configurations:

Logs:

The error log:

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4cb1b8]

goroutine 107 [running]:
testing.tRunner.func1.2({0xfbf580, 0x1c24900})
        /usr/local/go/src/testing/testing.go:1545 +0x238
testing.tRunner.func1()
        /usr/local/go/src/testing/testing.go:1548 +0x397
panic({0xfbf580?, 0x1c24900?})
        /usr/local/go/src/runtime/panic.go:914 +0x21f
strconv.appendQuotedWith({0xc000251658?, 0xc0000bb8b0?, 0x10000005af93f?}, {0x0, 0x13}, 0x22, 0x0?, 0x0?)
        /usr/local/go/src/strconv/quote.go:41 +0x158
strconv.AppendQuote(...)
        /usr/local/go/src/strconv/quote.go:135
fmt.(*fmt).fmtQ(0xc000251630, {0x0, 0xc0000bb940?})
        /usr/local/go/src/fmt/format.go:457 +0xd6
fmt.(*pp).fmtString(0xc0003be1e0?, {0x0?, 0x2?}, 0xbb920?)
        /usr/local/go/src/fmt/print.go:503 +0x35
fmt.(*pp).printArg(0xc0002515f0, {0xf5e160?, 0xc00061a1f0}, 0x71)
        /usr/local/go/src/fmt/print.go:741 +0x1bb
fmt.(*pp).doPrintf(0xc0002515f0, {0x10fdcde, 0x2}, {0xc000237ae0?, 0x1, 0x1})
        /usr/local/go/src/fmt/print.go:1077 +0x39e
fmt.Sprintf({0x10fdcde, 0x2}, {0xc0000bbae0, 0x1, 0x1})
        /usr/local/go/src/fmt/print.go:239 +0x53
github.com/urfave/cli/v2.(*StringFlag).GetDefaultText(0xc00061a1d0?)
        /home/circleci/go/pkg/mod/github.com/urfave/cli/v2@v2.27.4/flag_string.go:42 +0x8b
github.com/ethereum/go-ethereum/internal/flags.FlagString({0x1521a78?, 0x1c3dba0?})
        /home/circleci/go/pkg/mod/github.com/ethereum-optimism/op-geth@v1.101408.0-rc.4.0.20240828150145-60038121c757/internal/flags/helpers.go:167 +0xd8
github.com/urfave/cli/v2.(*StringFlag).String(0xfb1fa0?)
        /home/circleci/go/pkg/mod/github.com/urfave/cli/v2@v2.27.4/zz_generated.flags.go:688 +0x24
github.com/urfave/cli/v2.(*defaultFlagCategories).AddFlag(0xc0005c8038, {0x0, 0x0}, {0x1521a78, 0x1c3dba0})
        /home/circleci/go/pkg/mod/github.com/urfave/cli/v2@v2.27.4/category.go:132 +0x112
github.com/urfave/cli/v2.newFlagCategoriesFromFlags({0xc0005ae340, 0xe, 0x0?})
        /home/circleci/go/pkg/mod/github.com/urfave/cli/v2@v2.27.4/category.go:118 +0x235
github.com/urfave/cli/v2.(*App).Setup(0x1c43620)
        /home/circleci/go/pkg/mod/github.com/urfave/cli/v2@v2.27.4/app.go:262 +0x925
github.com/urfave/cli/v2.(*App).RunContext(0x1c43620, {0x1521a40?, 0x1cdfc60}, {0xc000221f80, 0x3, 0x3})
        /home/circleci/go/pkg/mod/github.com/urfave/cli/v2@v2.27.4/app.go:314 +0x45
github.com/urfave/cli/v2.(*App).Run(...)
        /home/circleci/go/pkg/mod/github.com/urfave/cli/v2@v2.27.4/app.go:307
github.com/ethereum-optimism/superchain-registry/add-chain.runApp({0xc000221f80, 0x3, 0x3})
        /home/circleci/project/add-chain/main.go:80 +0x131
github.com/ethereum-optimism/superchain-registry/add-chain.TestAddChain_CheckRollupConfig.func1(0x0?)
        /home/circleci/project/add-chain/e2e_test.go:146 +0x11b
testing.tRunner(0xc000602680, 0xc0004ce480)
        /usr/local/go/src/testing/testing.go:1595 +0xff
created by testing.(*T).Run in goroutine 106
        /usr/local/go/src/testing/testing.go:1648 +0x3ad

Additional context


⚠️ Notice: Issues that do not include the following sections will be subject to closure:

Please ensure all required sections are filled out accurately to expedite the debugging process and improve issue resolution efficiency.