title: gdb/ddd Program received signal SIGILL
body: <p>I wrote a very simple program in Linux using c++, which downloads images from some website over http (basically developed a http client request), using cURL libraries. <a href="http://curl.haxx.se/libcurl/c/allfuncs.html" rel="noreferrer">http://curl.haxx.se/libcurl/c/allfuncs.html</a></p>
  
  <pre><code>#define CURL_STATICLIB
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;/usr/include/curl/curl.h&gt;
  #include &lt;/usr/include/curl/stdcheaders.h&gt;
  #include &lt;/usr/include/curl/easy.h&gt;
  
  size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) {
      size_t written = fwrite(ptr, size, nmemb, stream);
      return written;
  }
  
  int main(void) {
      CURL *curl;
      FILE *fp;
      CURLcode res;
  
      char *url = "http://www.example.com/test_img.png"; 
      char outfilename[FILENAME_MAX] = "/home/c++_proj/output/web_req_img.png";
      curl = curl_easy_init();
      if (curl) {
          fp = fopen(outfilename,"wb");
          curl_easy_setopt(curl, CURLOPT_URL, url);
          curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
          curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
          res = curl_easy_perform(curl);
          /* always cleanup */
          curl_easy_cleanup(curl);
          fclose(fp);
      }
      return 0;
  }
  </code></pre>
  
  <p>I verified the code, and it works fine. I can see the image is downloaded and that I can view the image (with no errors or warnings). Since I plan on expanding my code, I tried to install ddd, and use the debugger, but the debugger doesn't work, and my program exits with some sort of Signal errors, when I try to run my program with ddd.</p>
  
  <p>This is the error:</p>
  
  <pre><code> (Threadd debugging using libthread_db enabled)
   Using host libthread_db library "/lib/arm-linux-gnueadihf/libthread_db.so.1"
  
   Program received signal SIGILL, illegal instruction.
   0xb6a5c4C0 in ?? () from /usr/lib/arm-linux-gnueadbihf/libcrypto.so.1.0.0
  </code></pre>
  
  <p>First I thought that I didn't properly install ddd, so I went back to gdb, but I get the exact same errors, when I run the program. (And I believe that I am using the latest version of gdb and ddd)</p>
  
  <p>Then I tried to use ddd on another simple program, that doesn't involve cURL library, and it worked fine !!!</p>
  
  <p>Does anyone know why this is the case, and what is the solution? Do I somehow need to point to cURL libraries while ddd is running? But, in the past, I don't recall doing this with different set of libraries! Maybe it is something abuot the cURL that ddd doesn't like? But the program runs fine itself without the debugger! I would appreciate some help.</p>