{"id":61,"date":"2008-01-21T12:20:19","date_gmt":"2008-01-21T12:20:19","guid":{"rendered":"http:\/\/blog.danplanet.com\/wordpress\/?p=61"},"modified":"2011-11-29T16:28:08","modified_gmt":"2011-11-29T16:28:08","slug":"debugging-provider-crashes-on-sfcb-with-gdb","status":"publish","type":"post","link":"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/","title":{"rendered":"Debugging provider crashes on SFCB with gdb"},"content":{"rendered":"<p>I&#8217;ve never had to debug a multi-process program with GDB before.\u00a0 Mostly because I do a lot of my debugging with printf() and elbow-grease.\u00a0 However, a CIM provider is in an environment where a crash happen within the broker, which means you can&#8217;t (easily) add print statements to the appropriate place.\u00a0 If you pass something broken to a CBFoo() call, the CIMOM will crash a ways down the line.<\/p>\n<p>With Pegsus, you can turn off provider processes, which forces thread-only mode.\u00a0 This means that the whole CIMOM is vulnerable to a bad provider, but it also means that running the cimserver in gdb is easy and straightforward.\u00a0 Doing the same in SFCB, however, is not as simple.\u00a0 Your bad provider ends up in a child of the main process, which crashes without GDB&#8217;s full attention, which isn&#8217;t very helpful.<\/p>\n<p>While helping to debug a particularly nasty crash with an Indication provider, I learned a (relatively) easy way to catch the crash with GDB.\u00a0 First, I started SFCB and subscribed to the indication.\u00a0 This forked off a process to host the provider.\u00a0 While in the simple case, the PID of the new process will be the highest-numbered sfcbd process, you can also find out which one it is with something like this:<\/p>\n<blockquote style=\"font-family: Courier New,Courier,mono;\"><p>% PROV=libVirtComputerSystemIndication<br \/>\n% for i in $(ps ax | grep sfcbd | awk &#8216;{print $1}&#8217<img decoding=\"async\" src=\"https:\/\/www.danplanet.com\/blog\/wp-content\/themes\/wordpress-grey-opaque-master\/images\/smilies\/icon_wink.gif\" alt=\"Smilie: ;)\" title=\"Smilie: ;)\" \/>; do<br \/>\n&gt; grep -q $PROV \/proc\/$i\/maps &amp;&amp; echo $i;<br \/>\n&gt; done<\/p><\/blockquote>\n<p>That checks all of the currently running sfcbd processes to see which has your provider loaded and prints the PID.\u00a0 Next, I attached to the process with gdb and allowed it to continue:<\/p>\n<blockquote style=\"font-family: Courier New,Courier,mono;\"><p>% S gdb \/usr\/local\/sbin\/sfcbd<br \/>\nGNU gdb 6.6<br \/>\nCopyright (C) 2006 Free Software Foundation, Inc.<br \/>\nGDB is free software, covered by the GNU General Public License, and you are<br \/>\nwelcome to change it and\/or distribute copies of it under certain conditions.<br \/>\nType &#8220;show copying&#8221; to see the conditions.<br \/>\nThere is absolutely no warranty for GDB.\u00a0 Type &#8220;show warranty&#8221; for details.<br \/>\nThis GDB was configured as &#8220;x86_64-suse-linux&#8221;&#8230;<br \/>\nUsing host libthread_db library &#8220;\/lib64\/libthread_db.so.1&#8221;.<br \/>\n(gdb) attach 5832<br \/>\n&lt;snip&gt;<br \/>\n(gdb) c<\/p><\/blockquote>\n<p>Next, I triggered the crash and GDB caught it, allowing me to get a stack trace and examime the situation a little.\u00a0 After that, figuring out the issue was easy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve never had to debug a multi-process program with GDB before.\u00a0 Mostly because I do a lot of my debugging with printf() and elbow-grease.\u00a0 However, a CIM provider is in an environment where a crash happen within the broker, which &hellip; <a href=\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/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":[12],"tags":[28,41,40],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-codemonkeying","tag-cim","tag-sblim","tag-sfcb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Debugging provider crashes on SFCB with gdb - Right Angles<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Debugging provider crashes on SFCB with gdb - Right Angles\" \/>\n<meta property=\"og:description\" content=\"I&#8217;ve never had to debug a multi-process program with GDB before.\u00a0 Mostly because I do a lot of my debugging with printf() and elbow-grease.\u00a0 However, a CIM provider is in an environment where a crash happen within the broker, which &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/\" \/>\n<meta property=\"og:site_name\" content=\"Right Angles\" \/>\n<meta property=\"article:published_time\" content=\"2008-01-21T12:20:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-11-29T16:28:08+00:00\" \/>\n<meta name=\"author\" content=\"Dan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/\"},\"author\":{\"name\":\"Dan\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c\"},\"headline\":\"Debugging provider crashes on SFCB with gdb\",\"datePublished\":\"2008-01-21T12:20:19+00:00\",\"dateModified\":\"2011-11-29T16:28:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/\"},\"wordCount\":393,\"publisher\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c\"},\"keywords\":[\"CIM\",\"sblim\",\"sfcb\"],\"articleSection\":[\"Codemonkeying\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/\",\"url\":\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/\",\"name\":\"Debugging provider crashes on SFCB with gdb - Right Angles\",\"isPartOf\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/#website\"},\"datePublished\":\"2008-01-21T12:20:19+00:00\",\"dateModified\":\"2011-11-29T16:28:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.danplanet.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Debugging provider crashes on SFCB with gdb\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/#website\",\"url\":\"https:\/\/www.danplanet.com\/blog\/\",\"name\":\"Right Angles\",\"description\":\"If they&#039;re not right...they&#039;re wrong\",\"publisher\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.danplanet.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c\",\"name\":\"Dan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9b73782704be64dd8c030087af2d1ae0c1dc488cad69093ff0366dbaad2de673?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9b73782704be64dd8c030087af2d1ae0c1dc488cad69093ff0366dbaad2de673?s=96&d=mm&r=g\",\"caption\":\"Dan\"},\"logo\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/www.danplanet.com\/blog\/author\/dan\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Debugging provider crashes on SFCB with gdb - Right Angles","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/","og_locale":"en_US","og_type":"article","og_title":"Debugging provider crashes on SFCB with gdb - Right Angles","og_description":"I&#8217;ve never had to debug a multi-process program with GDB before.\u00a0 Mostly because I do a lot of my debugging with printf() and elbow-grease.\u00a0 However, a CIM provider is in an environment where a crash happen within the broker, which &hellip; Continue reading &rarr;","og_url":"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/","og_site_name":"Right Angles","article_published_time":"2008-01-21T12:20:19+00:00","article_modified_time":"2011-11-29T16:28:08+00:00","author":"Dan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dan","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/#article","isPartOf":{"@id":"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/"},"author":{"name":"Dan","@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c"},"headline":"Debugging provider crashes on SFCB with gdb","datePublished":"2008-01-21T12:20:19+00:00","dateModified":"2011-11-29T16:28:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/"},"wordCount":393,"publisher":{"@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c"},"keywords":["CIM","sblim","sfcb"],"articleSection":["Codemonkeying"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/","url":"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/","name":"Debugging provider crashes on SFCB with gdb - Right Angles","isPartOf":{"@id":"https:\/\/www.danplanet.com\/blog\/#website"},"datePublished":"2008-01-21T12:20:19+00:00","dateModified":"2011-11-29T16:28:08+00:00","breadcrumb":{"@id":"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.danplanet.com\/blog\/2008\/01\/21\/debugging-provider-crashes-on-sfcb-with-gdb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.danplanet.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Debugging provider crashes on SFCB with gdb"}]},{"@type":"WebSite","@id":"https:\/\/www.danplanet.com\/blog\/#website","url":"https:\/\/www.danplanet.com\/blog\/","name":"Right Angles","description":"If they&#039;re not right...they&#039;re wrong","publisher":{"@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.danplanet.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c","name":"Dan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9b73782704be64dd8c030087af2d1ae0c1dc488cad69093ff0366dbaad2de673?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9b73782704be64dd8c030087af2d1ae0c1dc488cad69093ff0366dbaad2de673?s=96&d=mm&r=g","caption":"Dan"},"logo":{"@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/image\/"},"url":"https:\/\/www.danplanet.com\/blog\/author\/dan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":1,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":145,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions\/145"}],"wp:attachment":[{"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}