cURL / Mailing Lists / curl-library / Single Mail


Re: segfault with gzip encoding support

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

----- Original Message -----
From: "Vikram" <>
To: <>
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 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!
Received on 2003-12-24