Description
I installed lf
through nix on gLinux, which is a debian based distribution within Google. When I launched lf
, it panic'ed and printed:
2019/06/24 14:45:28 user: user: unknown userid 674665
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x56b17f]
goroutine 1 [running]:
main.init.3()
/build/source/os.go:71 +0x7df
It seems it was triggered by the user.Current()
call on os.go:57. It might be an error only happens with gLinux, as gLinux use a different way to authenticate users, I couldn't find an entry of my user in /etc/passwd. I will try to dig it further when I have time. ranger
worked fine through.
I'm not familiar with golang through, it seems lf
only uses gUser = user.Current()
to get HomeDir and UserName. It did have $HOME and $USER check around os.go:60, but it didn't use them. Maybe refactor gUser
into gHomeDir
and gUserName
, and take the values from $HOME and $USER when user.Current()
fails? Or at least fail on the spot rather than trigger a panic later on?
Activity