{"id":47902,"date":"2024-02-16T00:00:00","date_gmt":"2024-02-16T00:00:00","guid":{"rendered":"https:\/\/gufosaggio.net\/i\/what-causes-a-core-dump\/"},"modified":"2024-02-16T00:00:00","modified_gmt":"2024-02-16T00:00:00","slug":"what-causes-a-core-dump","status":"publish","type":"post","link":"https:\/\/gufosaggio.net\/i\/what-causes-a-core-dump\/","title":{"rendered":"What causes a core dump?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/gufosaggio.net\/i\/what-causes-a-core-dump\/#Core_Dumps_in_Linux\" >Core Dumps in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/gufosaggio.net\/i\/what-causes-a-core-dump\/#Thread_Dump_and_Heap_Dump_Analysis\" >Thread Dump and Heap Dump Analysis<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/gufosaggio.net\/i\/what-causes-a-core-dump\/#Debugging_Core_Dumps\" >Debugging Core Dumps<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/gufosaggio.net\/i\/what-causes-a-core-dump\/#Reading_Core_Dump_on_Windows\" >Reading Core Dump on Windows<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/gufosaggio.net\/i\/what-causes-a-core-dump\/#Using_Gcore\" >Using Gcore<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Core_Dumps_in_Linux\"><\/span>Core Dumps in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Core dumps are created in Linux when a process receives certain signals, like SIGSEGV, due to memory access issues. <\/p>\n<h3><span class=\"ez-toc-section\" id=\"Thread_Dump_and_Heap_Dump_Analysis\"><\/span>Thread Dump and Heap Dump Analysis<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A thread dump captures the stack of all live threads, helpful in analyzing application behavior.<br \/>\nA heap dump is a snapshot of all objects in memory, useful for memory leak detection in Java applications.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Debugging_Core_Dumps\"><\/span>Debugging Core Dumps<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To debug a core dump in Linux:<\/p>\n<ol>\n<li>Assume the binary is compiled with debug symbols.<\/li>\n<li>Set up the correct core pattern and resource limits.<\/li>\n<li>Run the program and use gdb to analyze the core dump.<\/li>\n<li>Investigate the issue by examining the backtrace. <\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Reading_Core_Dump_on_Windows\"><\/span>Reading Core Dump on Windows<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To read a core dump file on Windows:<\/p>\n<ol>\n<li>Open the dump file in Debugging Tools for Windows.<\/li>\n<li>Use appropriate commands in the command prompt to load the dump file into a debugger.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Using_Gcore\"><\/span>Using Gcore<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To generate pstack and gcore using Gcore:<\/p>\n<ol>\n<li>Identify the process ID of the suspect process using <code>ps -eaf | grep -i suspect_process<\/code>.<\/li>\n<li>Generate the gcore using the process ID: <code>gcore<\/code>.<\/li>\n<li>Create a pstack based on the generated gcore file.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Core Dumps in Linux Core dumps are created in Linux when a process receives certain signals, like SIGSEGV, due to memory access issues. Thread Dump and Heap Dump Analysis A thread dump captures the stack of all live threads, helpful in analyzing application behavior. A heap dump is a snapshot of all objects in memory, &#8230; <a title=\"What causes a core dump?\" class=\"read-more\" href=\"https:\/\/gufosaggio.net\/i\/what-causes-a-core-dump\/\" aria-label=\"Per saperne di pi\u00f9 su What causes a core dump?\">Leggi tutto<\/a><\/p>\n","protected":false},"author":4696,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-47902","post","type-post","status-publish","format-standard","hentry","category-w"],"_links":{"self":[{"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/posts\/47902","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\/4696"}],"replies":[{"embeddable":true,"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/comments?post=47902"}],"version-history":[{"count":0,"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/posts\/47902\/revisions"}],"wp:attachment":[{"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/media?parent=47902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/categories?post=47902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gufosaggio.net\/i\/wp-json\/wp\/v2\/tags?post=47902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}