Skip to content

cmd/go/internal/modindex: crash due to nil os.File.file in newImportReader #73111

Description

@gopherbot
#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/test/marker" && test == "Test/codeaction\\change_quote.txt"

Issue created automatically to collect these failures.

Example (log):

=== RUN   Test/codeaction\change_quote.txt
=== PAUSE Test/codeaction\change_quote.txt
=== CONT  Test/codeaction\change_quote.txt
    marker_test.go:284: unmeetable expectation:
          once the following is met:
            completed work "diagnosing opened files" at least 2 times
          must have:
            no Error log messages
        reason:
          postcondition is not met:
            found matching log "2025/03/31 12:13:26 tidy: diagnosing file:///C:/b/s/w/ir/x/t/Testcodeactionchange_quote.txt819942976/001/work/go.mod: err: exit status 2: stderr: panic: runtime error: invalid memory address or nil pointer dereference\n[signal 0xc0000005 code=0x0 addr=0x20 pc=0x8fda89]\n\ngoroutine 47 [running]:\nos.(*File).read(...)\n\tos/file_posix.go:29\nos.(*File).Read(0x20, {0x249c000, 0x1000, 0x1000})\n\tos/file.go:125 +0x49\nbufio.(*Reader).fill(0x25a74a0)\n\tbufio/bufio.go:113 +0xdc\nbufio.(*Reader).Peek(0x25a74a0, 0x3)\n\tbufio/bufio.go:152 +0x6b\ncmd/go/internal/modindex.newImportReader({0x228db60, 0x2f}, {0x1066c40, 0x20})\n\tcmd/go/internal/modindex/build_read.go:44 +0x10c\ncmd/go/internal/modindex.readGoInfo({0x1066c40, 0x21898e8}, 0x23a9e00)\n\tcmd/go/internal/modindex/build_read.go:402 +0x4c\ncmd/go/internal/modindex.getFileInfo({0x21e21c0, 0x22}, {0x22893e0, 0xc}, 0x232c0c0)\n\tcmd/go/internal/modindex/build.go:451 +0x494\ncmd/go/internal/modindex.importRaw({0x2135e60, 0x1a}, {0x2017d9b, 0x7})\n\tcmd/go/internal/modindex/scan.go:220 +0x49e\ncmd/go/internal/modindex.indexPackage({0x2135e60, 0x1a}, {0x2017d80, 0x22})\n\tcmd/go/internal/modindex/scan.go:86 +0x85\ncmd/go/internal/modindex.openIndexPackage.func1()\n\tcmd/go/internal/modindex/read.go:232 +0x17c\ncmd/internal/par.(*ErrCache[...]).Do.func1()\n\tcmd/internal/par/work.go:119 +0x1a\ncmd/internal/par.(*Cache[...]).Do(0x106c180, {{0x2135e60, 0x1a}, {0x2017d80, 0x22}}, 0x2303bf4)\n\tcmd/internal/par/work.go:160 +0x127\ncmd/internal/par.(*ErrCache[...]).Do(0x106b760, {{0x2135e60, 0x1a}, {0x2017d80, 0x22}}, 0x2303c3c)\n\tcmd/internal/par/work.go:118 +0x56\ncmd/go/internal/modindex.openIndexPackage({0x2135e60, 0x1a}, {0x2017d80, 0x22})\n\tcmd/go/internal/modindex/read.go:219 +0x8d\ncmd/go/internal/modindex.GetPackage({0x2135e60, 0x1a}, {0x2017d80, 0x22})\n\tcmd/go/internal/modindex/read.go:151 +0x1fc\ncmd/go/internal/modindex.IsStandardPackage({0x2014870, 0x16}, {0xf3d095, 0x2}, {0x22a701c5, 0x7})\n\tcmd/go/internal/modindex/read.go:692 +0x248\ncmd/go/internal/modload.importFromModules({0x1069ee0, 0x1451920}, {0x22a701c5, 0x7}, 0x20b4180, 0x0, 0x1)\n\tcmd/go/internal/modload/import.go:301 +0x5cb\ncmd/go/internal/modload.(*loader).load(0x2088f50, {0x1069ee0, 0x1451920}, 0x22c6150)\n\tcmd/go/internal/modload/load.go:1860 +0xa5\ncmd/go/internal/modload.(*loader).pkg.func1.1()\n\tcmd/go/internal/modload/load.go:1673 +0x33\ncmd/internal/par.(*Queue).Add.func1()\n\tcmd/internal/par/queue.go:58 +0x57\ncreated by cmd/internal/par.(*Queue).Add in goroutine 36\n\tcmd/internal/par/queue.go:56 +0x194\n\n"
--- FAIL: Test/codeaction\change_quote.txt (3.44s)

watchflakes

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    Status
    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions