cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl crashing with PUT greater than 16399 bytes

From: Jacob S <gryla_at_earthlink.net>
Date: Fri, 30 Jan 2004 19:47:01 -0800

This is libcurl 7.11.0 build and run on OS X 10.2.8

Not sure what is causing this but here is some debug info that
illustrates the problem.
This is a dump of the headers with a PUT of 16400 bytes:

* About to connect() to xxx.xxx.xxx.xxx port 80
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 80
> PUT
/exchange/Peter/Calendar/GC.{3388A992-539D-11D8-AB79-0003939371D4-
RID}.eml HTTP/1.1
User-Agent: Test App/1.0 (MSIE 6.0; Windows NT 5.1)
Host: xxx.xxx.xxx.xxx
Pragma: no-cache
translate:f
accept:*/*
Content-Type:message/rfc822
Content-Length: 16400

< HTTP/1.1 401 Access Denied
< Server: Microsoft-IIS/5.0
< Date: Sat, 31 Jan 2004 03:26:49 GMT
< WWW-Authenticate: Negotiate
< WWW-Authenticate: NTLM
< WWW-Authenticate: Basic realm="xxx.xxx.xxx.xxx"
< Connection: close
< Content-Length: 24
< Content-Type: text/html
* Closing connection #0
* Issue another request to this URL:
'http://xxx.xxx.xxx.xxx/exchange/Peter/Calendar/GC.{3388A992-539D-11D8-
AB79-0003939371D4-RID}.eml'
* About to connect() to xxx.xxx.xxx.xxx port 80
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 80

At this point libcurl crashes with the following stack:
#0 0x90026824 in strcasecmp
#1 0x00023f6c in curl_strequal at strequal.c:38
#2 0x00027a50 in http_auth_headers at http.c:222
#3 0x00028bac in Curl_http at http.c:1096
#4 0x0001b7f4 in Curl_do at url.c:3299
#5 0x0002047c in Curl_perform at transfer.c:1895

If the test is re-run with 17000 there is an additional warning from
malloc:

* About to connect() to xxx.xxx.xxx.xxx port 80
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 80
> PUT
/exchange/Peter/Calendar/GC.{3388A992-539D-11D8-AB79-0003939371D4-
RID}.eml HTTP/1.1
User-Agent: Test App/1.0 (MSIE 6.0; Windows NT 5.1)
Host: xxx.xxx.xxx.xxx
Pragma: no-cache
translate:f
accept:*/*
Content-Type:message/rfc822
Content-Length: 17000

< HTTP/1.1 401 Access Denied
< Server: Microsoft-IIS/5.0
< Date: Sat, 31 Jan 2004 03:28:51 GMT
< WWW-Authenticate: Negotiate
< WWW-Authenticate: NTLM
< WWW-Authenticate: Basic realm="xxx.xxx.xxx.xxx"
< Connection: close
< Content-Length: 24
*** malloc[5307]: Deallocation of a pointer not malloced: 0x2e2e2e2e;
This could be a double free(), or free() called with the middle of an
allocated block; Try setting environment variable MallocHelp to see
tools to help debug
< Content-Type: text/html
* Closing connection #0
* Issue another request to this URL:
'http://xxx.xxx.xxx.xxx/exchange/Peter/Calendar/GC.{3388A992-539D-11D8-
AB79-0003939371D4-RID}.eml'
* About to connect() to xxx.xxx.xxx.xxx port 80
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 80

For a control case here is the exact same request using 16399 bytes
which succeeds:

* About to connect() to xxx.xxx.xxx.xxx port 80
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 80
> PUT
/exchange/Peter/Calendar/GC.{3388A992-539D-11D8-AB79-0003939371D4-
RID}.eml HTTP/1.1
User-Agent: Test App/1.0 (MSIE 6.0; Windows NT 5.1)
Host: xxx.xxx.xxx.xxx
Pragma: no-cache
translate:f
accept:*/*
Content-Type:message/rfc822
Content-Length: 16399

< HTTP/1.1 401 Access Denied
< Server: Microsoft-IIS/5.0
< Date: Sat, 31 Jan 2004 03:25:26 GMT
< WWW-Authenticate: Negotiate
< WWW-Authenticate: NTLM
< WWW-Authenticate: Basic realm="xxx.xxx.xxx.xxx"
< Connection: close
< Content-Length: 24
< Content-Type: text/html
* Closing connection #0
* Issue another request to this URL:
'http://xxx.xxx.xxx.xxx/exchange/Peter/Calendar/GC.{3388A992-539D-11D8-
AB79-0003939371D4-RID}.eml'
* About to connect() to xxx.xxx.xxx.xxx port 80
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 80
* Server auth using NTLM with user 'DEMO\peter'
> PUT
/exchange/Peter/Calendar/GC.{3388A992-539D-11D8-AB79-0003939371D4-
RID}.eml HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAAAgIAAAAAAAAgAAAAAAAAACAAAAA=
User-Agent: Test App/1.0 (MSIE 6.0; Windows NT 5.1)
Host: xxx.xxx.xxx.xxx
Pragma: no-cache
translate:f
accept:*/*
Content-Type:message/rfc822
Content-Length: 16399

< HTTP/1.1 401 Access Denied
< Server: Microsoft-IIS/5.0
< Date: Sat, 31 Jan 2004 03:25:26 GMT
< WWW-Authenticate: NTLM
TlRMTVNTUAACAAAAAAAAADAAAAACAgAASvoABXA8iUsAAAAAAAAAAAAAAAAwAAAA
< Content-Length: 24
< Content-Type: text/html
* Ignoring the response-body
* Connection #0 left intact
* Issue another request to this URL:
'http://xxx.xxx.xxx.xxx/exchange/Peter/Calendar/GC.{3388A992-539D-11D8-
AB79-0003939371D4-RID}.eml'
* Re-using existing connection! (#0)
* Connected to (xxx.xxx.xxx.xxx) port 80
* Server auth using NTLM with user 'DEMO\peter'
> PUT
/exchange/Peter/Calendar/GC.{3388A992-539D-11D8-AB79-0003939371D4-
RID}.eml HTTP/1.1
Authorization: NTLM
TlRMTVNTUAADAAAAGAAYAEkAAAAAAAAAYQAAAAQABABAAAAABQAFAEQAAAAAAAAASQAAAAAA
AABhAAAAAYIAAERFTU9wZXRlcqM96teGl3lD6j2O7j0sGUpuYu5PxevrQA==
User-Agent: Test App/1.0 (MSIE 6.0; Windows NT 5.1)
Host: xxx.xxx.xxx.xxx
Pragma: no-cache
translate:f
accept:*/*
Content-Type:message/rfc822
Content-Length: 16399

< HTTP/1.1 100 Continue
< Server: Microsoft-IIS/5.0
< Date: Sat, 31 Jan 2004 03:25:26 GMT
< X-Powered-By: ASP.NET
< HTTP/1.1 201 Created
< Server: Microsoft-IIS/5.0
< Date: Sat, 31 Jan 2004 03:25:26 GMT
< X-Powered-By: ASP.NET
< MS-Exchange-Permanent-URL:
http://xxx.xxx.xxx.xxx/exchange/Peter/-FlatUrlSpace-/
91264ed6e2422f44a4ac29b0a6692150-13aa/91264ed6e2422f44a4ac29b0a6692150-
d0265
< Location:
http://xxx.xxx.xxx.xxx/exchange/Peter/Calendar/GC.{3388A992-539D-11D8-
AB79-0003939371D4-RID}.eml
< Repl-UID: <rid:91264ed6e2422f44a4ac29b0a66921500000000d0265>
< Content-Type: text/html
< Content-Length: 123
< Allow: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, COPY, MOVE, PROPFIND,
PROPPATCH, SEARCH, SUBSCRIBE, UNSUBSCRIBE, POLL, BDELETE, BCOPY, BMOVE,
BPROPPATCH, BPROPFIND, LOCK, UNLOCK
< ResourceTag:
<rt:91264ed6e2422f44a4ac29b0a66921500000000d026591264ed6e2422f44a4ac29b0
a66921500000000d9573>
< MS-WebStorage: 6.0.6249
< GetETag: "91264ed6e2422f44a4ac29b0a66921500000000d9573"
* Connection #0 left intact

Sorry for the length of the message. Any thoughts?

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-01-31