Skip to content
This repository was archived by the owner on Nov 2, 2018. It is now read-only.
This repository was archived by the owner on Nov 2, 2018. It is now read-only.

SIGSEGV in api.renterFilesHandler #2490

@mtlynch

Description

@mtlynch

Bug Report

I got a segfault when running the Minio Sia gateway. I suspect it's related to the fact that Minio is calling /renter/files at 1 QPS for each upload in progress, so about 6-8 QPS total.

Stack Trace or error message

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

goroutine 77205 [running]:
bufio.(*Writer).Available(...)
        /usr/local/go/src/bufio/bufio.go:584
bufio.(*Writer).Write(0x0, 0xe07280, 0x2, 0x2, 0x220f, 0x0, 0x0)
        /usr/local/go/src/bufio/bufio.go:594 +0x73
net/http.(*chunkWriter).Write(0xc420074f18, 0xc450628000, 0x220f, 0x3051, 0xc44ee950a8, 0xc4b5163bc0, 0xc4b5163be0)
        /usr/local/go/src/net/http/server.go:366 +0x16c
bufio.(*Writer).Write(0xc430bf2e80, 0xc450628000, 0x220f, 0x3051, 0x0, 0xc4b5163c60, 0x515b82)
        /usr/local/go/src/bufio/bufio.go:599 +0x14f
net/http.(*response).write(0xc420074ee0, 0x220f, 0xc450628000, 0x220f, 0x3051, 0x0, 0x0, 0xc4251fcda0, 0x99, 0x100)
        /usr/local/go/src/net/http/server.go:1500 +0x150
net/http.(*response).Write(0xc420074ee0, 0xc450628000, 0x220f, 0x3051, 0x0, 0x0, 0xac45ed)
        /usr/local/go/src/net/http/server.go:1470 +0x64
encoding/json.(*Encoder).Encode(0xc4b5163d80, 0xa1e7e0, 0xc4251fcda0, 0xe0b0e0, 0xc420074ee0)
        /usr/local/go/src/encoding/json/stream.go:218 +0x1e2
github.com/NebulousLabs/Sia/api.WriteJSON(0xe11120, 0xc420074ee0, 0xa1e7e0, 0xc4251fcda0)
        /home/mike/go/src/github.com/NebulousLabs/Sia/api/api.go:151 +0x10b
github.com/NebulousLabs/Sia/api.(*API).renterFilesHandler(0xc42018c120, 0xe11120, 0xc420074ee0, 0xc4202d4d00, 0x0, 0x0, 0x0)
        /home/mike/go/src/github.com/NebulousLabs/Sia/api/renter.go:314 +0x9a
github.com/NebulousLabs/Sia/api.(*API).(github.com/NebulousLabs/Sia/api.renterFilesHandler)-fm(0xe11120, 0xc420074ee0, 0xc4202d4d00, 0x0, 0x0, 0x0)
        /home/mike/go/src/github.com/NebulousLabs/Sia/api/routes.go:72 +0x66
github.com/julienschmidt/httprouter.(*Router).ServeHTTP(0xc420284a40, 0xe11120, 0xc420074ee0, 0xc4202d4d00)
        /home/mike/go/src/github.com/julienschmidt/httprouter/router.go:344 +0x799
github.com/NebulousLabs/Sia/api.RequireUserAgent.func1(0xe11120, 0xc420074ee0, 0xc4202d4d00)
        /home/mike/go/src/github.com/NebulousLabs/Sia/api/routes.go:173 +0xba
net/http.HandlerFunc.ServeHTTP(0xc420eb27b0, 0xe11120, 0xc420074ee0, 0xc4202d4d00)
        /usr/local/go/src/net/http/server.go:1918 +0x44
github.com/NebulousLabs/Sia/api.cleanCloseHandler.func1.1(0xc43284e4e0, 0xe0c520, 0xc420eb27b0, 0xe11120, 0xc420074ee0, 0xc4202d4d00)
        /home/mike/go/src/github.com/NebulousLabs/Sia/api/routes.go:143 +0x79
created by github.com/NebulousLabs/Sia/api.cleanCloseHandler.func1
        /home/mike/go/src/github.com/NebulousLabs/Sia/api/routes.go:141 +0xb7

Environment

  • Sia version: 47514b4
  • OS: Ubuntu 16.04 LTS

Any useful logs

Seeing a lot of this in renter.log:

2017/11/25 14:11:59.095719 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.096310 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.096861 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.107416 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.113537 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.114201 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.115324 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.121670 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.122091 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.127702 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.128310 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.128873 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.135107 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:11:59.147630 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:12:00.962026 download.go:501: Not enough workers to finish download: insufficient hosts to recover file
2017/11/25 14:12:12.973468 download.go:374: CRITICAL: ERROR: the renter is idle, but tracking 2 active pieces; resetting to zero
2017/11/25 14:26:58.572012 repairscanner.go:323: Repairing 0 chunks

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