I have an app that runs on a linux webserver, is compiled using gcc 3.1 and uses the ZLibCompressor from Crypto++ 5.1 (not current with CVS for several months) to compress the data sent to/from the client. I am getting a segmentation fault in the ZLibCompressor::m_adler32::TruncatedFinal(), though it seems confused whether it is actually calling the Adler32 or the HashTransformation base class (which is pure virtual and would explain a seg fault). I am not that strong in gdb so am not sure how to check the vtable to see if it is set correctly in a release build (optimized, but including debug symbols). Can anyone tell me how to check that?

I noticed that HashTransformation does not declare a virtual destructor, which I have seen cause problems in other code in the past, and Adler32 does not declare the overloaded functions as virtual. That last should not matter, but could it be causing gcc to get confused even though the signatures are the same?

I've posted a related question several months back concerning the ZLibCompressor runtime failure in a completely different app and showing a completely different problem. Wei responded that it was most likely a GCC optimizer error and the solution was to disable/reduce the optimization level. Given the high volume nature of these apps I cannot just turn off optimizations. Since some of the code is sprinkled through various parts of the crypto++ lib *and* a large volume of it is template code from headers in my code, how can I selectively turn down optimizations on the part that is failing, but keep the rest at higher performance levels? Given the varied nature of the failures, is it really likely that it is an optimizer? Granted, the same code runs fine on Win32. Has anything related to this been fixed in the code base such that trying the latest from CVS would be worth trying?

thanks for any help.

Michael Hunley
Senior Engineer
PocketPurchase, Inc.


Reply via email to