-
Notifications
You must be signed in to change notification settings - Fork 332
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
Panic with "unknown userid" and "runtime error: invalid memory address or nil pointer dereference" #191
Comments
@leira Looking at lookup_stubs.go I feel like it should have already use As far as I understand, nix builds from source. Can you make sure you have a relatively new go installation? I think they changed something in |
@leira Closing this issue as unfortunately there is no way for me to reproduce or solve it on my own. Feel free to add further feedback on the issue if you like. |
@gokcehan I didn't have a chance to revisit the issue yet. Thanks for closing it. I will reopen it when I have more information. |
Ran into this as well. The issue can be reproduced by running
The problem is that even when when Anyway, it's probably not a big issue, not a lot of people will be running something on Linux without |
@danieldk Thanks for the report. It looks like there has been changes in lookup_stubs.go the last time I visit this issue. It seems that our manual check for I'm not familiar with nix. Does it install our prebuilt-binaries or build the package from the source? If latter, which version of Go are you using? For prebuilt-binaries, it seems that we're still using the default Go version in Travis, which is Go1.11. Fallback behavior may not have been available in this version. I guess maybe it is a good idea to bump the go version in Travis, though I don't like messing around with the build system. Go team already seems to be interested in covering corner cases. In the long term, I think we should simply change our code to call |
We build from source, currently using Go 1.14.x.
Sounds good! I think it is perfectly reasonable to fail when |
Hi all, While I don't use lf myself (yet? I saw it for the first time yesterday), I got pointed to this bug. And because I like Nix(OS) and Go and had a few minutes to spare, I wrote a hacky fix of this to make it work in bubblewrap and on gLinux. It just uses I've also wrapped that into a self-contained Nix overlay, so if you're using Nix, you can just put overlays.nix in The patch and overlays.nix are here: https://gist.github.com/Patagonicus/56977ce9bb3ce4a8d1ba536214aef4c1 They are based on the commit at tag Cheers, |
Hello ! Thank you for developing lf ! |
Would it be relevant for me to open a PR on this repo with @Patagonicus's patch ? What do you think @gokcehan ? |
FWIW, I only get this error from the version of |
@GaetanLepage Sorry for late reply as I don't look at issues often nowadays. Yes, if you send a PR I can merge it. At this point I don't care how it is supposed to work and why it is not working so it is better to fix it upstream here. |
Disclaimer: I know approximately nothing about go. Ok, after some testing, I found that the problem occurs on my computer when From what I understand, What is exactly happening when |
On the same system I use Why |
When If we want to avoid compiling with Speaking of |
I installed
lf
through nix on gLinux, which is a debian based distribution within Google. When I launchedlf
, it panic'ed and printed: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 usesgUser = 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 refactorgUser
intogHomeDir
andgUserName
, and take the values from $HOME and $USER whenuser.Current()
fails? Or at least fail on the spot rather than trigger a panic later on?The text was updated successfully, but these errors were encountered: