{"action":"closed","issue":{"url":"https://api.github.com/repos/koekeishiya/skhd/issues/28","repository_url":"https://api.github.com/repos/koekeishiya/skhd","labels_url":"https://api.github.com/repos/koekeishiya/skhd/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/koekeishiya/skhd/issues/28/comments","events_url":"https://api.github.com/repos/koekeishiya/skhd/issues/28/events","html_url":"https://github.com/koekeishiya/skhd/issues/28","id":301993241,"number":28,"title":"segfault when built with extra hardening flags","user":{"login":"LnL7","id":689294,"avatar_url":"https://avatars2.githubusercontent.com/u/689294?v=4","gravatar_id":"","url":"https://api.github.com/users/LnL7","html_url":"https://github.com/LnL7","followers_url":"https://api.github.com/users/LnL7/followers","following_url":"https://api.github.com/users/LnL7/following{/other_user}","gists_url":"https://api.github.com/users/LnL7/gists{/gist_id}","starred_url":"https://api.github.com/users/LnL7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LnL7/subscriptions","organizations_url":"https://api.github.com/users/LnL7/orgs","repos_url":"https://api.github.com/users/LnL7/repos","events_url":"https://api.github.com/users/LnL7/events{/privacy}","received_events_url":"https://api.github.com/users/LnL7/received_events","type":"User","site_admin":false},"labels":[{"id":663763417,"url":"https://api.github.com/repos/koekeishiya/skhd/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-03T12:09:38Z","updated_at":"2018-03-24T20:46:31Z","closed_at":"2018-03-24T20:46:31Z","author_association":"NONE","body":"```\r\nskhd: using config '/etc/skhdrc'\r\n(#2) hotkey :: {\r\n        mod: 'cmd'\r\n        key: 'return' (0x24)\r\n        cmd: 'open -na /Applications/Kitty.app'\r\n}\r\n(#5) hotkey :: {\r\n        mod: 'alt'\r\nAbort trap: 6\r\n```\r\n\r\nThese are the extra extra flags that get added by the hardening. Initially I thought this was this the extra -O flag, but disabling the fortify flags isn't enough.\r\n\r\n```diff\r\n@@ -1,5 +1,11 @@\r\n-clang src/skhd.c -std=c99 -O3 -framework Carbon -o /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-skhd-0.0.10/bin/skhd\r\n+clang src/skhd.c -std=c99 -O3 -framework Carbon -o /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-skhd-0.0.10/bin/skhd\r\n+HARDENING: enabling fortify\r\n+HARDENING: enabling stackprotector\r\n+HARDENING: enabling pic\r\n+HARDENING: enabling strictoverflow\r\n+HARDENING: enabling format\r\n extra flags before to /nix/store/insiq14mv3l2lsb90d8671qqda9i75d4-clang-5.0.1/bin/clang:\r\n   ''\r\n original flags to /nix/store/insiq14mv3l2lsb90d8671qqda9i75d4-clang-5.0.1/bin/clang:\r\n@@ -9,7 +15,7 @@\r\n   -framework\r\n   Carbon\r\n   -o\r\n-  /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-skhd-0.0.10/bin/skhd\r\n+  /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-skhd-0.0.10/bin/skhd\r\n extra flags after to /nix/store/insiq14mv3l2lsb90d8671qqda9i75d4-clang-5.0.1/bin/clang:\r\n   -B/nix/store/6r5bk2qiq7m6n1fr7khf7p1xz26l2lqy-clang-5.0.1-lib/lib\r\n   -B/nix/store/lvbg3qxa84bck05k425mj5n4hxx2n60n-Libsystem-osx-10.11.6/lib/\r\n@@ -88,6 +94,16 @@\r\n   -F/nix/store/illzh78sjn4g607ad5ikyhyq3snp5jhq-apple-framework-OpenGL/Library/Frameworks\r\n   -F/nix/store/6ixzazaqm0pw364fzl0r4dvbaj55z49x-apple-framework-OpenCL/Library/Frameworks\r\n   -F/nix/store/g94jv2hb0sadznj8dy39vxdvp6cj35z5-CF-osx-10.10.5/Library/Frameworks\r\n+  -O2\r\n+  -D_FORTIFY_SOURCE=2\r\n+  -fstack-protector-strong\r\n+  --param\r\n+  ssp-buffer-size=4\r\n+  -fPIC\r\n+  -fno-strict-overflow\r\n+  -Wformat\r\n+  -Wformat-security\r\n+  -Werror=format-security\r\n   -L/nix/store/j6ifwrr83k1c5nmjfx1p63nydpqsbqd6-libc++-5.0.1/lib\r\n   -L/nix/store/r5vgpicc9m7niyjxa0rc30raxyd58dsl-objc4-osx-10.11.6/lib\r\n   -L/nix/store/j6ifwrr83k1c5nmjfx1p63nydpqsbqd6-libc++-5.0.1/lib\r\n```\r\n\r\n/cc @peel"}}
{"actor":{"display_login":"koekeishiya"}}