google / oauth2l

oauth2l ("oauth tool") is a simple CLI for interacting with Google API authentication.
Apache License 2.0
651 stars 81 forks source link

Segfault on MACOS Monterey #143

Closed luissantos closed 7 months ago

luissantos commented 2 years ago

I've tried reinstalling it and deleting all the local configs but without success. Tested with the latest master commit and the version available through homebrew.

➜  Desktop uname -a                                                                                                                                                                                   ~/Desktop
Darwin ************* 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64 i386 Darwin
➜  Desktop oauth2l fetch --scope=https://mail.google.com/ --refresh                                                                                                                                   ~/Desktop
panic: runtime error: invalid memory address or nil pointer dereference

[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x12a7609]

goroutine 1 [running]:
github.com/google/oauth2l/util.authorization3LOLoopback({0xc0001c0000, 0x13c}, {0xf4?, 0x9?}, 0xc000075f70)
        /private/tmp/oauth2l-20220720-4107-1ir1j37/oauth2l-1.3.0/util/auth-handlers.go:78 +0x49
github.com/google/oauth2l/util.Get3LOAuthorizationHandler.func1({0xc0001c0000, 0x13c})
        /private/tmp/oauth2l-20220720-4107-1ir1j37/oauth2l-1.3.0/util/auth-handlers.go:39 +0x13d
golang.org/x/oauth2/authhandler.authHandlerSource.Token({{0x13d5f48, 0xc0000160b8}, 0xc00019d030, 0xc0001a06f0, {0x1345eac, 0x5}, 0xc0001a0960})
        /private/tmp/oauth2l-20220720-4107-1ir1j37/oauth2l-1.3.0/vendor/golang.org/x/oauth2/authhandler/authhandler.go:80 +0x1b6
golang.org/x/oauth2.(*reuseTokenSource).Token(0xc00007e760)
        /private/tmp/oauth2l-20220720-4107-1ir1j37/oauth2l-1.3.0/vendor/golang.org/x/oauth2/oauth2.go:304 +0xd5
github.com/google/oauth2l/util.FetchToken({0x13d5f48?, 0xc0000160b8?}, 0x8?)
        /private/tmp/oauth2l-20220720-4107-1ir1j37/oauth2l-1.3.0/util/fetch.go:62 +0xdd
github.com/google/oauth2l/util.fetchToken(0xc0000d6370, 0xc00019ccb0)
        /private/tmp/oauth2l-20220720-4107-1ir1j37/oauth2l-1.3.0/util/tasks.go:187 +0x1bc
github.com/google/oauth2l/util.Fetch(0x1345eac?, 0xc00019ccb0)
        /private/tmp/oauth2l-20220720-4107-1ir1j37/oauth2l-1.3.0/util/tasks.go:79 +0x25
main.main()
        /private/tmp/oauth2l-20220720-4107-1ir1j37/oauth2l-1.3.0/main.go:426 +0x16a8
ulisesL commented 2 years ago

Hi @luissantos, it looks like the command above is missing --credentials. Please take a look at this example.