title: Segmentation fault in _dl_runtime_resolve()
body: <p>I am doing simple string operations in the code where i am getting a segmention fault. I could not get what the exact problem is. 
  Please take a look if someone can help.</p>
  
  <p>The backtrace of the core is </p>
  
  <pre><code>(gdb) bt
  #0  0x00007f595dee41da in _dl_fixup () from /lib64/ld-linux-x86-64.so.2
  #1  0x00007f595deea105 in _dl_runtime_resolve () from /lib64/ld-linux-x86-64.so.2
  #2  0x0000000000401d04 in getNodeInfo (node=0x7fffbfb4ba83 "TCU-0")
      at hwdetails.cpp:294
  #3  0x0000000000402178 in main (argc=3, argv=0x7fffbfb4aef8)
      at hwdetails.cpp:369
  </code></pre>
  
  <p>At <strong>line 294</strong> the crash is coming where the <code>cout</code> statement is there.<br>
  <code>LdapDN</code> is <code>char *</code> and is not <code>NULL</code>.</p>
  
  <pre><code>if ( Epath &amp;&amp; (Epath-&gt;Entry[0].EntityType == SAHPI_ENT_UNSPECIFIED ||
           Epath-&gt;Entry[0].EntityType == SAHPI_ENT_ROOT )) {
          // nothing is mapped. Degrade the ldap dn path to slot.
          if(LdapDN){
              std::cout &lt;&lt; "LdapDN " &lt;&lt; LdapDN &lt;&lt; std::endl;
          }
          std::string ldapDN;
          ldapDN = LdapDN;
          std::string slot = LDAP_PIU_ID;
          if ( ldapDN.compare(0, slot.length(), slot) != 0 ) {
              size_t pos = ldapDN.find(slot);
              if ( pos != std::string::npos ) {
                  ldapDN = ldapDN.substr(pos);
                  LdapDN = (char *)ldapDN.c_str();
                  //getEntityPathFromLdapDn(ldapDN.c_str(), epath, domid);
              }
          }
       }
  </code></pre>