Lazygit: Panic error after installing in MacOS

Created on 17 Aug 2018  路  24Comments  路  Source: jesseduffield/lazygit

Most helpful comment

Either set LC_ALL to C or your default locale and the crashing should go away.

All 24 comments

main.go Line 66 - 68 state :

66 : app, err := app.NewApp(appConfig)
67 : app.Log.Info(err)
68 : app.GitCommand.SetupGit()

So my guess would be that when app.log tried to log err, err was nil.
What is strange is when I try to reproduce this error I can't seem to get it.

@vinill Can you apply this patch and tell us if the error goes away?

diff --git a/main.go b/main.go
index c7fec1a..6f9f3fb 100644
--- a/main.go
+++ b/main.go
@@ -64,7 +64,9 @@ func main() {
                Debug:     *debuggingFlag,
        }
        app, err := app.NewApp(appConfig)
-       app.Log.Info(err)
+       if err != nil {
+               app.Log.Info(err)
+       }
        app.GitCommand.SetupGit()
        app.Gui.RunWithSubprocesses()
 }

Copy/paste it into a file named patch and run git apply patch; go build; ./lazygit

@remyabel ah I think I see what's happening here. An error has occured when making the app, but that error occurred before the logger was added to the app struct, meaning that we're getting a nil pointer dereference

actually turns out the logger probably is there, but when there's an error, we're not returning the app.
Gonna fix this in https://github.com/jesseduffield/lazygit/pull/180 (though there'll probably be more troubleshooting here to determine why the the call to NewApp() is failing in the first place)

I have same issue on OS X Elcapitan

it seem that versions after 1.6.1 has that issue

this is the way i downgraded to 1.6.1 version

wget "https://github.com/jesseduffield/lazygit/releases/download/v0.1.61/lazygit_0.1.61_Darwin_x86_64.tar.gz"
tar -xvzf ./lazygit_0.1.61_Darwin_x86_64.tar.gz
cp ./lazygit /usr/local/bin/lazygit

@gomjellie do you still get the error from the latest version?

i just reinstalled current version via brew ('brew reinstall lazygit')

brew info lazygit
jesseduffield/lazygit/lazygit: stable 0.1.66
A simple terminal UI for git commands, written in Go
https://github.com/jesseduffield/lazygit/
/usr/local/Cellar/lazygit/0.1.66 (5 files, 12.0MB) *
  Built from source on 2018-08-19 at 18:00:40
From: https://github.com/jesseduffield/homebrew-lazygit/blob/master/lazygit.rb

0.1.66 version still not working on mine

this is the error log

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1573f4b]

goroutine 1 [running]:
main.main()
    /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/main.go:55 +0x14b

@gomjellie In version 0.1.72 https://github.com/jesseduffield/lazygit/releases/latest we no longer panic there, although it's likely that some other bug is going on. Could you grab that version and see what happens at startup?

version 1.7.72 make panic on mine

panic: Could not detect Language

goroutine 1 [running]:
main.main()
    /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/main.go:60 +0x305

Looks like that error originates from here: https://github.com/cloudfoundry-attic/jibber_jabber Please open an issue there.

Meanwhile, what's the output when you run the locale command?

LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

ah... empty LANG, LC_ALL makes problems?

Either set LC_ALL to C or your default locale and the crashing should go away.

@remyabel thanks! changing LC_ALL to en_US.UTF-8 works!

@gomjellie So I understand everything goes solid now?

@glvr182 yeah, everything works fine on mine.

@gomjellie Good to hear!

@vinill Is the issue solved in the latest version?

It is not fixed in 0.1.73 @glvr182

But it works by specifying LC_ALL as @remyabel suggested.

LC_ALL="C" lazygit 

Any objections to making lazygit use 'C' as the default when the jibber jabber package fails to find a language?

0.1.73

panic: Could not detect Language

goroutine 1 [running]:
main.main()
    /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/main.go:44 +0x28a
jesseduffield/lazygit/lazygit: stable 0.1.73
A simple terminal UI for git commands, written in Go
https://github.com/jesseduffield/lazygit/
/usr/local/Cellar/lazygit/0.1.73 (5 files, 12MB) *
  Built from source on 2018-08-20 at 11:09:49
From: https://github.com/jesseduffield/homebrew-lazygit/blob/master/lazygit.rb

this is fixed (hopefully) in https://github.com/jesseduffield/lazygit/pull/191
Please install the latest release and let me know if that resolves your issue

The new version fixes the problem.
@jesseduffield

Confirmed to be working in 0.1.76

Was this page helpful?
0 / 5 - 0 ratings