OpenSSLMemoryTracker??? What is this?

30 views
Skip to first unread message

Steven LaFavor

unread,
Aug 13, 2019, 6:15:32 PM8/13/19
to VA Smalltalk
Our Windows application changed our external database web servlet calls from http to https, and we now seem to be getting errors from the sites and out app just started getting weird walkbacke referring to the "OpenSSL Reference Expunger".   I tracked this down to the OpenSSLMemortTracker class in the OpenSSLCryptoInterfaceApp.

I cannot find *ANY* documentation or information about this class/app.   Anyone got a place that I can go look?   Or can someone point me to some information about it?

Any help would be appreciated.   Thanks in advance....

*Steve*

Seth Berman

unread,
Aug 13, 2019, 7:06:56 PM8/13/19
to VA Smalltalk
Hi Steven,

Well, I developed it so I can certainly tell you about it.
This is an internal class that is used to prevent memory-leaks by tracking OpenSSL memory allocated outside of the Smalltalk heap.
It basically is a reference counter implemented in Smalltalk.  If the user fails to explicitly free memory by calling #free on an OpenSSL OSObject,
then the memory tracker kicks in during finalization of that OSObject (triggered by the Smalltalk GC) and both zeros and frees the memory as well as any memory that refers to it (i.e pointer-aliasing).

However, calling #free from the finalizer hook in Smalltalk can cause deadlocks because there are also EsEntryPoint callback functions that OpenSSL is calling for thread-saftey. These callbacks may get triggered by some of the free behavior, but it can't re-enter the vm because the vm is doing finalization...but the finalization can't make any progress since the EsEntryPoint can't be called..and so on and so forth....deadlock.

This means that the #free needs to be scheduled outside the finalizer in Smalltalk so it is batched up and eventually freed by the process named "OpenSSL Reference Expunger".

We should move it to the support channel if this gets involved, but if you want to give me a quick comment of what exactly it is breaking on, perhaps I can give you a quick answer.

- Seth

Seth Berman

unread,
Aug 13, 2019, 7:11:35 PM8/13/19
to VA Smalltalk
And btw, the documentation for the OpenSSL app and public classes / API can be found here:
Reply all
Reply to author
Forward
0 new messages