www.digitalmars.com         C & C++   DMDScript  

c++.command-line - libcurl , DMC

reply "C" <dont respond.com> writes:
Hey all,

Im building libcurl with DMC ( www.atari-soldiers.com/libcurlDMC.zip ) and
it builds ok , but when I compile the simple.c example it crashes.

The line that crashes is

url.c  , line 2116

if((1 > sscanf(data->change.url, "%512[^\n/?]%[^\n]",conn->gname,
conn->path)) )

I dont use sscanf , I think this is supposed to format it by stripping the
http:// of a URL string , but I cant read it.

Why would this be causing DMC to crash , and not others ?

Any help is super appreciated.

Thanks,
Charles
Feb 18 2004
next sibling parent reply C <dont respond.com> writes:
Hmm, changing the URL a bit, it crashes a bit earlier on with sscanf aga=
in.

if((2 =3D=3D sscanf(data->change.url, "%64[^:]:%[^\n]",
			conn->protostr,
			conn->path)) && strequal(conn->protostr, "file"))

Is there a known issue with sscanf ?

C

On Wed, 18 Feb 2004 21:07:28 -0800, C <dont respond.com> wrote:

 Hey all,

 Im building libcurl with DMC ( www.atari-soldiers.com/libcurlDMC.zip )=

 and
 it builds ok , but when I compile the simple.c example it crashes.

 The line that crashes is

 url.c  , line 2116

 if((1 > sscanf(data->change.url, "%512[^\n/?]%[^\n]",conn->gname,
 conn->path)) )

 I dont use sscanf , I think this is supposed to format it by stripping=

 the
 http:// of a URL string , but I cant read it.

 Why would this be causing DMC to crash , and not others ?

 Any help is super appreciated.

 Thanks,
 Charles

-- = Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Feb 18 2004
parent "Walter" <walter digitalmars.com> writes:
No, no known issues with sscanf.

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

"C" <dont respond.com> wrote in message news:opr3lrcsozehmtou localhost...
Hmm, changing the URL a bit, it crashes a bit earlier on with sscanf again.

if((2 == sscanf(data->change.url, "%64[^:]:%[^\n]",
conn->protostr,
conn->path)) && strequal(conn->protostr, "file"))

Is there a known issue with sscanf ?

C
Feb 19 2004
prev sibling next sibling parent reply "Walter" <walter digitalmars.com> writes:
"C" <dont respond.com> wrote in message
news:c118pk$168f$1 digitaldaemon.com...
 Hey all,

 Im building libcurl with DMC ( www.atari-soldiers.com/libcurlDMC.zip ) and
 it builds ok , but when I compile the simple.c example it crashes.

 The line that crashes is

 url.c  , line 2116

 if((1 > sscanf(data->change.url, "%512[^\n/?]%[^\n]",conn->gname,
 conn->path)) )

 I dont use sscanf , I think this is supposed to format it by stripping the
 http:// of a URL string , but I cant read it.

 Why would this be causing DMC to crash , and not others ?

 Any help is super appreciated.

 Thanks,
 Charles

Please cut it down to the smallest reproducible example, and send it to me so I can fix it. Thanks, -Walter
Feb 18 2004
parent reply C <dont respond.com> writes:
Hmm appears I was wrong , the problem seems to stem from

   entry_id =3D create_hostcache_id(hostname, port, &entry_len);

Its late though, ill have to look more into it later.  Thought i'd menti=
on =

incase someone else ran across this ?

thx
C

On Wed, 18 Feb 2004 19:28:03 -0800, Walter <walter digitalmars.com> wrot=
e:

 "C" <dont respond.com> wrote in message
 news:c118pk$168f$1 digitaldaemon.com...
 Hey all,

 Im building libcurl with DMC ( www.atari-soldiers.com/libcurlDMC.zip =


 and
 it builds ok , but when I compile the simple.c example it crashes.

 The line that crashes is

 url.c  , line 2116

 if((1 > sscanf(data->change.url, "%512[^\n/?]%[^\n]",conn->gname,
 conn->path)) )

 I dont use sscanf , I think this is supposed to format it by strippin=


 the
 http:// of a URL string , but I cant read it.

 Why would this be causing DMC to crash , and not others ?

 Any help is super appreciated.

 Thanks,
 Charles

Please cut it down to the smallest reproducible example, and send it t=

 me
 so I can fix it. Thanks, -Walter

-- = D Newsgroup.
Mar 20 2004
parent reply C <dont respond.com> writes:
VGhhdCB3YXMgYSBzaWxseSBwb3N0IHNvcnJ5LCB0aGluayBJdmUgZm91bmQgdGhl
IHByb2JsZW0uDQoNCg0KLyogQ3JlYXRlIGEgaG9zdGNhY2hlIGlkICovDQpzdGF0
aWMgY2hhciAqDQpjcmVhdGVfaG9zdGNhY2hlX2lkKGNoYXIgKnNlcnZlciwgaW50
IHBvcnQsIHNzaXplX3QgKmVudHJ5X2xlbikNCnsNCg0KICAg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VUkwgc3RyaW5nICwgYnV0IEkgY2FudCByZWFkIGl0Lg0KPj4+Pg0KPj4+PiBX
aHkgd291bGQgdGhpcyBiZSBjYXVzaW5nIERNQyB0byBjcmFzaCAsIGFuZCBub3Qg
b3RoZXJzID8NCj4+Pj4NCj4+Pj4gQW55IGhlbHAgaXMgc3VwZXIgYXBwcmVjaWF0
ZWQuDQo+Pj4+DQo+Pj4+IFRoYW5rcywNCj4+Pj4gQ2hhcmxlcw0KPj4+DQo+Pj4g
UGxlYXNlIGN1dCBpdCBkb3duIHRvIHRoZSBzbWFsbGVzdCByZXByb2R1Y2libGUg
ZXhhbXBsZSwgYW5kIHNlbmQgaXQgDQo+Pj4gdG8gbWUNCj4+PiBzbyBJIGNhbiBm
aXggaXQuIFRoYW5rcywgLVdhbHRlcg0KPj4+DQo+Pj4NCj4+DQo+Pg0KPj4NCj4N
Cj4NCj4NCg0KDQoNCi0tIA0KRCBOZXdzZ3JvdXAu
Mar 20 2004
parent "Walter" <walter digitalmars.com> writes:
"C" <dont respond.com> wrote in message news:opr46ls1amehmtou localhost...
 Replacing this with GlobalAlloc succeeds, but then fails on this function

          if ((size = sprintf(id, "%s:%d", server, port)) != *entry_len) {
                  /* Free the allocated id, set length to zero and return
 NULL */
                  printf("ID : %s\nSIZE : %d",id,size);
                  *entry_len = 0;
                  free(id);
                  return NULL;
          }

 Where sprintf returns 15 ( the length of the string WITHOUT all those
 spaces ) , but *entry_len is 512.

 After compiling this with VC , those spaces should not be in there, so I
 think the problem is still with sscanf.  Sorry if im flooding writing this
 out helps me diagnose.

It sure sounds like a memory corruption bug, which could be anywhere. If you think sscanf is the culprit, try replacing it with some other function.
Mar 21 2004
prev sibling parent -scooter- <scottm cs.ucla.edu> writes:
Charles:

If you really felt enterprising enough -- the C RTL source is included on 
the CD -- you could copy over the scanf.c source (that's its name), compile 
it with libcurl, and actually diagnose the problem yourself, fix it, provide 
patch file.


-scooter

C wrote:

 Hey all,
 
 Im building libcurl with DMC ( www.atari-soldiers.com/libcurlDMC.zip ) and
 it builds ok , but when I compile the simple.c example it crashes.
 
 The line that crashes is
 
 url.c  , line 2116
 
 if((1 > sscanf(data->change.url, "%512[^\n/?]%[^\n]",conn->gname,
 conn->path)) )
 
 I dont use sscanf , I think this is supposed to format it by stripping the
 http:// of a URL string , but I cant read it.
 
 Why would this be causing DMC to crash , and not others ?
 
 Any help is super appreciated.
 
 Thanks,
 Charles
 
 

Feb 19 2004