-
Notifications
You must be signed in to change notification settings - Fork 8
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
Segfault in image_create test #19
Comments
I think I'm running into the same problem on NixOS, as the mentioned test seems to be getting a segfault. Build log for reference:
|
@jamesjer Well, the |
A fix has been pushed to the master branch. May you please report whether it works for you? |
Chris00
added a commit
to Chris00/opam-repository
that referenced
this issue
Nov 25, 2020
CHANGES: - Fix a memory leak (Chris00/ocaml-cairo#19). - Fix GCC warnings, in particular the “multiple definition of …” (Chris00/ocaml-cairo#23). - Clarify the license. - Use `dune-configurator`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Building ocaml-cairo 0.6.1 with ocaml 4.10.0 beta1 on a Fedora Rawhide machine,
tests/image_create.ml
segfaults. Running with valgrind shows that thedata
array allocated on line 6 is deallocated in one of theGc.compact()
calls on line 17, leading to a segfault ascr
is used in the next few lines. The build logs can be seen here: https://koji.fedoraproject.org/koji/taskinfo?taskID=40896397.The problem appears to be that the result of
create()
is an opaque object, so OCaml finds no remaining references todata
, allowing the garbage collector to reclaim it, even thoughcr
still contains a pointer into its memory. Is this a problem with the test only, or does this imply that the interface should be changed to ensure that a reference to the array lives as long as the Surface object?The text was updated successfully, but these errors were encountered: