{"action":"created","issue":{"url":"https://api.github.com/repos/haskell-servant/servant/issues/142","labels_url":"https://api.github.com/repos/haskell-servant/servant/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/haskell-servant/servant/issues/142/comments","events_url":"https://api.github.com/repos/haskell-servant/servant/issues/142/events","html_url":"https://github.com/haskell-servant/servant/issues/142","id":90393125,"number":142,"title":"Segfault on SIGINT on FreeBSD 10.1","user":{"login":"obscaenvs","id":368265,"avatar_url":"https://avatars.githubusercontent.com/u/368265?v=3","gravatar_id":"","url":"https://api.github.com/users/obscaenvs","html_url":"https://github.com/obscaenvs","followers_url":"https://api.github.com/users/obscaenvs/followers","following_url":"https://api.github.com/users/obscaenvs/following{/other_user}","gists_url":"https://api.github.com/users/obscaenvs/gists{/gist_id}","starred_url":"https://api.github.com/users/obscaenvs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obscaenvs/subscriptions","organizations_url":"https://api.github.com/users/obscaenvs/orgs","repos_url":"https://api.github.com/users/obscaenvs/repos","events_url":"https://api.github.com/users/obscaenvs/events{/privacy}","received_events_url":"https://api.github.com/users/obscaenvs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-23T13:40:56Z","updated_at":"2015-06-26T10:53:55Z","closed_at":null,"body":"I'm not sure this is a bug in `servant`, but on `SIGINT`, something segfaults on FreeBSD 10.1 when running e.g. the `servant-example` thingies.\r\n\r\nTo produce this, I followed the [official guide](http://haskell-servant.github.io/tutorial/server.html#toc) for the examples found under the ToC, with the exception of the last three `cabal` commands (`install`, `configure`, `build`) where I had to specify the newly created sandbox in the parent directory:`$ CABAL_SANDBOX_CONFIG=../cabal.sandbox.config cabal <cmd>`.\r\n\r\nHaving gone through these steps, I just fired up `$  ./dist/build/tutorial/tutorial 2` in the `servant-example` directory, and sure enough, it works, but when the time comes for the old `Ctrl-C`, there's a segfault and a core dump. This is the case for all the examples (1-9).\r\n\r\nWith the above sandbox approach I didn't get any useful symbols for some reason, but another approach produced this hopefully informative `gdb`-session:\r\n\r\n```\r\n$ gdb tutorial tutorial.core\r\nGNU gdb 6.1.1 [FreeBSD]\r\nCopyright 2004 Free Software Foundation, Inc.\r\nGDB is free software, covered by the GNU General Public License, and you are\r\nwelcome to change it and/or distribute copies of it under certain conditions.\r\nType \"show copying\" to see the conditions.\r\nThere is absolutely no warranty for GDB.  Type \"show warranty\" for details.\r\nThis GDB was configured as \"amd64-marcel-freebsd\"...(no debugging symbols found)...\r\nCore was generated by `tutorial'.\r\nProgram terminated with signal 11, Segmentation fault.\r\nReading symbols from /lib/libz.so.6...(no debugging symbols found)...done.\r\nLoaded symbols for /lib/libz.so.6\r\nReading symbols from /usr/local/lib/gcc48/libstdc++.so.6...Error while reading shared library symbols:\r\nDwarf Error: wrong version in compilation unit header (is 4, should be 2) [in module /usr/local/lib/gcc48/libstdc++.so.6]\r\nReading symbols from /lib/libutil.so.9...(no debugging symbols found)...done.\r\nLoaded symbols for /lib/libutil.so.9\r\nReading symbols from /usr/local/lib/libiconv.so.2...(no debugging symbols found)...done.\r\nLoaded symbols for /usr/local/lib/libiconv.so.2\r\nReading symbols from /usr/local/lib/libcharset.so.1...(no debugging symbols found)...done.\r\nLoaded symbols for /usr/local/lib/libcharset.so.1\r\nReading symbols from /usr/local/lib/libgmp.so.10...(no debugging symbols found)...done.\r\nLoaded symbols for /usr/local/lib/libgmp.so.10\r\nReading symbols from /lib/libm.so.5...(no debugging symbols found)...done.\r\nLoaded symbols for /lib/libm.so.5\r\nReading symbols from /usr/local/lib/libffi.so.6...(no debugging symbols found)...done.\r\nLoaded symbols for /usr/local/lib/libffi.so.6\r\nReading symbols from /lib/libthr.so.3...(no debugging symbols found)...done.\r\nLoaded symbols for /lib/libthr.so.3\r\nReading symbols from /lib/libgcc_s.so.1...(no debugging symbols found)...done.\r\nLoaded symbols for /lib/libgcc_s.so.1\r\nReading symbols from /lib/libc.so.7...(no debugging symbols found)...done.\r\nLoaded symbols for /lib/libc.so.7\r\nReading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.\r\nLoaded symbols for /libexec/ld-elf.so.1\r\n#0  0x0000000000f851a7 in generic_handler ()\r\n[New Thread 803406400 (LWP 100126/tutorial)]\r\n(gdb) bt\r\n#0  0x0000000000f851a7 in generic_handler ()\r\n#1  0x00000008026ed3f6 in swapcontext () from /lib/libthr.so.3\r\n#2  0x00000008026ecff3 in sigaction () from /lib/libthr.so.3\r\n#3  <signal handler called>\r\n#4  0x0000000802c55b7a in select () from /lib/libc.so.7\r\n#5  0x00000008026eab02 in select () from /lib/libthr.so.3\r\n#6  0x0000000000f84e62 in awaitEvent ()\r\n#7  0x0000000000000000 in ?? ()\r\n(gdb)\r\n```\r\n\r\nThis minimal `WAI`/`Warp` example adapted from the  `WAI` `README.md` did not exhibit the same behaviour (using the same sandbox):\r\n```\r\n{-# LANGUAGE OverloadedStrings #-}\r\nimport Network.Wai\r\nimport Network.HTTP.Types\r\nimport Network.Wai.Handler.Warp (run)\r\n\r\napp :: Application\r\napp _ respond = do\r\n    putStrLn \"I've done some IO here\"\r\n    respond $ responseLBS\r\n        status200\r\n        [(\"Content-Type\", \"text/plain\")]\r\n        \"Hello, Web!\"\r\n\r\nmain :: IO ()\r\nmain = do\r\n    putStrLn $ \"http://localhost:8081/\"\r\n    run 8081 app\r\n```"},"comment":{"url":"https://api.github.com/repos/haskell-servant/servant/issues/comments/115645079","html_url":"https://github.com/haskell-servant/servant/issues/142#issuecomment-115645079","issue_url":"https://api.github.com/repos/haskell-servant/servant/issues/142","id":115645079,"user":{"login":"obscaenvs","id":368265,"avatar_url":"https://avatars.githubusercontent.com/u/368265?v=3","gravatar_id":"","url":"https://api.github.com/users/obscaenvs","html_url":"https://github.com/obscaenvs","followers_url":"https://api.github.com/users/obscaenvs/followers","following_url":"https://api.github.com/users/obscaenvs/following{/other_user}","gists_url":"https://api.github.com/users/obscaenvs/gists{/gist_id}","starred_url":"https://api.github.com/users/obscaenvs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obscaenvs/subscriptions","organizations_url":"https://api.github.com/users/obscaenvs/orgs","repos_url":"https://api.github.com/users/obscaenvs/repos","events_url":"https://api.github.com/users/obscaenvs/events{/privacy}","received_events_url":"https://api.github.com/users/obscaenvs/received_events","type":"User","site_admin":false},"created_at":"2015-06-26T10:53:55Z","updated_at":"2015-06-26T10:53:55Z","body":"I am running from `servant-examples` from hackage. I don't think this comes from `servant` either. I shall go through the pointer from @christian-marie. My whiskers tell me this is FreeBSD-related, since there are other problems on this platform (e.g. when running `keter`, it segfaults after a while). Also, when I said STABLE above, this is referring to FreeBSD 10.1-STABLE, the development branch of FreeBSD, not anything else (my above comment about this could be misinterpreted)."}}