Skip to content

Gocode: panic: listen unix /tmp/gocode-daemon: setsockopt: invalid argument #568

Closed

Description

@tirpen

This is Microsoft Windows 10.14366. Golang 1.6.2

gocode
dial unix /tmp/gocode-daemon.$USER: setsockopt: invalid argument

gocode -s debug
panic: listen unix /tmp/gocode-daemon.aschneider: setsockopt: invalid argument

goroutine 1 [running]:
panic(0x91d1a0, 0xc82006ee10)
/usr/local/go/src/runtime/panic.go:481 +0x3e6
main.new_daemon(0x99b4f8, 0x4, 0xc8200c7ce0, 0x1d, 0x43cc01)
/home/$USER/.go/src/github.com/nsf/gocode/server.go:69 +0x110
main.do_server(0x0)
/home/$USER/.go/src/github.com/nsf/gocode/server.go:38 +0x309
main.main()
/home/$USER/.go/src/github.com/nsf/gocode/gocode.go:67 +0x5f

Activity

  1. sunilmut commented on Jun 23, 2016

    @sunilmut
    Member

    Thanks for reporting the issue. I collected a strace and it appears that gocode is trying to set the SO_BROADCAST option on the UNIX socket, which unfortunately WSL does not support currently.
    socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3 setsockopt(3, SOL_SOCKET, SO_BROADCAST, [1], 4) = -1 EINVAL (Invalid argument)

    I have opened a bug for this, but it won't make the cut for the Anniversary update release. But, it should get fixed post that. If you can also post what is that you are trying to do with gocode, then when the bug gets fixed, we can validate the rest of your workflow also.

    And, thanks for trying out WSL!

  2. tirpen commented on Jun 23, 2016

    @tirpen
    Author

    Hi. Thank you for taking this into account.

    Gocode is called by deoplete-go inside nvim to provide code completion. It is a common workflow for Go development both in Mac and Linux.

  3. therealkenc commented on Jun 24, 2016

    @therealkenc

    I don't use vim or go, but gocode -sock="tcp" starts.

  4. oparoz commented on Aug 13, 2016

    @oparoz

    Sunil Muthuswamy (@sunilmut)

    Here is the use case for me

    # sudo snap install nextcloud
    2016/08/13 11:20:42.752488 main.go:170: WARNING: can not create syslog logger
    error: cannot communicate with server: Post http://localhost/v2/snaps/nextcloud: dial unix /run/snapd.socket: setsockopt: invalid argument
    
  5. russalex commented on Sep 1, 2016

    @russalex
    Contributor

    Try gocode on build 14915. We added support for SO_BROADCAST so that should help. I was able to do an apt-get install gocode and run gocode with no errors.

    I should point out that we do not support snap apps.

  6. sunilmut commented on Sep 1, 2016

    @sunilmut
    Member

    Olivier Paroz (@oparoz) - Thanks. If you can collect a strace of the failing command strace -o <trace_file> -ff <command> and share out the trace file, we can see what socket option the command is failing at. Also, do try it on 14915.

  7. tirpen commented on Sep 3, 2016

    @tirpen
    Author

    Our Gocode + nvim use cases work as intended after 14915, Russ Alexander (@russalex).

    Thank you for addressing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions