Skip to content
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

caml_strdup is no longer available without defining CAML_INTERNALS #7652

Closed
vicuna opened this issue Oct 5, 2017 · 6 comments
Closed

caml_strdup is no longer available without defining CAML_INTERNALS #7652

vicuna opened this issue Oct 5, 2017 · 6 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Oct 5, 2017

Original bug ID: 7652
Reporter: @dra27
Assigned to: @alainfrisch
Status: resolved (set by @alainfrisch on 2017-10-26T12:46:16Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.06.0 +dev/beta1/beta2/rc1
Target version: 4.06.0 +dev/beta1/beta2/rc1
Category: runtime system and C interface
Monitored by: @gasche

Bug description

#71 (#71) deprecated caml_strdup but the symbol is only defined if CAML_INTERNALS is defined, which breaks any non-OCaml C stubs using it.

Additional information

#71 (review)

@vicuna
Copy link
Author

vicuna commented Oct 5, 2017

Comment author: @dra27

Removed the incorrect reference to caml_aligned_malloc

@vicuna
Copy link
Author

vicuna commented Oct 5, 2017

Comment author: @dra27

I'm not completely sure, but I don't think that the fix for this is to move the #define outside a CAML_INTERNALS block.

There is a discussion in the GPR about the removal of caml_strdup - skimming through it, it's possible that what should change is documentation to show that we removed caml_strdup and that code should be updated to use caml_stat_strdup (with any corresponding free call changed to caml_stat_free). Max's analysis of opam seemed to suggest that correct usage of caml_strdup which very limited.

@vicuna
Copy link
Author

vicuna commented Oct 19, 2017

Comment author: @gasche

dra, let's move on with the plan of properly documenting the breakage (first, is "caml_strdup" present in a star-marked Changes entry ? If not, maybe we could create one pointing at #71, or at least add it to the GPR's existing entry). Would you be able to submit a PR for this shortly?

@vicuna
Copy link
Author

vicuna commented Oct 20, 2017

Comment author: @dra27

I'm not sure that was the original intention of #71, though?

@vicuna
Copy link
Author

vicuna commented Oct 20, 2017

Comment author: @gasche

Ok, so I pinged Max in the PR.

@vicuna
Copy link
Author

vicuna commented Oct 23, 2017

Comment author: @murmour

Putting those aliases into CAML_INTERNALS was not intentional, and is likely an artefact of a sloppy rebase. There should be no breakage in the client code, unless the runtime is started with caml_startup_pooled (which requires that caml_stat_* blocks are only disposed with caml_stat_free).

Fix: #1442.

@vicuna vicuna closed this as completed Oct 26, 2017
@vicuna vicuna added the stdlib label Mar 14, 2019
@vicuna vicuna added this to the 4.06.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants