{"id":733,"date":"2012-02-27T15:15:08","date_gmt":"2012-02-27T22:15:08","guid":{"rendered":"http:\/\/jaredrobinson.com\/blog\/?p=733"},"modified":"2012-02-27T15:15:08","modified_gmt":"2012-02-27T22:15:08","slug":"when-ctrl-c-in-gdb-shuts-down-a-program-insted-of-interrupting-it","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/when-ctrl-c-in-gdb-shuts-down-a-program-insted-of-interrupting-it\/","title":{"rendered":"When CTRL-C in gdb shuts down a program insted of interrupting it"},"content":{"rendered":"<p>According to The Linux Programming Interface, a well-behaved multi-threaded UNIX program should use sigwait() or sigwaitinfo() instead of signal() or sigaction(). A linux-only program could even use signalfd().<\/p>\n<p>Unfortunately, Linux\/UNIX programs using sigwait() are hard to interrupt in the debugger. Instead of interrupting the program, it terminates the program. How does one work around this problem? See <a href=\"http:\/\/stackoverflow.com\/questions\/5857300\/gdb-ctrlc-doesnt-interrupt-process-as-it-usually-does\">my answer on stackoverflow<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>According to The Linux Programming Interface, a well-behaved multi-threaded UNIX program should use sigwait() or sigwaitinfo() instead of signal() or sigaction(). A linux-only program could even use signalfd(). Unfortunately, Linux\/UNIX programs using sigwait() are hard to interrupt in the debugger. Instead of interrupting the program, it terminates the program. How does one work around this &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/when-ctrl-c-in-gdb-shuts-down-a-program-insted-of-interrupting-it\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;When CTRL-C in gdb shuts down a program insted of interrupting it&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,12,17],"tags":[],"class_list":["post-733","post","type-post","status-publish","format-standard","hentry","category-linux","category-programming","category-tech"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=733"}],"version-history":[{"count":4,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/733\/revisions"}],"predecessor-version":[{"id":756,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/733\/revisions\/756"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}