-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix ocaml-ssl segfault with multicore #81
Fix ocaml-ssl segfault with multicore #81
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is the out-of-heap pointer - you could instead choose to box it (cf. Interfacing with C in the manual roughly with the two suggestions. The result would be no change on the OCaml side at all.
@@ -559,11 +559,6 @@ CAMLprim value ocaml_ssl_digest(value vevp, value vcert) | |||
CAMLreturn(vdigest); | |||
} | |||
|
|||
CAMLprim value ocaml_ssl_get_client_verify_callback_ptr(value unit) | |||
{ | |||
return (value)client_verify_callback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value v = caml_alloc_small(1, Abstract_tag);
*((int(*) (int, X509_STORE_CTX*)) Data_abstract_val(v)) = client_verify_callback;
return v;
@@ -610,7 +605,7 @@ CAMLprim value ocaml_ssl_ctx_set_verify(value context, value vmode, value vcallb | |||
} | |||
|
|||
if (Is_block(vcallback)) | |||
callback = (int(*) (int, X509_STORE_CTX*))Field(vcallback, 0); | |||
callback = (int(*) (int, X509_STORE_CTX*)) client_verify_callback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and then:
callback = (int(*) (int, X509_STORE_CTX*)) client_verify_callback; | |
callback = *(int(*) (int, X509_STORE_CTX*)) Data_abstract_val(Field(vcallback, 0)); |
Closing this in favor of #83 |
fixes #76