Navigation Menu

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

mmapped bigarrays that have been sliced are never unmapped #7915

Closed
vicuna opened this issue Feb 10, 2019 · 1 comment
Closed

mmapped bigarrays that have been sliced are never unmapped #7915

vicuna opened this issue Feb 10, 2019 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Feb 10, 2019

Original bug ID: 7915
Reporter: danielrichman
Status: new
Resolution: open
Priority: normal
Severity: minor
Platform: Unix
Version: 4.07.0
Category: otherlibs
Monitored by: @nojb @diml

Bug description

caml_ba_slice uses caml_ba_alloc and hence caml_ba_ops/caml_ba_finalize, even if the array you are slicing is mmapped and so it should be using caml_ba_mapped_ops/caml_ba_mapped_finalize.

When the slice is garbage collected, caml_ba_finalize either asserts-0, or does nothing (if assertions are not enabled), and in particular does not decrease the refcount on the proxy.

When the original array is garbage collected, the refcount is greater than 1, so it is not freed.

Steps to reproduce

Build and execute attached file with ocamlopt.

File attachments

@xavierleroy
Copy link
Contributor

Fixed by PR #8568.

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