lxc / go-lxc

Go bindings for liblxc
https://linuxcontainers.org/lxc
Other
431 stars 76 forks source link

seg fault in Interfaces() #40

Closed tych0 closed 9 years ago

tych0 commented 9 years ago

Hello,

I got the following segfault in Interfaces():

fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0xffffffff pc=0x40c305]

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x40c305
runtime.throw(0xf0f985)
    /usr/lib/go/src/pkg/runtime/panic.c:520 +0x69
runtime: unexpected return pc for runtime.sigpanic called from 0x40c305
runtime.sigpanic()
    /usr/lib/go/src/pkg/runtime/os_linux.c:222 +0x3d

goroutine 36 [syscall]:
runtime.cgocall(0x40c300, 0x2ad77e7ef5b0)
    /usr/lib/go/src/pkg/runtime/cgocall.c:143 +0xe5 fp=0x2ad77e7ef598 sp=0x2ad77e7ef550
gopkg.in/lxc/go-lxc%2ev2._Cfunc_getArrayLength(0xffffffff, 0x8)
    gopkg.in/lxc/go-lxc.v2/_obj/_cgo_defun.c:83 +0x31 fp=0x2ad77e7ef5b0 sp=0x2ad77e7ef598
gopkg.in/lxc/go-lxc%2ev2.convertArgs(0xffffffff, 0x0, 0x0, 0x0)
    /home/mmccrack/go/src/gopkg.in/lxc/go-lxc.v2/util.go:77 +0x6a fp=0x2ad77e7ef5e0 sp=0x2ad77e7ef5b0
gopkg.in/lxc/go-lxc%2ev2.(*Container).Interfaces(0xc2081b9440, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/mmccrack/go/src/gopkg.in/lxc/go-lxc.v2/container.go:1188 +0x15d fp=0x2ad77e7ef630 sp=0x2ad77e7ef5e0
github.com/lxc/lxd/shared.getIps(0xc2081b9440, 0x0, 0x0, 0x0)
    /home/mmccrack/go/src/github.com/lxc/lxd/shared/container.go:30 +0x95 fp=0x2ad77e7ef810 sp=0x2ad77e7ef630
github.com/lxc/lxd/shared.NewStatus(0xc2081b9440, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/mmccrack/go/src/github.com/lxc/lxd/shared/container.go:56 +0x9a fp=0x2ad77e7ef870 sp=0x2ad77e7ef810
main.(*lxdContainer).RenderState(0xc2080fb9e0, 0x3)
    /home/mmccrack/go/src/github.com/lxc/lxd/lxd/containers.go:806 +0x53 fp=0x2ad77e7ef920 sp=0x2ad77e7ef870
main.containerGet(0xc208060420, 0xc2080ddd40, 0x0, 0x0)
    /home/mmccrack/go/src/github.com/lxc/lxd/lxd/containers.go:470 +0x1b9 fp=0x2ad77e7ef9c8 sp=0x2ad77e7ef920
main.func·016(0x2ad77e63fdc8, 0xc20810d7c0, 0xc2080ddd40)
    /home/mmccrack/go/src/github.com/lxc/lxd/lxd/daemon.go:206 +0x4b9 fp=0x2ad77e7efb68 sp=0x2ad77e7ef9c8
net/http.HandlerFunc.ServeHTTP(0xc208050b00, 0x2ad77e63fdc8, 0xc20810d7c0, 0xc2080ddd40)
    /usr/lib/go/src/pkg/net/http/server.go:1235 +0x40 fp=0x2ad77e7efb88 sp=0x2ad77e7efb68
github.com/gorilla/mux.(*Router).ServeHTTP(0xc20801ab90, 0x2ad77e63fdc8, 0xc20810d7c0, 0xc2080ddd40)
    /home/mmccrack/go/src/github.com/gorilla/mux/mux.go:98 +0x292 fp=0x2ad77e7efc98 sp=0x2ad77e7efb88
net/http.serverHandler.ServeHTTP(0xc2080052c0, 0x2ad77e63fdc8, 0xc20810d7c0, 0xc2080ddd40)
    /usr/lib/go/src/pkg/net/http/server.go:1673 +0x19f fp=0x2ad77e7efcf0 sp=0x2ad77e7efc98
net/http.(*conn).serve(0xc208058380)
    /usr/lib/go/src/pkg/net/http/server.go:1174 +0xa7e fp=0x2ad77e7effa0 sp=0x2ad77e7efcf0
runtime.goexit()
    /usr/lib/go/src/pkg/runtime/proc.c:1445 fp=0x2ad77e7effa8 sp=0x2ad77e7effa0
created by net/http.(*Server).Serve
    /usr/lib/go/src/pkg/net/http/server.go:1721 +0x313

goroutine 16 [chan receive, 3 minutes]:
main.run(0x0, 0x0)
    /home/mmccrack/go/src/github.com/lxc/lxd/lxd/main.go:88 +0x57c
main.main()
    /home/mmccrack/go/src/github.com/lxc/lxd/lxd/main.go:18 +0x26

goroutine 19 [finalizer wait]:
runtime.park(0x4e0d90, 0x1001cb8, 0xf12ce9)
    /usr/lib/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x1001cb8, 0xf12ce9)
    /usr/lib/go/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /usr/lib/go/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /usr/lib/go/src/pkg/runtime/proc.c:1445

goroutine 20 [syscall, 4 minutes]:
os/signal.loop()
    /usr/lib/go/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
    /usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x32

goroutine 17 [syscall, 4 minutes]:
runtime.goexit()
    /usr/lib/go/src/pkg/runtime/proc.c:1445

goroutine 21 [chan receive, 4 minutes]:
database/sql.(*DB).connectionOpener(0xc208058280)
    /usr/lib/go/src/pkg/database/sql/sql.go:583 +0x48
created by database/sql.Open
    /usr/lib/go/src/pkg/database/sql/sql.go:442 +0x27c

goroutine 23 [IO wait]:
net.runtime_pollWait(0x2ad77e63fb30, 0x72, 0x0)
    /usr/lib/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc2080387d0, 0x72, 0x0, 0x0)
    /usr/lib/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc2080387d0, 0x0, 0x0)
    /usr/lib/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).accept(0xc208038770, 0xb99c48, 0x0, 0x2ad77e63e3f0, 0xb)
    /usr/lib/go/src/pkg/net/fd_unix.go:419 +0x343
net.(*UnixListener).AcceptUnix(0xc2080bf060, 0x516e53, 0x0, 0x0)
    /usr/lib/go/src/pkg/net/unixsock_posix.go:293 +0x73
net.(*UnixListener).Accept(0xc2080bf060, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/pkg/net/unixsock_posix.go:304 +0x4b
net/http.(*Server).Serve(0xc2080052c0, 0x2ad77e63fc10, 0xc2080bf060, 0x0, 0x0)
    /usr/lib/go/src/pkg/net/http/server.go:1698 +0x91
net/http.Serve(0x2ad77e63fc10, 0xc2080bf060, 0x2ad77e63fc48, 0xc20801ab90, 0x0, 0x0)
    /usr/lib/go/src/pkg/net/http/server.go:1576 +0x7c
main.func·020(0x0, 0x0)
    /home/mmccrack/go/src/github.com/lxc/lxd/lxd/daemon.go:350 +0x7f
gopkg.in/tomb%2ev2.(*Tomb).run(0xc208060420, 0xc2080c7770)
    /home/mmccrack/go/src/gopkg.in/tomb.v2/tomb.go:153 +0x23
created by gopkg.in/tomb%2ev2.(*Tomb).Go
    /home/mmccrack/go/src/gopkg.in/tomb.v2/tomb.go:149 +0x110

It might be a liblxc bug, though, investigating more now.

tych0 commented 9 years ago

Ok, I'm going to close this for now. I just rebuilt things with some debugging output and the problem went away, so I'm going to chalk it up to gremlins unless I see it again. Sorry for the noise.