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

Open
ClarkQAQ opened this issue Jan 3, 2022 · 5 comments

Comments

@ClarkQAQ
Copy link

@ClarkQAQ 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 gopls: automated issue report (crash) x/tools/gopls: automated issue report (crash) - "failed to find terminating 0 byte in dirent" Jan 4, 2022
@hyangah hyangah transferred this issue from golang/vscode-go Jan 4, 2022
@gopherbot gopherbot added this to the Unreleased milestone Jan 4, 2022
@findleyr
Copy link
Contributor

@findleyr 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 removed this from the Unreleased milestone Jan 4, 2022
@findleyr findleyr added this to the gopls/v0.7.5 milestone Jan 4, 2022
@findleyr
Copy link
Contributor

@findleyr 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 removed this from the gopls/v0.7.5 milestone Jan 7, 2022
@findleyr findleyr added this to the gopls/unplanned milestone Jan 7, 2022
@ClarkQAQ
Copy link
Author

@ClarkQAQ ClarkQAQ commented Jan 10, 2022

好的,我调查了这个。

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

No, I use ext4....

@ClarkQAQ
Copy link
Author

@ClarkQAQ ClarkQAQ commented Jan 10, 2022

ReiserFS

好的,我调查了这个。

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

fix, the code directory is ntfs...

@findleyr
Copy link
Contributor

@findleyr 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?

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

Successfully merging a pull request may close this issue.

None yet
3 participants