Skip to content

relaysrv crash after some weeks of operation #9001

Closed

Description

@phloggu

strelaysrv v1.22.1 "Fermium Flea" (go1.19.2 linux-amd64) [email protected] 2022-11-02 06:27:53 UTC [noupgrade]

After some weeks of operation syncthing relayserver crashes with (from the debug log):

syncthing-relaysrv: panic: runtime error: invalid memory address or nil pointer dereference
syncthing-relaysrv: [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x9cd307]
syncthing-relaysrv: 
syncthing-relaysrv: goroutine 14 [running]:
syncthing-relaysrv: main.listener({0x0?, 0x0?}, {0xaf26dc?, 0x0?}, 0xc00026e000, {0x0, 0x0})
syncthing-relaysrv: #011github.com/syncthing/syncthing/cmd/strelaysrv/listener.go:40 +0xc7
syncthing-relaysrv: created by main.main
syncthing-relaysrv: #011github.com/syncthing/syncthing/cmd/strelaysrv/main.go:280 +0x2213

No unusual action is logged before the crash.
There is no hint in the syslog.
There were around 7000 session handled on the day of the crash.
The crash happened already several times. I've never experienced such a crash with versions before 1.22.1.

Activity

  1. added
    bug
    needs-triage
    on Jul 25, 2023
  2. changed the title [-]relaysrv crah after some weeks of operation[/-] [+]relaysrv crash after some weeks of operation[/+] on Jul 25, 2023
  3. AudriusButkevicius commented on Jul 25, 2023

    @AudriusButkevicius
    Member

    Not really obvious what happened. Perhaps something in the kernel killed the connection? The machine wasn't low on ram etc?

    Is that all there is in the crash log?

  4. phloggu commented on Jul 25, 2023

    @phloggu
    Author

    Normally strelaysrv consumes <1% of the RAM and there are over 15GB free. If the kernel killed the connection, I think there would be soemthing in syslog, but there is nothing.

    I just saw, I ran it with "-network-buffer 3072". Is it possible that the server crashes, when the proxied connections exhaust the network-buffer?

    If the crash log isn't different from the normal log, no.

  5. AudriusButkevicius commented on Jul 25, 2023

    @AudriusButkevicius
    Member

    This looks like something randomly become nil, so its not clear why that happened

  6. calmh commented on Jul 25, 2023

    @calmh
    Member

    Nah this is a simple bug, present since Forever™ apparently.

    if err != nil {
    if debug {
    log.Println("Listener failed to accept connection from", conn.RemoteAddr(), ". Possibly a TCP Ping.")
    }
    continue
    }

    conn can easily be nil here if the accept call failed for whatever reason, so then we shouldn't try to log the address of the connection we didn't get.

    (we return a conn plus an error if the TLS handshake fails, but we can fail already in the accept and then it's a return nil, false, err)

  7. added a commit that references this issue on Jul 26, 2023
    9ad45f2
  8. removed
    needs-triage
    on Jul 26, 2023
  9. added a commit that references this issue on Jul 27, 2023
    73ef46b
  10. added this to the v1.23.7 milestone on Jul 31, 2023
  11. added a commit that references this issue on Aug 3, 2023
    9c2f1ef
  12. added a commit that references this issue on Jan 28, 2024
    3199161
  13. added
    frozen-due-to-age
    on Jul 26, 2024
  14. locked and limited conversation to collaborators on Jul 26, 2024
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

    bugfrozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions