-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module variable going out of scope causes open session to be broken and cause SegFault #51
Comments
I remember having tested this specifically to avoid what you're describing. Obviously, whatever I did was wrong. I'll look into it. Thanks. |
My first hunch would be that reference counting would be necessary. |
Yeah, that's what I'm thinking as well. |
Let me know if I can help |
Few months ago, I wanted to introduce a constructor and destructor in order to benefit from PHP's internal ref counters. I feel it could help to solve such issue. |
This is related to #31.
When doing something like this (pseudo code):
Before the
findObjects()
call, the C functionpkcs11_shutdown()
is called for the module and upon enteringfindObjects()
the sessionfunctionList
is NULL.If I put the calls sequentially without functions it does work, so it seems that upon leaving
openSession()
somehow the PKCS11 shutdown function is called for the module because it going out of scope. This probably should not happen since the session is still open.How can we solve this best?
The text was updated successfully, but these errors were encountered: