cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[ curl-Bugs-3392945 ] curl_easy_perform hanged

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Fri, 19 Aug 2011 09:37:02 +0200

Bugs item #3392945, was opened at 2011-08-17 12:27
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3392945&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: hang
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: qzy (awlike)
Assigned to: Daniel Stenberg (bagder)
Summary: curl_easy_perform hanged

Initial Comment:
I'm using libcurl 7.21.7 under Symbian S60 V5 with emulator. After building the library, i test the code from example 'httpcustomheader.c' and it hanged at curl_easy_perform.

I debugged it and found the problem is function Curl_socket_ready in file 'select.c'. The app executed the following code:

do {
    if(timeout_ms > 0) {
      pending_tv.tv_sec = pending_ms / 1000;
      pending_tv.tv_usec = (pending_ms % 1000) * 1000;
    }
    else if(!timeout_ms) {
      pending_tv.tv_sec = 0;
      pending_tv.tv_usec = 0;
    }
    r = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout);
    if(r != -1)
      break;
    error = SOCKERRNO;
    if(error && error_not_EINTR)
      break;
    if(timeout_ms > 0) {
      pending_ms = timeout_ms - elapsed_ms;
      if(pending_ms <= 0)
        break;
    }
  } while(r == -1);

Unfortunately, the app run into a dead loop. Variable timeout_ms is 0 and function select() returnd -1.
Later i tested example 'htmltitle.c', it has the same problem.

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2011-08-19 09:37

Message:
I'm closing this report as it clearly is a problem in the posix-style
network functions libcurl relies on.

----------------------------------------------------------------------

Comment By: qzy (awlike)
Date: 2011-08-19 03:51

Message:
I debugged it yestoday. It's not curl's problem but Nokia's problem. I
should place estlib.lib behind libc.lib and libstdcpp.lib.If not, call to
select and ioctl will return -1.

Another problem, send(fd, buffer, sz, flags) returned 0 but data has been
send and the socket received server's response, and send(fd, buffer, sz,
flags) may return a value larger than sz. The test app crashed because of
the strange behavior. Some one said it's SDK's bug and may be exist on
Symbian ^ 3. This seems only happen on emulator. The app didn't crash when
run on a device. I will give more test later.

Please reject or delete this bug as your want.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2011-08-17 15:13

Message:
So, select() returned -1 and 'errno' was zero? Is that even supposed to
happen? Is there anything that needs to be done to allow us to get the
actual error?

----------------------------------------------------------------------

Comment By: qzy (awlike)
Date: 2011-08-17 14:51

Message:
Hi. error was zero. And

function connect_host() gave message:
* timeout on name lookup is notsupported
* About to connect() to localhost port 80 (#0)
* Trying 127.0.0.1.. * connected
* Connected to localhost (127.0.0.1) port 80 (#0)

function Curl_do() gave message:
> GET / HTTP/1.1
Host: localhost
Accept: */*

Sorry, i'm not familiar with socket operation.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2011-08-17 13:45

Message:
Have you figured out why select() returns an error in the first place?

For this to loop, 'error' would have to be zero or EINTR after SOCKERRNO
is called. Can you check which it is and why?

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3392945&group_id=976
Received on 2011-08-19

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET