Zlib: Segfault when in action code. Same code works fine outside
I'm trying to write a squid-plugin that unpacks gzip-encoded content.
Here's a piece of code that kills squid:
testlog(
z_stream zs;
memset(&zs, 0, sizeof(z_stream));
inflateInit
testlog(
In a simple console application it works, when put in XService::start() from the example, it kills squid. My guess is that with segmentation fault.
I.e. I see multiple "Service started 1" in logfile which means that service gets restarted twice on every request.
And when executing it in console app I see both lines.
I've simplified code down to this when tracking down the error. Can you please suggest what could cause it?
Also, when I put this line of from vigo's gzip ecap instead of inflateInit:
const int rc = deflateInit2(&zs, 9, Z_DEFLATED, -MAX_WBITS, 8, Z_DEFAULT_
service dies as well. I'm using squid 3.2.0.11 with ecap 0.2.0
Can you please give me a hint on what's killing zlib? Or maybe there's an existing ungzipper ecap module for 0.2.0?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- eCAP Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Igor
- Solved:
- Last query:
- Last reply: