{"action":"created","issue":{"url":"https://api.github.com/repos/frenetic-lang/frenetic/issues/483","repository_url":"https://api.github.com/repos/frenetic-lang/frenetic","labels_url":"https://api.github.com/repos/frenetic-lang/frenetic/issues/483/labels{/name}","comments_url":"https://api.github.com/repos/frenetic-lang/frenetic/issues/483/comments","events_url":"https://api.github.com/repos/frenetic-lang/frenetic/issues/483/events","html_url":"https://github.com/frenetic-lang/frenetic/issues/483","id":145761409,"number":483,"title":"Segmentation Fault When Calling Port_Stats","user":{"login":"craig-riecke","id":542931,"avatar_url":"https://avatars.githubusercontent.com/u/542931?v=3","gravatar_id":"","url":"https://api.github.com/users/craig-riecke","html_url":"https://github.com/craig-riecke","followers_url":"https://api.github.com/users/craig-riecke/followers","following_url":"https://api.github.com/users/craig-riecke/following{/other_user}","gists_url":"https://api.github.com/users/craig-riecke/gists{/gist_id}","starred_url":"https://api.github.com/users/craig-riecke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craig-riecke/subscriptions","organizations_url":"https://api.github.com/users/craig-riecke/orgs","repos_url":"https://api.github.com/users/craig-riecke/repos","events_url":"https://api.github.com/users/craig-riecke/events{/privacy}","received_events_url":"https://api.github.com/users/craig-riecke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"craig-riecke","id":542931,"avatar_url":"https://avatars.githubusercontent.com/u/542931?v=3","gravatar_id":"","url":"https://api.github.com/users/craig-riecke","html_url":"https://github.com/craig-riecke","followers_url":"https://api.github.com/users/craig-riecke/followers","following_url":"https://api.github.com/users/craig-riecke/following{/other_user}","gists_url":"https://api.github.com/users/craig-riecke/gists{/gist_id}","starred_url":"https://api.github.com/users/craig-riecke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craig-riecke/subscriptions","organizations_url":"https://api.github.com/users/craig-riecke/orgs","repos_url":"https://api.github.com/users/craig-riecke/repos","events_url":"https://api.github.com/users/craig-riecke/events{/privacy}","received_events_url":"https://api.github.com/users/craig-riecke/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-04-04T18:10:58Z","updated_at":"2016-04-20T18:48:27Z","closed_at":null,"body":"Steps to reproduce:\r\n\r\n```\r\nsrc/frenetic $ sudo mn --topo=tree,2,2 --controller=remote\r\nsrc/frenetic $ ./frenetic.native http-controller --verbosity debug\r\nsrc/frenetic $ cd lang/python\r\nsrc/frenetic/lang/python $ python -m frenetic.examples.port_count\r\nmininet> pingall\r\n3980 Segmentation fault      ./frenetic.native http-controller --verbosity debug\r\n```"},"comment":{"url":"https://api.github.com/repos/frenetic-lang/frenetic/issues/comments/212555628","html_url":"https://github.com/frenetic-lang/frenetic/issues/483#issuecomment-212555628","issue_url":"https://api.github.com/repos/frenetic-lang/frenetic/issues/483","id":212555628,"user":{"login":"craig-riecke","id":542931,"avatar_url":"https://avatars.githubusercontent.com/u/542931?v=3","gravatar_id":"","url":"https://api.github.com/users/craig-riecke","html_url":"https://github.com/craig-riecke","followers_url":"https://api.github.com/users/craig-riecke/followers","following_url":"https://api.github.com/users/craig-riecke/following{/other_user}","gists_url":"https://api.github.com/users/craig-riecke/gists{/gist_id}","starred_url":"https://api.github.com/users/craig-riecke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craig-riecke/subscriptions","organizations_url":"https://api.github.com/users/craig-riecke/orgs","repos_url":"https://api.github.com/users/craig-riecke/repos","events_url":"https://api.github.com/users/craig-riecke/events{/privacy}","received_events_url":"https://api.github.com/users/craig-riecke/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T18:48:27Z","updated_at":"2016-04-20T18:48:27Z","body":"A little more.  A weird combination of pattern matching and deferreds seems to be causing it.  In Frenetic_NetKAT_Controller:\r\n\r\n```\r\n  let port_stats (sw_id : switchId) (pid : portId) : OF10.portStats list Deferred.t =\r\n    let pt = Int32.(to_int_exn pid) in\r\n    let req = OF10.PortRequest (Some (PhysicalPort pt)) in\r\n    Controller.send_txn sw_id (OF10.Message.StatsRequestMsg req) >>= function\r\n      | `Eof -> assert false\r\n      | `Ok l -> begin\r\n          l >>| function\r\n          | [OF10.Message.StatsReplyMsg (PortRep ps)] -> ps\r\n          | _ -> assert false \r\n      end  \r\n```\r\n\r\nIf you comment out the entire `begin`..`end` block and replace it with assert false, you don't get the segmentation fault anymore.  I don't think `l` is a Deferred, so I don't get the construct.   "}}