{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/14173","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/14173/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/14173/comments","events_url":"https://api.github.com/repos/docker/docker/issues/14173/events","html_url":"https://github.com/docker/docker/issues/14173","id":90824555,"number":14173,"title":"docker daemon receives SIGSEGV","user":{"login":"xylnao","id":1502809,"avatar_url":"https://avatars.githubusercontent.com/u/1502809?v=3","gravatar_id":"","url":"https://api.github.com/users/xylnao","html_url":"https://github.com/xylnao","followers_url":"https://api.github.com/users/xylnao/followers","following_url":"https://api.github.com/users/xylnao/following{/other_user}","gists_url":"https://api.github.com/users/xylnao/gists{/gist_id}","starred_url":"https://api.github.com/users/xylnao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xylnao/subscriptions","organizations_url":"https://api.github.com/users/xylnao/orgs","repos_url":"https://api.github.com/users/xylnao/repos","events_url":"https://api.github.com/users/xylnao/events{/privacy}","received_events_url":"https://api.github.com/users/xylnao/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/version/master","name":"version/master","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2015-06-25T01:39:15Z","updated_at":"2016-09-10T02:24:22Z","closed_at":"2016-09-10T02:24:22Z","body":"### Description of problem:\r\nA docker daemon receives a signal SIGSEGV during creation of a container.\r\n\r\n### docker version:\r\nClient version: 1.8.0-dev\r\nClient API version: 1.20\r\nGo version (client): go1.4.2\r\nGit commit (client): cb6ca19\r\nOS/Arch (client): linux/amd64\r\nServer version: 1.8.0-dev\r\nServer API version: 1.20\r\nGo version (server): go1.4.2\r\nGit commit (server): cb6ca19\r\nOS/Arch (server): linux/amd64\r\n\r\n### docker info:\r\nContainers: 26\r\nImages: 143\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 195\r\n Dirperm1 Supported: true\r\nExecution Driver: native-0.2\r\nLogging Driver: json-file\r\nKernel Version: 3.16.0-30-generic\r\nOperating System: Ubuntu 14.04.2 LTS\r\nCPUs: 2\r\nTotal Memory: 986.8 MiB\r\nName: ubuntu\r\nID: J7AL:63BJ:74EP:LB3B:GGMI:SPOK:334A:FJKY:XSG4:N5OY:YQLS:OXAE\r\nWARNING: No swap limit support\r\n\r\n### uname -a:\r\nLinux ubuntu 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\n### Environment details (AWS, VirtualBox, physical, etc.):\r\nVMware Professional Version 5.0.5 (1945692)\r\n\r\n### How reproducible:\r\nAlways\r\n\r\n### Steps to Reproduce:\r\n1. \r\nStart a docker daemon from a gdb.\r\n```\r\n% gdb docker\r\nrun -d\r\n```\r\n2.\r\nRun any small command inside a docker container from another shell prompt.\r\n```\r\n% docker run --rm ubuntu echo hello\r\n```\r\n\r\n### Actual Results:\r\nThe docker daemon receives a signal SIGSEGV.\r\n\r\n### Expected Results:\r\nThe request is processed normally.\r\n\r\n### Additional info:\r\nIf you continue the debug session after this SIGSEGV, new threads are generated and the request looks processed normally.\r\n\r\n```\r\n% gdb bundles/1.8.0-dev/binary/docker-1.8.0-dev \r\nGNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1\r\nCopyright (C) 2014 Free Software Foundation, Inc.\r\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\r\nThis is free software: you are free to change and redistribute it.\r\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\r\nand \"show warranty\" for details.\r\nThis GDB was configured as \"x86_64-linux-gnu\".\r\nType \"show configuration\" for configuration details.\r\nFor bug reporting instructions, please see:\r\n<http://www.gnu.org/software/gdb/bugs/>.\r\nFind the GDB manual and other documentation resources online at:\r\n<http://www.gnu.org/software/gdb/documentation/>.\r\nFor help, type \"help\".\r\nType \"apropos word\" to search for commands related to \"word\"...\r\nReading symbols from bundles/1.8.0-dev/binary/docker-1.8.0-dev...done.\r\n(gdb) run -d\r\nStarting program: /home/nao/docker/bundles/1.8.0-dev/binary/docker-1.8.0-dev -d\r\n[Thread debugging using libthread_db enabled]\r\nUsing host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\r\n[New Thread 0x7ffff7e4a700 (LWP 12883)]\r\n[New Thread 0x7ffff7649700 (LWP 12884)]\r\n[New Thread 0x7ffff6e48700 (LWP 12885)]\r\n[New Thread 0x7ffff6647700 (LWP 12886)]\r\n[New Thread 0x7ffff5e46700 (LWP 12887)]\r\nINFO[0000] Listening for HTTP on unix (/var/run/docker.sock) \r\nINFO[0000] [graphdriver] using prior storage driver \"aufs\" \r\nWARN[0000] Running modprobe bridge nf_nat failed with message: , error: exit status 1 \r\nWARN[0000] Your kernel does not support swap memory limit. \r\nINFO[0000] Loading containers: start.                   \r\n....................................................\r\nINFO[0000] Loading containers: done.                    \r\nINFO[0000] Daemon has completed initialization          \r\nINFO[0000] Docker daemon                                 commit=cb6ca19 execdriver=native-0.2 graphdriver=aufs version=1.8.0-dev\r\nINFO[0004] POST /v1.20/containers/create                \r\nINFO[0004] POST /v1.20/containers/52c6d7846861ff018deb45dea854ee0f1a93133baabad48ac04d42e6aedfb7bb/attach?stderr=1&stdout=1&stream=1 \r\nINFO[0004] POST /v1.20/containers/52c6d7846861ff018deb45dea854ee0f1a93133baabad48ac04d42e6aedfb7bb/start \r\nINFO[0004] No non-localhost DNS nameservers are left in resolv.conf. Using default external servers : [nameserver 8.8.8.8 nameserver 8.8.4.4] \r\n\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n[Switching to Thread 0x7ffff6647700 (LWP 12886)]\r\nnet.networkNumberAndMask (n=0x0, ip=..., m=...) at /usr/local/go/src/net/ip.go:436\r\n436\t\tif ip = n.IP.To4(); ip == nil {\r\n(gdb) bt\r\n#0  net.networkNumberAndMask (n=0x0, ip=..., m=...) at /usr/local/go/src/net/ip.go:436\r\n#1  0x000000000063370b in net.(*IPNet).String (n=0x0, ~r0=...)\r\n    at /usr/local/go/src/net/ip.go:486\r\n#2  0x0000000000482f59 in fmt.(*pp).handleMethods (p=0xc2080d2750, verb=113, depth=0, \r\n    handled=true) at /usr/local/go/src/fmt/print.go:720\r\n#3  0x00000000004833e8 in fmt.(*pp).printArg (p=0xc2080d2750, arg=..., verb=113, depth=0, \r\n    wasString=false) at /usr/local/go/src/fmt/print.go:794\r\n#4  0x000000000048b23d in fmt.(*pp).doPrintf (p=..., format=..., a=...)\r\n    at /usr/local/go/src/fmt/print.go:1183\r\n#5  0x000000000047de28 in fmt.Sprintf (format=..., a=..., ~r2=...)\r\n    at /usr/local/go/src/fmt/print.go:203\r\n#6  0x00000000009392cb in github.com/docker/libnetwork/sandbox.configureInterface (\r\n    iface=..., i=0xc208030380, ~r2=...)\r\n    at /go/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandbox/interface_linux.go:258\r\n#7  0x000000000093efd6 in github.com/docker/libnetwork/sandbox.func·004 (callerFD=12, \r\n    ~r1=...)\r\n    at /go/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandbox/interface_linux.go:233\r\n#8  0x000000000093bb57 in github.com/docker/libnetwork/sandbox.nsInvoke (path=..., prefunc=\r\n    {void (int, error *)} 0xc2082c8cf8, postfunc={void (int, error *)} 0xc2082c8d00, \r\n    ~r3=...)\r\n    at /go/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandbox/namespace_linux.go:275\r\n#9  0x0000000000938d69 in github.com/docker/libnetwork/sandbox.(*networkNamespace).AddInterface (n=0xc2081c9180, srcName=..., dstPrefix=..., options=..., ~r3=...)\r\n    at /go/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandbox/interface_linux.go:247\r\n#10 0x00000000007b05b4 in github.com/docker/libnetwork.(*sandboxData).addEndpoint (\r\n    s=0xc2082ddcc0, ep=0xc20827cbd0, ~r1=...)\r\n    at /go/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandboxdata.go:92\r\n#11 0x00000000007b17a3 in github.com/docker/libnetwork.(*controller).sandboxAdd (\r\n    c=0xc208242e80, key=..., create=true, ep=0xc20827cbd0, ~r3=..., ~r4=...)\r\n    at /go/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandboxdata.go:198\r\n#12 0x00000000007a32a8 in github.com/docker/libnetwork.(*endpoint).Join (ep=0xc20827cbd0, \r\n    containerID=..., options=..., ~r2=...)\r\n    at /go/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/endpoint.go:424\r\n#13 0x00000000004f5877 in github.com/docker/docker/daemon.(*Container).configureNetwork (\r\n    container=0xc2082ba1e0, networkName=..., service=..., networkDriver=..., \r\n    canCreateNetwork=true, ~r4=...)\r\n    at /go/src/github.com/docker/docker/daemon/container_linux.go:867\r\n#14 0x00000000004f523c in github.com/docker/docker/daemon.(*Container).AllocateNetwork (\r\n    container=0xc2082ba1e0, ~r0=...)\r\n    at /go/src/github.com/docker/docker/daemon/container_linux.go:821\r\n#15 0x00000000004f5f7c in github.com/docker/docker/daemon.(*Container).initializeNetworking\r\n    (container=0xc2082ba1e0, ~r0=...)\r\n    at /go/src/github.com/docker/docker/daemon/container_linux.go:918\r\n#16 0x00000000004e229f in github.com/docker/docker/daemon.(*Container).Start (\r\n    container=0xc2082ba1e0, err=...)\r\n    at /go/src/github.com/docker/docker/daemon/container.go:255\r\n#17 0x000000000051806c in github.com/docker/docker/daemon.(*Daemon).ContainerStart (\r\n    daemon=0xc2080616c0, name=..., hostConfig=0x0, ~r2=...)\r\n    at /go/src/github.com/docker/docker/daemon/start.go:35\r\n#18 0x00000000004d0f42 in github.com/docker/docker/api/server.(*Server).postContainersStart\r\n    (s=0xc20808ad00, version=..., w=..., r=0xc2080d2410, vars=0xc208301a70, ~r4=...)\r\n    at /go/src/github.com/docker/docker/api/server/server.go:1031\r\n#19 0x00000000004ddb3b in github.com/docker/docker/api/server.*Server.(github.com/docker/docker/api/server.postContainersStart)·fm (a0=..., a1=..., a2=0xc2080d2410, a3=0xc208301a70, \r\n    r0=...) at /go/src/github.com/docker/docker/api/server/server.go:1544\r\n#20 0x00000000004dc565 in github.com/docker/docker/api/server.func·008 (w=..., \r\n    r=0xc2080d2410) at /go/src/github.com/docker/docker/api/server/server.go:1495\r\n#21 0x00000000006d50e1 in net/http.HandlerFunc.ServeHTTP (f=\r\n    {void (net/http.ResponseWriter, struct net/http.Request *)} 0xc2082c9ba8, w=..., \r\n    r=0xc2080d2410) at /usr/local/go/src/net/http/server.go:1265\r\n#22 0x00000000006f3ea7 in github.com/gorilla/mux.(*Router).ServeHTTP (r=0xc20810ba90, w=..., req=0xc2080d2410)\r\n    at /go/src/github.com/docker/docker/vendor/src/github.com/gorilla/mux/mux.go:98\r\n#23 0x00000000006d721a in net/http.serverHandler.ServeHTTP (sh=..., rw=..., \r\n    req=0xc2080d2410) at /usr/local/go/src/net/http/server.go:1703\r\n#24 0x00000000006d4c37 in net/http.(*conn).serve (c=0xc2081c92c0)\r\n    at /usr/local/go/src/net/http/server.go:1204\r\n#25 0x000000000044c051 in runtime.goexit () at /usr/local/go/src/runtime/asm_amd64.s:2232\r\n#26 0x000000c2081c92c0 in ?? ()\r\n#27 0x3664313437343230 in ?? ()\r\n#28 0x3734393935323063 in ?? ()\r\n#29 0x6c2f646461306665 in ?? ()\r\n#30 0x0000000072657961 in ?? ()\r\n#31 0x45474155474e414c in ?? ()\r\n#32 0x000053555f6e653d in ?? ()\r\n#33 0x3d454d414e474f4c in ?? ()\r\n#34 0x00000000746f6f72 in ?? ()\r\n#35 0x3d59414c50534944 in ?? ()\r\n#36 0x00000000302e303a in ?? ()\r\n#37 0x4449475f4f445553 in ?? ()\r\n#38 0x000000303030313d in ?? ()\r\n#39 0x0000000000000026 in ?? ()\r\n#40 0x0000000000000000 in ?? ()\r\n(gdb) frame 6\r\n#6  0x00000000009392cb in github.com/docker/libnetwork/sandbox.configureInterface (\r\n    iface=..., i=0xc208030380, ~r2=...)\r\n    at /go/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandbox/interface_linux.go:258\r\n258\t\t\t{setInterfaceIPv6, fmt.Sprintf(\"error setting interface %q IPv6 to %q\", ifaceName, i.AddressIPv6())},\r\n(gdb) list\r\n253\t\t\tFn         func(netlink.Link, *nwIface) error\r\n254\t\t\tErrMessage string\r\n255\t\t}{\r\n256\t\t\t{setInterfaceName, fmt.Sprintf(\"error renaming interface %q to %q\", ifaceName, i.DstName())},\r\n257\t\t\t{setInterfaceIP, fmt.Sprintf(\"error setting interface %q IP to %q\", ifaceName, i.Address())},\r\n258\t\t\t{setInterfaceIPv6, fmt.Sprintf(\"error setting interface %q IPv6 to %q\", ifaceName, i.AddressIPv6())},\r\n259\t\t\t{setInterfaceRoutes, fmt.Sprintf(\"error setting interface %q routes to %q\", ifaceName, i.Routes())},\r\n260\t\t\t{setInterfaceMaster, fmt.Sprintf(\"error setting interface %q master to %q\", ifaceName, i.DstMaster())},\r\n261\t\t}\r\n262\t\r\n(gdb) p ip\r\nNo symbol \"ip\" in current context.\r\n(gdb) p i\r\n$1 = (struct github.com/docker/libnetwork/sandbox.nwIface *) 0xc208030380\r\n(gdb) p *i\r\n$2 = {srcName = 0xc2082ed4b0 \"veth28eae8e\", dstName = 0xc2082ca0a0 \"eth0\", \r\n  master = 0x0 \"\", dstMaster = 0x0 \"\", address = 0xc208276aa0, addressIPv6 = 0x0, \r\n  routes = {array = 0x0, len = 0, cap = 0}, bridge = false, ns = 0xc2081c9180, \r\n  sync.Mutex = {state = 0, sema = 0}}\r\n(gdb) c\r\nContinuing.\r\n[New Thread 0x7ffff5645700 (LWP 12962)]\r\n[New Thread 0x7ffff4e44700 (LWP 12963)]\r\n[New Thread 0x7fffdffff700 (LWP 12964)]\r\nINFO[0052] POST /v1.20/containers/52c6d7846861ff018deb45dea854ee0f1a93133baabad48ac04d42e6aedfb7bb/wait \r\nINFO[0052] GET /v1.20/containers/52c6d7846861ff018deb45dea854ee0f1a93133baabad48ac04d42e6aedfb7bb/json \r\nINFO[0052] DELETE /v1.20/containers/52c6d7846861ff018deb45dea854ee0f1a93133baabad48ac04d42e6aedfb7bb?v=1\r\n```\r\n\r\nA small patch seems to fix this problem, though I am not sure docker people like this idea. Sould I proceed to PR?\r\n```\r\ndiff --git a/vendor/src/github.com/docker/libnetwork/sandbox/interface_linux.go b/vendor/src/github.com/docker/libnetwork/sandbox/interface_linux.go\r\nindex a89b3e7..71ec064 100644\r\n--- a/vendor/src/github.com/docker/libnetwork/sandbox/interface_linux.go\r\n+++ b/vendor/src/github.com/docker/libnetwork/sandbox/interface_linux.go\r\n@@ -249,22 +249,37 @@ func (n *networkNamespace) AddInterface(srcName, dstPrefix string, options ...If\r\n \r\n func configureInterface(iface netlink.Link, i *nwIface) error {\r\n \tifaceName := iface.Attrs().Name\r\n-\tifaceConfigurators := []struct {\r\n-\t\tFn         func(netlink.Link, *nwIface) error\r\n-\t\tErrMessage string\r\n-\t}{\r\n-\t\t{setInterfaceName, fmt.Sprintf(\"error renaming interface %q to %q\", ifaceName, i.DstName())},\r\n-\t\t{setInterfaceIP, fmt.Sprintf(\"error setting interface %q IP to %q\", ifaceName, i.Address())},\r\n-\t\t{setInterfaceIPv6, fmt.Sprintf(\"error setting interface %q IPv6 to %q\", ifaceName, i.AddressIPv6())},\r\n-\t\t{setInterfaceRoutes, fmt.Sprintf(\"error setting interface %q routes to %q\", ifaceName, i.Routes())},\r\n-\t\t{setInterfaceMaster, fmt.Sprintf(\"error setting interface %q master to %q\", ifaceName, i.DstMaster())},\r\n+\tif i.DstName() != \"\" {\r\n+\t\terr := setInterfaceName(iface, i)\r\n+\t\tif err != nil {\r\n+\t\t\treturn fmt.Errorf(fmt.Sprintf(\"error renaming interface %q to %q: %v\", ifaceName, i.DstName(), err))\r\n+\t\t}\r\n \t}\r\n-\r\n-\tfor _, config := range ifaceConfigurators {\r\n-\t\tif err := config.Fn(iface, i); err != nil {\r\n-\t\t\treturn fmt.Errorf(\"%s: %v\", config.ErrMessage, err)\r\n+\tif i.Address() != nil {\r\n+\t\terr := setInterfaceIP(iface, i)\r\n+\t\tif err != nil {\r\n+\t\t\treturn fmt.Errorf(fmt.Sprintf(\"error setting interface %q IP to %q: %v\", ifaceName, i.Address(), err))\r\n+\t\t}\r\n+\t}\r\n+\tif i.AddressIPv6() != nil {\r\n+\t\terr := setInterfaceIPv6(iface, i)\r\n+\t\tif err != nil {\r\n+\t\t\treturn fmt.Errorf(fmt.Sprintf(\"error setting interface %q IPv6 to %q: %v\", ifaceName, i.AddressIPv6(), err))\r\n \t\t}\r\n \t}\r\n+\tif i.Routes() != nil {\r\n+\t\terr := setInterfaceRoutes(iface, i)\r\n+\t\tif err != nil {\r\n+\t\t\treturn fmt.Errorf(fmt.Sprintf(\"error setting interface %q routes to %q: %v\", ifaceName, i.Routes(), err))\r\n+\t\t}\r\n+\t}\r\n+\tif i.DstMaster() != \"\" {\r\n+\t\terr := setInterfaceMaster(iface, i)\r\n+\t\tif err != nil {\r\n+\t\t\treturn fmt.Errorf(fmt.Sprintf(\"error setting interface %q master to %q: %v\", ifaceName, i.DstMaster(), err))\r\n+\t\t}\r\n+\t}\r\n+\r\n \treturn nil\r\n }\r\n \r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/246082633","html_url":"https://github.com/docker/docker/issues/14173#issuecomment-246082633","issue_url":"https://api.github.com/repos/docker/docker/issues/14173","id":246082633,"user":{"login":"icecrime","id":1564054,"avatar_url":"https://avatars.githubusercontent.com/u/1564054?v=3","gravatar_id":"","url":"https://api.github.com/users/icecrime","html_url":"https://github.com/icecrime","followers_url":"https://api.github.com/users/icecrime/followers","following_url":"https://api.github.com/users/icecrime/following{/other_user}","gists_url":"https://api.github.com/users/icecrime/gists{/gist_id}","starred_url":"https://api.github.com/users/icecrime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icecrime/subscriptions","organizations_url":"https://api.github.com/users/icecrime/orgs","repos_url":"https://api.github.com/users/icecrime/repos","events_url":"https://api.github.com/users/icecrime/events{/privacy}","received_events_url":"https://api.github.com/users/icecrime/received_events","type":"User","site_admin":false},"created_at":"2016-09-10T02:24:22Z","updated_at":"2016-09-10T02:24:22Z","body":"I'm closing this issue per the conversation above, thanks all."}}
{"actor":{"display_login":"icecrime"}}