The easiest way to diagnose this might be to build OpenSSL for debug, then reproduce under valgrind (with memcheck, which is the default tool). Odds are decent that will tell you exactly where it went wrong. Even just running under gdb with debug symbols would be useful.
The usual causes of a SEGV in a free-function are an invalid pointer or prior heap corruption. An invalid pointer could be already freed (though in single-threaded programs I think glibc is generally pretty good at catching this and SIGABRTs instead) or not a pointer to a heap-allocated object (e.g. because someone did pointer arithmetic on it, or overwrote it with a buffer overflow elsewhere, or it's just rubbish). Prior heap corruption could be many things. And, of course, a non-trivial free-function would be attempting to operate on data within the object being freed, and something there could be bogus.
But using the available tooling - valgrind or even glibc's built-in malloc debugging - is generally faster than code inspection, if the issue is easy to reproduce.
--
Michael Wojcik
================================
Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ Main Office Toll Free Number:
+1 855.577.4323
Contact Customer Support:
https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport
Unsubscribe from Marketing Messages/Manage Your Subscription Preferences -
http://www.rocketsoftware.com/manage-your-email-preferences
Privacy Policy -
http://www.rocketsoftware.com/company/legal/privacy-policy
================================
This communication and any attachments may contain confidential information of Rocket Software, Inc. All unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify Rocket Software immediately and destroy all copies of this communication. Thank you.