cURL / Mailing Lists / curl-library / Single Mail

curl-library

Segmentation fault in SCO Unixware with libcurl,why?

From: 黄志军 <hzhijun_at_huawei.com>
Date: Tue, 19 Oct 2004 20:00:34 +0800

Platform Information: UnixWare sco-gfep 5 7.1.1 i386 x86at SCO UNIX_SVR5

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Below is the information about core dump:

Program received signal SIGSEGV, Segmentation fault.

#0 0xbff36ad0 in _s_port_lock () from /home/cry/lib/libcurl.so.3
#1 0xbff597fd in curl_strnequal (first=0xbff68248 "HTTP/", second=0x80e21d0 "HTTP/1.1 200 OK\r\n", max=5) at strequal.c:60
#2 0xbff56d52 in checkhttpprefix (data=0x5, s=0x80e21d0 "HTTP/1.1 200 OK\r\n") at transfer.c:184
#3 0xbff57112 in Curl_readwrite (conn=0x80e25b8, done=0x7ffff5c3 "") at transfer.c:386
#4 0xbff58d5b in Transfer (conn=0x80e25b8) at transfer.c:1480
#5 0xbff59593 in Curl_perform (data=0x80d9e60) at transfer.c:1985
#6 0xbff5a1b9 in curl_easy_perform (curl=0x80d9e60) at easy.c:378
#7 0x804ac02 in main () at httpget.c:32

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
My test program is as follows:

/*****************************************************************************
 * _ _ ____ _
 * Project ___| | | | _ \| |
 * / __| | | | |_) | |
 * | (__| |_| | _ <| |___
 * \___|\___/|_| \_\_____|
 *
 * $Id: http-post.c,v 1.1 2002/01/10 09:00:02 bagder Exp $
 */

#include <stdio.h>
#include <curl/curl.h>

int main(void)
{
  CURL *curl;
  CURLcode res;

  printf("begin\n");
  curl = curl_easy_init();
  if(curl) {
    /* First set the URL that is about to receive our POST. This URL can
       just as well be a https:// URL if that is what should receive the
       data. */
    curl_easy_setopt(curl, CURLOPT_URL, "http://10.70.107.123/index.htm");
    /* Now specify the POST data */
    //curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "name=daniel&project=curl");
    curl_easy_setopt(curl, CURLOPT_HTTPGET, 1);

    /* Perform the request, res will get the return code */
    res = curl_easy_perform(curl);
    printf("res=%d\n", res);

    /* always cleanup */
    curl_easy_cleanup(curl);
  }
  return 0;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
My make step:
1)
gcc -c -g -I/home/cry/curl/include httpget.c
2)
gcc -L/home/cry/curl/lib -lcurl -L/home/devenv/ssl/lib -lssl -lcrypto -lsocket -o httpget httpget.o

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Possible information maybe help :

<114 sco-gcry.sco-gcry [tfm] :/home/cry/curl-7.12.0/docs/examples>ls -lF /home/cry/curl/lib
total 11664
-rw-r--r-- 1 cry other 3090488 Oct 19 10:40 libcurl.a
-rwxr-xr-x 1 cry other 864 Oct 19 10:40 libcurl.la*
lrwxrwxrwx 1 cry other 16 Oct 19 10:40 libcurl.so -> libcurl.so.3.0.0*
lrwxrwxrwx 1 cry other 16 Oct 19 10:40 libcurl.so.3 -> libcurl.so.3.0.0*
-rwxr-xr-x 1 cry other 2878912 Oct 19 10:40 libcurl.so.3.0.0*
Received on 2004-10-19