cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: segfault with gzip encoding support

From: codemastr <codemstr_at_ptd.net>
Date: Wed, 24 Dec 2003 15:14:30 -0500

----- Original Message -----
From: "Vikram" <vvikram_at_stanford.edu>
To: <curl-library_at_lists.sourceforge.net>
Sent: Wednesday, December 24, 2003 3:02 PM
Subject: Re: segfault with gzip encoding support

>
> > You're using the default stack size in that sample code. It's probably
> > different on FreeBSD vs. Linux, which is why it works on the one but not
> > the other. Try using pthread_attr_setstacksize() to set a large stack
> > (try at least 128 KiB to be safe) for each thread and see if that helps.
>
> You are right. I set the stacksize using pthread_atter_setstacksize to
> (128*1024) and it works.
>
> I further experimented with the stack size. Surprising that 65536
> [64*1024] doesn't work and segfault but anything greater than that works
> [including 65537...]. Why is this?
Because you're apparently overwriting something different then. Whatever you
overwrote didn't cause a crash, just data corruption.
>
> > Also, make sure you're linking with a thread safe libc.
>
> Yes. I do this; links with libc_r in freebsd.
You are aware that FreeBSD requires more than just that right? You
need -pthread (or -kthread) and -D_THREAD_SAFE

Dominick Meglio

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-24