Shrek Qian | 1 Dec 2009 11:02
Picon
Gravatar

Curl segmentation fault when curl_easy_cleanup

Hi, everyone.


This is Shrek. Now I have this issue, anyone can help me?

One thread is waiting at curl_easy_perform(), then another thread trying to clean up this curl handle, then coredump. The curl_easy_perform() returned with error string "failed sending data to the peer".

The back trace is as below
#0  0x118dd7f2 in ?? ()
#1  0x11b287d1 in abort () from /root/sfcdb_gdb/208777_esx40u2/lib/libc.so.6
#2  0x11b5f33b in ?? () from /root/sfcdb_gdb/208777_esx40u2/lib/libc.so.6
#3  0x11b6718d in ?? () from /root/sfcdb_gdb/208777_esx40u2/lib/libc.so.6
#4  0x11b6ad80 in free () from /root/sfcdb_gdb/208777_esx40u2/lib/libc.so.6
#5  0x154f8014 in Curl_safefree () from /root/sfcdb_gdb/208777_esx40u2/lib/libcurl.so.4
#6  0x154f86ec in ?? () from /root/sfcdb_gdb/208777_esx40u2/lib/libcurl.so.4
#7  0x154f87ee in Curl_rm_connc () from /root/sfcdb_gdb/208777_esx40u2/lib/libcurl.so.4
#8  0x154fa549 in Curl_close () from /root/sfcdb_gdb/208777_esx40u2/lib/libcurl.so.4
#9  0x15507631 in curl_easy_cleanup () from /root/sfcdb_gdb/208777_esx40u2/lib/libcurl.so.4
..........................................................

I knew basic rule is that you must never share a libcurl handle (be it easy or multi or whatever) between multiple threads. But I think if we required to terminated all connections in one thread to invoke cleanup is reasonable, and the existed code is hard to modify. Do you have any suggestion about the core and potential fix?

Thanks & best wishes.

Shrek Qian
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Daniel Stenberg | 1 Dec 2009 11:06
Picon
Favicon
Gravatar

Re: Curl segmentation fault when curl_easy_cleanup

On Tue, 1 Dec 2009, Shrek Qian wrote:

> I knew basic rule is that you must never share a libcurl handle (be it easy
> or multi or whatever) between multiple threads. But I think if we required
> to terminated all connections in one thread to invoke cleanup is reasonable,
> and the existed code is hard to modify. Do you have any suggestion about the
> core and potential fix?

You're on the wrong mailing list. Use curl-library for libcurl stuff.

So you're saying you know about the rule, but you still violate it and now you 
ask us how to deal with it?

My advice: don't share handles between threads, as documented.

--

-- 

  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Ciprian Dorin, Craciun | 1 Dec 2009 18:28
Picon
Gravatar

cURL tool static build

    Hello all!

    I know that this question has been made thousands of times on the
mailing list, but here goes again :)...

    How do I make curl compile statically? (I mean the curl tool, not
another executable that uses libcurl).

    I've tried the following combinations:
~~~~
./configure --disable-shared --enable-static
~~~~
export LDFLAGS=-static
./configure --disable-shared --enable-static
~~~~
export LIBS=-static
./configure --disable-shared --enable-static
~~~~
export LDFLAGS=-static
export LIBS=-static
./configure --disable-shared --enable-static
~~~~
export CFLAGS=-static
export LDFLAGS=-static
export LIBS=-static
./configure --disable-shared --enable-static
~~~~
    (and some other combinations...)

    Am I doing something wrong?

    Thanks,
    Ciprian.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Borden, Michael | 1 Dec 2009 21:48

application does not support the browser being used...

History..

 

On Server A that is AIX 5.3

 With IBM HTTP server 6.0.2.21

WAS 6.0.2.21

With cURL 7.10.7

Mozilla 1.7.13

 

Curl works fine with the following command line…

 

curl --dump-header ${DMPFILE} -d "_ssoUser=$JOB_UID&_ssoPass=$JOB_PWD&_action=LOGIN&_fromLoginPage=TRUE&_language&_ssoOrigUrl=http:/ /${SERVERNAME}/lawson/portal/logondone.htm" http://${SERVERNAME}/sso/SSOServlet

 

What we are basically doing is creating a dump file that will send a request for a batch job on that server. These are programs that will run by submitting another request to the server. I can post the other command, but I can not get past the command above.

 

On Server B that is AIX6.1

 IBM HTTP server 7.0.0.5

WAS 7.0.0.5

The same cURL version as above.

Mozilla Firefox 2.0.0.17

 

I run the same command as above and get this error…

 

 

<MSG>This application does not support the browser you are using (curl/7.10.7 (powerpc-ibm-aix5.1.0.0) libcurl/7.10.7 zlib/1.1.4). P

lease try again using Microsoft IE or Mozilla FireFox.</MSG>

 

The cURL executable was copied from 5.3 to 6.1. So, yes it is an older version of cURL.

 

I have tried downloading and compiling the newest version, but got compile errors. The Sys Admin is currently looking at that cause it looks like a license issue. So, I decided to post these questions.

 

 

The questions I have are…

 

1.  Does the cURL version that we are using not work with newer versions of FireFox? Firefox is installed on both servers.

2.  What do you think is causing the problems that I’m seeing?

 

Thanks!

 

Mike

 

 


Email Disclaimer: www.stjude.org/emaildisclaimer
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Jim.Young | 1 Dec 2009 22:20
Picon
Favicon

RE: application does not support the browser being used...

Mike wrote:

 

History..

 

On Server A that is AIX 5.3

 With IBM HTTP server 6.0.2.21

WAS 6.0.2.21

With cURL 7.10.7

Mozilla 1.7.13

 

Curl works fine with the following command line…

 

curl --dump-header ${DMPFILE} -d "_ssoUser=$JOB_UID&_ssoPass=$JOB_PWD&_action=LOGIN&_fromLoginPage=TRUE&_language&_ssoOrigUrl=http:/ /${SERVERNAME}/lawson/portal/logondone.htm" http://${SERVERNAME}/sso/SSOServlet

 

What we are basically doing is creating a dump file that will send a request for a batch job on that server. These are programs that will run by submitting another request to the server. I can post the other command, but I can not get past the command above.

 

On Server B that is AIX6.1

 IBM HTTP server 7.0.0.5

WAS 7.0.0.5

The same cURL version as above.

Mozilla Firefox 2.0.0.17

 

I run the same command as above and get this error…

 

 

<MSG>This application does not support the browser you are using (curl/7.10.7 (powerpc-ibm-aix5.1.0.0) libcurl/7.10.7 zlib/1.1.4). P

lease try again using Microsoft IE or Mozilla FireFox.</MSG>

 

The cURL executable was copied from 5.3 to 6.1. So, yes it is an older version of cURL.

 

I have tried downloading and compiling the newest version, but got compile errors. The Sys Admin is currently looking at that cause it looks like a license issue. So, I decided to post these questions.

 

 

The questions I have are…

 

1.       Does the cURL version that we are using not work with newer versions of FireFox? Firefox is installed on both servers.

2.       What do you think is causing the problems that I’m seeing?

 

I’m a little unclear as to exactly where you are running curl but if it’s from AIX, I got a precompiled version from http://www.perzl.org/aix that works great.  You need to download a number of packages (curl , expat, gettext, glib2, info, libidn, libssh2, openssl,  pcre, pkg-config and zlib) for it to install completely but it’s fairly straight forward and has all the latest & greatest features & fixes.

 

As for getting the web server to work with curl, could you use the “–user-agent” option to make it think it’s talking to Mozilla (a.k.a. Firefox) rather than curl.

 

Jim Young

 

 

 

Email Disclaimer: www.stjude.org/emaildisclaimer

CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Daniel Stenberg | 1 Dec 2009 22:42
Picon
Favicon
Gravatar

Re: application does not support the browser being used...

On Tue, 1 Dec 2009, Borden, Michael wrote:

> I run the same command as above and get this error...
>
> <MSG>This application does not support the browser you are using 
> (curl/7.10.7 (powerpc-ibm-aix5.1.0.0) libcurl/7.10.7 zlib/1.1.4). Please 
> try again using Microsoft IE or Mozilla FireFox.</MSG>

That's something the server end decided to spew out based on some heuristics 
that we don't know about. Most likely based on the user-agent string, or 
cookies or something else.

> The cURL executable was copied from 5.3 to 6.1. So, yes it is an older 
> version of cURL.

"older" being an understatement. >6 years old, 5 security vulnerabilities and 
866 documented bug fixes since...

> 1.  Does the cURL version that we are using not work with newer versions of 
> FireFox? Firefox is installed on both servers.

curl doesn't work with firefox at all and it doesn't care about it the 
slightest. So no.

--

-- 

  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Pletter Thomas | 2 Dec 2009 07:31
Picon

RE: cURL tool static build

hello,

I had also the same problem. I wanted to compile statically for HPUX and
it only works with Environment Variable
LD_LIBRARY_PATH. All options for "configure" have no influence for the
compilation. So we created a fix in script "configure" !
Then it works. If you want the fix, i can send it.

regards,Tom

______________________________________

HINWEIS:
Alle von Gesellschaften der REWE International AG elektronisch uebermittelten Auskuenfte, Mitteilungen
und Erklaerungen sind vertraulich und rechtlich unverbindlich. Verpflichtungen von Gesellschaften der
REWE International AG beduerfen der schriftlichen Einigung in saemtlichen Vertragspunkten sowie der Unterfertigung
durch das vertretungsbefugte Organ. Im Falle einer Fehluebermittlung ersuchen wir um Benachrichtigung
sowie um
Vernichtung und Beachtung, dass jegliche Form der Verwendung und Weitergabe der Inhalte an Dritte
unzulaessig ist.

NOTICE:
All notices, declarations and explanations transferred electronically from REWE International AG companies
are confidential and not legally binding. Obligations of  REWE International AG companies arise only when written
agreement to all contractual points has been confirmed in writing with the signature of an authorized representative.
If this e-mail was sent by mistake, please inform  us immediately. Furthermore we also request you to
destroy it
and use neither the contents nor disclose them in any manner to third parties.

-----Original Message-----
From: curl-users-bounces <at> cool.haxx.se
[mailto:curl-users-bounces <at> cool.haxx.se] On Behalf Of Ciprian Dorin,
Craciun
Sent: Tuesday, December 01, 2009 6:29 PM
To: curl-users <at> cool.haxx.se
Subject: cURL tool static build

    Hello all!

    I know that this question has been made thousands of times on the
mailing list, but here goes again :)...

    How do I make curl compile statically? (I mean the curl tool, not
another executable that uses libcurl).

    I've tried the following combinations:
~~~~
./configure --disable-shared --enable-static
~~~~
export LDFLAGS=-static
./configure --disable-shared --enable-static
~~~~
export LIBS=-static
./configure --disable-shared --enable-static
~~~~
export LDFLAGS=-static
export LIBS=-static
./configure --disable-shared --enable-static
~~~~
export CFLAGS=-static
export LDFLAGS=-static
export LIBS=-static
./configure --disable-shared --enable-static
~~~~
    (and some other combinations...)

    Am I doing something wrong?

    Thanks,
    Ciprian.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Thomas Langstadlinger | 2 Dec 2009 09:00
Favicon

Colon in usernames

Der all,

I have a problem with Digest authentication. I have some usernames for autentication wich include a colon (":") and the user names can't be changed.
The problem is that a colon is the separator for username:password.

For instance:
User = sip:username <at> domain
Pass = secret12345

In my output file I get this commented line: * Server auth using Digest with user 'sip'
But it should be sip:username <at> domain ...

Is there a way to change the input method or to avoid this problem? I tried many possibilities but couldn't figure out the right way.

I would really appreciate your help.
Thanks in adva nce!

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Ciprian Dorin, Craciun | 2 Dec 2009 09:00
Picon
Gravatar

Re: cURL tool static build

On Wed, Dec 2, 2009 at 8:31 AM, Pletter Thomas <T.Pletter <at> rewe-group.at> wrote:
> hello,
>
> I had also the same problem. I wanted to compile statically for HPUX and
> it only works with Environment Variable
> LD_LIBRARY_PATH. All options for "configure" have no influence for the
> compilation. So we created a fix in script "configure" !
> Then it works. If you want the fix, i can send it.
>
> regards,Tom
>
>
> -----Original Message-----
> From: curl-users-bounces <at> cool.haxx.se
> [mailto:curl-users-bounces <at> cool.haxx.se] On Behalf Of Ciprian Dorin,
> Craciun
> Sent: Tuesday, December 01, 2009 6:29 PM
> To: curl-users <at> cool.haxx.se
> Subject: cURL tool static build
>
>    Hello all!
>
>    I know that this question has been made thousands of times on the
> mailing list, but here goes again :)...
>
>    How do I make curl compile statically? (I mean the curl tool, not
> another executable that uses libcurl).
>
>    I've tried the following combinations:
> ~~~~
> ./configure --disable-shared --enable-static
> ~~~~
> export LDFLAGS=-static
> ./configure --disable-shared --enable-static
> ~~~~
> export LIBS=-static
> ./configure --disable-shared --enable-static
> ~~~~
> export LDFLAGS=-static
> export LIBS=-static
> ./configure --disable-shared --enable-static
> ~~~~
> export CFLAGS=-static
> export LDFLAGS=-static
> export LIBS=-static
> ./configure --disable-shared --enable-static
> ~~~~
>    (and some other combinations...)
>
>    Am I doing something wrong?
>
>    Thanks,
>    Ciprian.

    Please send me that patch! (And also on the list, maybe others are
interested too.)

    Thanks,
    Ciprian.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Daniel Stenberg | 2 Dec 2009 10:33
Picon
Favicon
Gravatar

Re: Colon in usernames

On Wed, 2 Dec 2009, Thomas Langstadlinger wrote:

> The problem is that a colon is the separator for username:password.
> 
> For instance:
> User = sip:username <at> domain
> Pass = secret12345

Yeah, that was an unfortunate choice of separator. I'm the one to blame for 
it...

The good news first:

  1 - libcurl offers separated options that thus work entirely without any
      separator and thus allows basically all letters with ease.

  2 - a work-around way is to provide the username and password as part of the
      URL as in http://user:password <at> host/path as then they need to be url
      encoded and thus you must url encode the colon that is part of the user
      name and then you avoid this problem

The bad news:

  libcurl provides separated username/password options but the curl tool does
  not so 1) isn't providing a solution for curl users, only 2) does. We can
  of course rather easily extend curl to support the separate options but
  nobody has yet stepped forward to actually do it.

--

-- 

  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html


Gmane