{"action":"opened","issue":{"url":"https://api.github.com/repos/Igalia/snabbswitch/issues/268","repository_url":"https://api.github.com/repos/Igalia/snabbswitch","labels_url":"https://api.github.com/repos/Igalia/snabbswitch/issues/268/labels{/name}","comments_url":"https://api.github.com/repos/Igalia/snabbswitch/issues/268/comments","events_url":"https://api.github.com/repos/Igalia/snabbswitch/issues/268/events","html_url":"https://github.com/Igalia/snabbswitch/issues/268","id":134252736,"number":268,"title":"Channels mechanism not robust to /var/run/snabb/PID already existing","user":{"login":"wingo","id":1745903,"avatar_url":"https://avatars.githubusercontent.com/u/1745903?v=3","gravatar_id":"","url":"https://api.github.com/users/wingo","html_url":"https://github.com/wingo","followers_url":"https://api.github.com/users/wingo/followers","following_url":"https://api.github.com/users/wingo/following{/other_user}","gists_url":"https://api.github.com/users/wingo/gists{/gist_id}","starred_url":"https://api.github.com/users/wingo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wingo/subscriptions","organizations_url":"https://api.github.com/users/wingo/orgs","repos_url":"https://api.github.com/users/wingo/repos","events_url":"https://api.github.com/users/wingo/events{/privacy}","received_events_url":"https://api.github.com/users/wingo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-17T11:17:11Z","updated_at":"2016-02-17T11:17:11Z","closed_at":null,"body":"Kat was just running a test and started to get bizarro segfaults doing simple things like:\r\n\r\n```\r\n./snabb-lwaftr bench \\\r\n   program/lwaftr/tests/data/icmp_on_fail.conf \\\r\n   program/lwaftr/tests/data/tcp-frominet-bound.pcap \\\r\n   program/lwaftr/tests/data/tcp-fromb4-ipv6.pcap\r\n```\r\n\r\nUnfortunately we don't know what git revision the build corresponds to because reasons.  Anyway, the snabb runs were failing with:\r\n\r\n```\r\nzsh: bus error (core dumped)  ./snabb-lwaftr bench ...\r\n```\r\n\r\nRemoving the contents of `/var/run/snabb` \"fixed\" the problem.\r\n\r\nRelatedly, we have seen exceptions on startup if the channels directory for a PID was already there.  I suspect channels somehow in this issue, as we haven't seen this failure mode in other contexts, and in this one, we got this error before we started seeing the segfaults:\r\n\r\n```\r\napps/lwaftr/channel.lua:51: error creating file \"/var/run/snabb/2876/channels/lwaftr/control\": File exists\r\n```\r\n\r\nThis bug, then, is to first reproduce the issue simply by running a lot of snabb check processes, until we get the error creating the file.  Then see if we can reproduce the segfault.  It's probably due to the file not being mapped correctly or something.  Then we fix."}}