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
Release the runtime system when calling caml_dlopen #6078
Comments
Comment author: @damiendoligez The patch looks good. Is there any reason not to apply it now? |
Comment author: @diml I think it can be applied. I updated the patch to use caml_strdup. |
Comment author: @diml Unless someone object I'll merge it. |
Comment author: @diml Committed in trunk (15878) and 4.02 (15879). |
Comment author: @chambart Are you certain that dlopen is thread safe ? Couldn't there be strange stuff happening if multiple libraries are loaded at the same time ? |
Comment author: @diml I'm not sure it is, but even if it is not it is not a reason to block the runtime. We shouldn't use the same mutex for every library call that is not thread-safe. |
Comment author: @whitequark I've looked into it a bit and it appears that on major platforms (Windows, Linux, OS X) the dynamic linker serializes the calls. POSIX doesn't specify this though, and NetBSD doesn't bother. (Does OCaml run on NetBSD?) |
Comment author: @johnwhitington This patch causes a warning on OS X under the latest XCode: dynlink.c:122:3: warning: implicit declaration of function 'caml_enter_blocking_section' is invalid in C99 [-Wimplicit-function-declaration] |
Comment author: @diml Ah indeed, I forgot to include signals.h. I'll fix that, thanks! |
Comment author: @diml Committed in trunk (15963) and 4.02 (15962). |
Original bug ID: 6078
Reporter: @diml
Assigned to: @diml
Status: closed (set by @xavierleroy on 2016-12-07T10:49:02Z)
Resolution: fixed
Priority: low
Severity: minor
Version: 4.00.1
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: runtime system and C interface
Tags: patch
Bug description
dlopen is a blocking operation so it should release the global lock. The attached patch does this.
File attachments
The text was updated successfully, but these errors were encountered: