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

x/tools/gopls: automated issue report (crash) - "failed to find terminating 0 byte in dirent" #50428

Closed
ClarkQAQ opened this issue Jan 3, 2022 · 5 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@ClarkQAQ
Copy link

ClarkQAQ commented Jan 3, 2022

gopls version: v0.7.4
gopls flags:
update flags: proxy
extension version: 0.30.0
go version: 1.17.5
environment: Visual Studio Code linux
initialization error: undefined
issue timestamp: Mon, 03 Jan 2022 02:38:09 GMT
restart history:
Mon, 03 Jan 2022 02:35:15 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: failed to find terminating 0 byte in dirent

goroutine 2031 [running]:
golang.org/x/tools/internal/fastwalk.direntNamlen(0xc00183a708)
	  fastwalk_dirent_namlen_linux.go:26  0x8d
golang.org/x/tools/internal/fastwalk.parseDirEnt({0xc0017448f0, 0x440, 0xc001a2e5b0})
	  fastwalk_unix.go:118  0x13b
golang.org/x/tools/internal/fastwalk.readDir({0xc0008a0300, 0x20}, 0xc001745eb8)
	  fastwalk_unix.go:47  0x22f
golang.org/x/tools/internal/fastwalk.(*walker).walk(0xc001ffe660, {0xc0008a0300, 0x20}, 0x0)
	  fastwalk.go:195  0xaf
golang.org/x/tools/internal/fastwalk.(*walker).doWork(0xc001ffe660, 0xc005092410)
	  fastwalk.go:134  0x125
created by golang.org/x/tools/internal/fastwalk.Walk
	  fastwalk.go:81  0x217
[Error - 上午10:37:58] 

OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.

NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.

<OPTIONAL: ATTACH LOGS HERE>

@hyangah hyangah changed the title Jan 4, 2022
@hyangah hyangah transferred this issue from golang/vscode-go Jan 4, 2022
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jan 4, 2022
@gopherbot gopherbot added this to the Unreleased milestone Jan 4, 2022
@findleyr
Copy link
Contributor

findleyr commented Jan 4, 2022

A quick query indicates that this is triggered via goimports: the gopathwalk package is the only caller, which in turn only used by goimports.

In that case, this code has not changed in a long time.

Moving to gopls/v0.7.5 for further triage, but I think this can be bumped out of that milestone if the fix is not obvious.

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.7.5 Jan 4, 2022
@findleyr findleyr added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 4, 2022
@findleyr
Copy link
Contributor

findleyr commented Jan 7, 2022

Ok, I looked into this.

I think this could only happen if you're using a linux file system that support filenames longer than 255 bytes, such as ReiserFS. Are you doing that?

@findleyr findleyr modified the milestones: gopls/v0.7.5, gopls/unplanned Jan 7, 2022
@findleyr findleyr added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 7, 2022
@ClarkQAQ
Copy link
Author

好的,我调查了这个。

我认为这只有在您使用支持超过 255 字节的文件名的 linux 文件系统时才会发生,例如 ReiserFS。你这样做吗?

No, I use ext4....

@ClarkQAQ
Copy link
Author

ReiserFS

好的,我调查了这个。

我认为这只有在您使用支持超过 255 字节的文件名的 linux 文件系统时才会发生,例如 ReiserFS。你这样做吗?

fix, the code directory is ntfs...

@findleyr
Copy link
Contributor

findleyr commented Jan 10, 2022

fix, the code directory is ntfs...

Hmm. According to https://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits that should have a maximum pathname of 255 characters (notably characters, not bytes).

Were there by any chance multi-byte characters in your pathname? Presumably in a very long path name to begin with?

@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2022
@golang golang locked and limited conversation to collaborators Jul 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants