{"id":4601,"date":"2014-03-30T13:49:29","date_gmt":"2014-03-30T13:49:29","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/program-runs-with-gdb-but-doest-run-with-programname-collection-of-common-programming-errors\/"},"modified":"2014-03-30T13:49:29","modified_gmt":"2014-03-30T13:49:29","slug":"program-runs-with-gdb-but-doest-run-with-programname-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/program-runs-with-gdb-but-doest-run-with-programname-collection-of-common-programming-errors\/","title":{"rendered":"Program runs with gdb but does&#39;t run with .\/ProgramName-Collection of common programming errors"},"content":{"rendered":"<p>You&#8217;re probably accessing uninitialized data or have some kind of memory corruption problem. This would explain the program behaving differently when run in the debugger &#8211; you&#8217;re seeing the results of undefined behavior.<\/p>\n<p>Run your program through valgrind&#8217;s memcheck tool and see what it outputs. Valgrind is a powerful tool that will identify many runtime errors on Linux, including a full stack trace to the error.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You&#8217;re probably accessing uninitialized data or have some kind of memory corruption problem. This would explain the program behaving differently when run in the debugger &#8211; you&#8217;re seeing the results of undefined behavior. Run your program through valgrind&#8217;s memcheck tool and see what it outputs. Valgrind is a powerful tool that will identify many runtime [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4601","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4601"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4601\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}