{"id":47898,"date":"2024-02-16T00:00:00","date_gmt":"2024-02-16T00:00:00","guid":{"rendered":"https:\/\/gufosaggio.net\/i\/how-does-stack-overflow-happen\/"},"modified":"2024-02-16T00:00:00","modified_gmt":"2024-02-16T00:00:00","slug":"how-does-stack-overflow-happen","status":"publish","type":"post","link":"https:\/\/gufosaggio.net\/i\/how-does-stack-overflow-happen\/","title":{"rendered":"How does stack overflow happen?"},"content":{"rendered":"<ul>\n<li>Accessing an array out of bounds<\/li>\n<li>Dereferencing pointer NULL<\/li>\n<li>Dereferencing memory freed<\/li>\n<li>Dereferencing uninitialized pointers<\/li>\n<li>Incorrect application of operators &quot;&amp;&quot; (addresses) and &quot;*&quot; (references)<\/li>\n<li>Formatting errors of specifiers in printf and scanf commands<\/li>\n<\/ul>\n<p>To debug a core dump, follow these steps:<\/p>\n<ol>\n<li>Obtain a binary identical to the one that generated the core dump file.<\/li>\n<li>Use GDB to debug by running: <code>gdb path\/to\/the\/binary path\/to\/the\/core\/dump\/file<\/code><\/li>\n<li>Retrieve a stack trace at the time of the crash using <code>bt<\/code> command.<\/li>\n<\/ol>\n<p>A core dump, also known as a memory dump or crash dump, provides a snapshot of a program&#8217;s working memory at a specific moment, usually when the program crashes or terminates unexpectedly.<\/p>\n<p>Core dumps in Ubuntu are handled by Apport and can be found in <code>\/var\/crash\/<\/code>. If needed, core dump files can be deleted by confirming with &quot;YES&quot;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Accessing an array out of bounds Dereferencing pointer NULL Dereferencing memory freed Dereferencing uninitialized pointers Incorrect application of operators &quot;&amp;&quot; (addresses) and &quot;*&quot; (references) Formatting errors of specifiers in printf and scanf commands To debug a core dump, follow these steps: Obtain a binary identical to the one that generated the core dump file. Use &#8230; <a title=\"How does stack overflow happen?\" class=\"read-more\" href=\"https:\/\/gufosaggio.net\/i\/how-does-stack-overflow-happen\/\" aria-label=\"Per saperne di pi\u00f9 su How does stack overflow happen?\">Leggi tutto<\/a><\/p>\n","protected":false},"author":3233,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-47898","post","type-post","status-publish","format-standard","hentry","category-h"],"_links":{"self":[{"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/posts\/47898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/users\/3233"}],"replies":[{"embeddable":true,"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/comments?post=47898"}],"version-history":[{"count":0,"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/posts\/47898\/revisions"}],"wp:attachment":[{"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/media?parent=47898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/categories?post=47898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/tags?post=47898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}