[PATCH libguestfs 1/2] ocaml/implicit_close test: collect all currently unreachable blocks
Fixes failing implice_close test on OCaml 5. --- ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml index 567e550b4..5e00c21ac 100644 --- a/ocaml/t/guestfs_065_implicit_close.ml +++ b/ocaml/t/guestfs_065_implicit_close.ml @@ -30,8 +30,8 @@ let () = *) (* This should cause the GC to close the handle. *) -let () = Gc.compact () +let () = Gc.full_major () let () = assert (!close_invoked = 1) -let () = Gc.compact () +let () = Gc.full_major () -- 2.40.1
On 5/27/23 15:32, Jürgen Hötzel wrote:
Fixes failing implice_close test on OCaml 5. --- ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml index 567e550b4..5e00c21ac 100644 --- a/ocaml/t/guestfs_065_implicit_close.ml +++ b/ocaml/t/guestfs_065_implicit_close.ml @@ -30,8 +30,8 @@ let () = *)
(* This should cause the GC to close the handle. *) -let () = Gc.compact () +let () = Gc.full_major ()
let () = assert (!close_invoked = 1)
-let () = Gc.compact () +let () = Gc.full_major ()
I can vaguely support this patch, as the documentation at <https://v2.ocaml.org/api/Gc.html#VALfull_major> writes, "This will collect all currently unreachable blocks" *and* none of the other functions documented on that page are classified similarly. Acked-by: Laszlo Ersek <lersek@redhat.com>
On Sat, May 27, 2023 at 03:32:36PM +0200, Jürgen Hötzel wrote:
Fixes failing implice_close test on OCaml 5.
s/implice/implicit/
--- ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml index 567e550b4..5e00c21ac 100644 --- a/ocaml/t/guestfs_065_implicit_close.ml +++ b/ocaml/t/guestfs_065_implicit_close.ml @@ -30,8 +30,8 @@ let () = *)
(* This should cause the GC to close the handle. *) -let () = Gc.compact () +let () = Gc.full_major ()
let () = assert (!close_invoked = 1)
-let () = Gc.compact () +let () = Gc.full_major ()
Will libnbd need a similar patch? (I'm assuming that Rich modeled libnbd's OCaml bindings after libguestfs and therefore it likely shares an implicit close feature worth testing, although there is not currently a 'ocaml/tests/*_implicit_close.ml' file in that project) -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
On Sat, May 27, 2023 at 03:32:36PM +0200, Jürgen Hötzel wrote:
Fixes failing implice_close test on OCaml 5. --- ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml index 567e550b4..5e00c21ac 100644 --- a/ocaml/t/guestfs_065_implicit_close.ml +++ b/ocaml/t/guestfs_065_implicit_close.ml @@ -30,8 +30,8 @@ let () = *)
(* This should cause the GC to close the handle. *) -let () = Gc.compact () +let () = Gc.full_major ()
let () = assert (!close_invoked = 1)
-let () = Gc.compact () +let () = Gc.full_major ()
I don't understand this patch at all. If there a test failing we need to diagnose why it is failing, not paper over the symptoms. What is the exact failure? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
On 5/31/23 11:12, Richard W.M. Jones wrote:
On Sat, May 27, 2023 at 03:32:36PM +0200, Jürgen Hötzel wrote:
Fixes failing implice_close test on OCaml 5. --- ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml index 567e550b4..5e00c21ac 100644 --- a/ocaml/t/guestfs_065_implicit_close.ml +++ b/ocaml/t/guestfs_065_implicit_close.ml @@ -30,8 +30,8 @@ let () = *)
(* This should cause the GC to close the handle. *) -let () = Gc.compact () +let () = Gc.full_major ()
let () = assert (!close_invoked = 1)
-let () = Gc.compact () +let () = Gc.full_major ()
I don't understand this patch at all. If there a test failing we need to diagnose why it is failing, not paper over the symptoms.
What is the exact failure?
Well my assumption is that (a) we need to force a garbage collection for the (unreachable) handle to be closed actually (from earlier, nothing new regarding that), but (b) with OCaml 5, "compact" is not strong enough for that, while "full_major" is. Whether that means OCaml 5 changed the semantics of these functions, or that even with OCaml 4 we've only (consistently) lucky with "compact", I can't tell. Laszlo
On Wed, May 31, 2023 at 12:32:49PM +0200, Laszlo Ersek wrote:
On 5/31/23 11:12, Richard W.M. Jones wrote:
On Sat, May 27, 2023 at 03:32:36PM +0200, Jürgen Hötzel wrote:
Fixes failing implice_close test on OCaml 5. --- ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml index 567e550b4..5e00c21ac 100644 --- a/ocaml/t/guestfs_065_implicit_close.ml +++ b/ocaml/t/guestfs_065_implicit_close.ml @@ -30,8 +30,8 @@ let () = *)
(* This should cause the GC to close the handle. *) -let () = Gc.compact () +let () = Gc.full_major ()
let () = assert (!close_invoked = 1)
-let () = Gc.compact () +let () = Gc.full_major ()
I don't understand this patch at all. If there a test failing we need to diagnose why it is failing, not paper over the symptoms.
What is the exact failure?
Well my assumption is that (a) we need to force a garbage collection for the (unreachable) handle to be closed actually (from earlier, nothing new regarding that), but (b) with OCaml 5, "compact" is not strong enough for that, while "full_major" is. Whether that means OCaml 5 changed the semantics of these functions, or that even with OCaml 4 we've only (consistently) lucky with "compact", I can't tell.
So it turns out there is a difference between OCaml 4.14 and 5 here. In 4.14: Gc.compact finishes the current major cycle and then compacts the heap: https://github.com/ocaml/ocaml/blob/74fe398bbe2e53db21a998356b042c232d42a4d8... Gc.full_major finishes the major cycle and then sometimes compacts the heap based on a threshold of how much heap is being used: https://github.com/ocaml/ocaml/blob/74fe398bbe2e53db21a998356b042c232d42a4d8... So Gc.full_major is (kind of) a subset of Gc.compact, which (mostly) matches the documentation. In 5.0: Gc.compact finishes the major cycle, and as far as I can tell doesn't compact the heap (bug?!): https://github.com/ocaml/ocaml/blob/ffb2022797986324213891a59c02af46269b5c17... But the big difference is Gc.full_major: https://github.com/ocaml/ocaml/blob/ffb2022797986324213891a59c02af46269b5c17... As you can see from a comment in the code, "[the new garbage collector] can require up to 3 GC cycles for a currently-unreachable object to be collected", and Gc.full_major does this. (I don't believe this is true for the old GC in OCaml <= 4.) So in 5.0 full_major is quite a different operation from compact. It runs multiple major cycles to make sure everything is collected, and doesn't compact the heap, but then neither does Gc.compact which is no longer a superset of Gc.full_major. The patch there is correct, for OCaml 5, but breaks OCaml 4, so it should probably have some kind of conditional on the OCaml version. It also needs a much clearer explanation. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On 5/31/23 13:13, Richard W.M. Jones wrote:
On Wed, May 31, 2023 at 12:32:49PM +0200, Laszlo Ersek wrote:
On 5/31/23 11:12, Richard W.M. Jones wrote:
On Sat, May 27, 2023 at 03:32:36PM +0200, Jürgen Hötzel wrote:
Fixes failing implice_close test on OCaml 5. --- ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml index 567e550b4..5e00c21ac 100644 --- a/ocaml/t/guestfs_065_implicit_close.ml +++ b/ocaml/t/guestfs_065_implicit_close.ml @@ -30,8 +30,8 @@ let () = *)
(* This should cause the GC to close the handle. *) -let () = Gc.compact () +let () = Gc.full_major ()
let () = assert (!close_invoked = 1)
-let () = Gc.compact () +let () = Gc.full_major ()
I don't understand this patch at all. If there a test failing we need to diagnose why it is failing, not paper over the symptoms.
What is the exact failure?
Well my assumption is that (a) we need to force a garbage collection for the (unreachable) handle to be closed actually (from earlier, nothing new regarding that), but (b) with OCaml 5, "compact" is not strong enough for that, while "full_major" is. Whether that means OCaml 5 changed the semantics of these functions, or that even with OCaml 4 we've only (consistently) lucky with "compact", I can't tell.
So it turns out there is a difference between OCaml 4.14 and 5 here.
In 4.14:
Gc.compact finishes the current major cycle and then compacts the heap:
https://github.com/ocaml/ocaml/blob/74fe398bbe2e53db21a998356b042c232d42a4d8...
Gc.full_major finishes the major cycle and then sometimes compacts the heap based on a threshold of how much heap is being used:
https://github.com/ocaml/ocaml/blob/74fe398bbe2e53db21a998356b042c232d42a4d8...
So Gc.full_major is (kind of) a subset of Gc.compact, which (mostly) matches the documentation.
In 5.0:
Gc.compact finishes the major cycle, and as far as I can tell doesn't compact the heap (bug?!):
https://github.com/ocaml/ocaml/blob/ffb2022797986324213891a59c02af46269b5c17...
But the big difference is Gc.full_major:
https://github.com/ocaml/ocaml/blob/ffb2022797986324213891a59c02af46269b5c17...
As you can see from a comment in the code, "[the new garbage collector] can require up to 3 GC cycles for a currently-unreachable object to be collected", and Gc.full_major does this. (I don't believe this is true for the old GC in OCaml <= 4.)
So in 5.0 full_major is quite a different operation from compact. It runs multiple major cycles to make sure everything is collected, and doesn't compact the heap, but then neither does Gc.compact which is no longer a superset of Gc.full_major.
The patch there is correct, for OCaml 5, but breaks OCaml 4,
Right, from your explanation above, this is what I've been expecting -- what works for OCaml 5 may not work for OCaml 4. In fact I don't understand the OCaml runtime's developers -- this is a compatibility breaking change! Every project that uses the Gc module will have to add compat code (version checking) now.
so it should probably have some kind of conditional on the OCaml version. It also needs a much clearer explanation.
Thanks Laszlo
On Wed, May 31, 2023 at 04:44:49PM +0200, Laszlo Ersek wrote:
On 5/31/23 13:13, Richard W.M. Jones wrote:
On Wed, May 31, 2023 at 12:32:49PM +0200, Laszlo Ersek wrote:
On 5/31/23 11:12, Richard W.M. Jones wrote:
On Sat, May 27, 2023 at 03:32:36PM +0200, Jürgen Hötzel wrote:
Fixes failing implice_close test on OCaml 5. --- ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml index 567e550b4..5e00c21ac 100644 --- a/ocaml/t/guestfs_065_implicit_close.ml +++ b/ocaml/t/guestfs_065_implicit_close.ml @@ -30,8 +30,8 @@ let () = *)
(* This should cause the GC to close the handle. *) -let () = Gc.compact () +let () = Gc.full_major ()
let () = assert (!close_invoked = 1)
-let () = Gc.compact () +let () = Gc.full_major ()
I don't understand this patch at all. If there a test failing we need to diagnose why it is failing, not paper over the symptoms.
What is the exact failure?
Well my assumption is that (a) we need to force a garbage collection for the (unreachable) handle to be closed actually (from earlier, nothing new regarding that), but (b) with OCaml 5, "compact" is not strong enough for that, while "full_major" is. Whether that means OCaml 5 changed the semantics of these functions, or that even with OCaml 4 we've only (consistently) lucky with "compact", I can't tell.
So it turns out there is a difference between OCaml 4.14 and 5 here.
In 4.14:
Gc.compact finishes the current major cycle and then compacts the heap:
https://github.com/ocaml/ocaml/blob/74fe398bbe2e53db21a998356b042c232d42a4d8...
Gc.full_major finishes the major cycle and then sometimes compacts the heap based on a threshold of how much heap is being used:
https://github.com/ocaml/ocaml/blob/74fe398bbe2e53db21a998356b042c232d42a4d8...
So Gc.full_major is (kind of) a subset of Gc.compact, which (mostly) matches the documentation.
In 5.0:
Gc.compact finishes the major cycle, and as far as I can tell doesn't compact the heap (bug?!):
https://github.com/ocaml/ocaml/blob/ffb2022797986324213891a59c02af46269b5c17...
But the big difference is Gc.full_major:
https://github.com/ocaml/ocaml/blob/ffb2022797986324213891a59c02af46269b5c17...
As you can see from a comment in the code, "[the new garbage collector] can require up to 3 GC cycles for a currently-unreachable object to be collected", and Gc.full_major does this. (I don't believe this is true for the old GC in OCaml <= 4.)
So in 5.0 full_major is quite a different operation from compact. It runs multiple major cycles to make sure everything is collected, and doesn't compact the heap, but then neither does Gc.compact which is no longer a superset of Gc.full_major.
The patch there is correct, for OCaml 5, but breaks OCaml 4,
Right, from your explanation above, this is what I've been expecting -- what works for OCaml 5 may not work for OCaml 4.
In fact I don't understand the OCaml runtime's developers -- this is a compatibility breaking change! Every project that uses the Gc module will have to add compat code (version checking) now.
Yes, it's not a good change. About the patch, we could try to conditionalize it on Sys.ocaml_release.Sys.major >= 5 (see /usr/lib64/ocaml/sys.mli) Rich.
so it should probably have some kind of conditional on the OCaml version. It also needs a much clearer explanation.
Thanks Laszlo
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
This bug and thread seem relevant: https://github.com/ocaml/ocaml/issues/11812 https://discuss.ocaml.org/t/ocaml-5-gc-releasing-memory-back-to-the-os/11293 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
... And while I'm scrawling my throughts into this thread ... What we intend here are two slightly different operations: (A) Free every unreachable object. That's what we want in this specific place in the code. (B) Provide a soft test that the OCaml heap hasn't been screwed up because of bugs in our bindings. That's what we use eg here: https://gitlab.com/nbdkit/libnbd/-/blob/master/ocaml/tests/test_100_handle.m... In OCaml 4 Gc.compact provides (A) and (B), in particular compaction is quite an aggressive & costly operation that requires examining and moving every object on the heap. In practice we found this quickly reveals bugs in bindings. OCaml 5 provides (A) through Gc.full_major--albeit not documented--and doesn't seem to provide any way to do (B) as far as I can tell. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On 5/31/23 13:23, Richard W.M. Jones wrote:
... And while I'm scrawling my throughts into this thread ...
What we intend here are two slightly different operations:
(A) Free every unreachable object. That's what we want in this specific place in the code.
(B) Provide a soft test that the OCaml heap hasn't been screwed up because of bugs in our bindings. That's what we use eg here: https://gitlab.com/nbdkit/libnbd/-/blob/master/ocaml/tests/test_100_handle.m...
In OCaml 4 Gc.compact provides (A) and (B), in particular compaction is quite an aggressive & costly operation that requires examining and moving every object on the heap. In practice we found this quickly reveals bugs in bindings.
OCaml 5 provides (A) through Gc.full_major--albeit not documented--and doesn't seem to provide any way to do (B) as far as I can tell.
Re: (A) -- I didn't expect to see <https://github.com/rpm-software-management/dnf/commit/5ce5ed1ea08ad> again, just in different clothing. :/ At least we have a way to force (A), going forward. Re: (B) -- can we keep testing our OCaml bindings on OCaml 4, kind of as a "requirement", until goal (B) becomes possible on OCaml 5 too? That wouldn't test (A)+(B) on OCaml 5, but we'd still cover (A)+(B) in total, across multiple OCaml versions. Meanwhile we should probably chime in on one of these upstream discussions. For that, how would we we "formalize" goal (B)? Call it "heap fsck" (cf. "git-fsck", which is an existent utility)? Ticket <https://github.com/ocaml/ocaml/issues/11812> mentions, "OCaml 5 does not implement heap compaction. It is not yet clear whether we will need one." -- a heap consistency check (for the sake of C language extensions) would be one reason. Laszlo
On Wed, May 31, 2023 at 05:33:13PM +0200, Laszlo Ersek wrote:
On 5/31/23 13:23, Richard W.M. Jones wrote:
... And while I'm scrawling my throughts into this thread ...
What we intend here are two slightly different operations:
(A) Free every unreachable object. That's what we want in this specific place in the code.
(B) Provide a soft test that the OCaml heap hasn't been screwed up because of bugs in our bindings. That's what we use eg here: https://gitlab.com/nbdkit/libnbd/-/blob/master/ocaml/tests/test_100_handle.m...
In OCaml 4 Gc.compact provides (A) and (B), in particular compaction is quite an aggressive & costly operation that requires examining and moving every object on the heap. In practice we found this quickly reveals bugs in bindings.
OCaml 5 provides (A) through Gc.full_major--albeit not documented--and doesn't seem to provide any way to do (B) as far as I can tell.
Re: (A) -- I didn't expect to see <https://github.com/rpm-software-management/dnf/commit/5ce5ed1ea08ad> again, just in different clothing. :/
At least we have a way to force (A), going forward.
Re: (B) -- can we keep testing our OCaml bindings on OCaml 4, kind of as a "requirement", until goal (B) becomes possible on OCaml 5 too? That wouldn't test (A)+(B) on OCaml 5, but we'd still cover (A)+(B) in total, across multiple OCaml versions.
Meanwhile we should probably chime in on one of these upstream discussions. For that, how would we we "formalize" goal (B)? Call it "heap fsck" (cf. "git-fsck", which is an existent utility)?
Ticket <https://github.com/ocaml/ocaml/issues/11812> mentions, "OCaml 5 does not implement heap compaction. It is not yet clear whether we will need one." -- a heap consistency check (for the sake of C language extensions) would be one reason.
To start with I have opened a discussion topic. We can think about opening bugs later. https://discuss.ocaml.org/t/ocaml-heap-fsck-and-forcing-collection-of-unreac... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
[Sorry, not read the other replies yet, in meetings all day today] On Wed, May 31, 2023 at 05:13:58PM +0100, Richard W.M. Jones wrote:
To start with I have opened a discussion topic. We can think about opening bugs later.
https://discuss.ocaml.org/t/ocaml-heap-fsck-and-forcing-collection-of-unreac...
There were some replies to this thread. One open merge request is notable - it adds compaction back: https://github.com/ocaml/ocaml/pull/12193 although only for "small" blocks, less than 128 * 8-byte words, which probably covers everything we do. It seems like full_major is the way to force freeing of unreachable objects, in all versions of OCaml. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On 6/1/23 13:18, Richard W.M. Jones wrote:
[Sorry, not read the other replies yet, in meetings all day today]
On Wed, May 31, 2023 at 05:13:58PM +0100, Richard W.M. Jones wrote:
To start with I have opened a discussion topic. We can think about opening bugs later.
https://discuss.ocaml.org/t/ocaml-heap-fsck-and-forcing-collection-of-unreac...
There were some replies to this thread. One open merge request is notable - it adds compaction back:
https://github.com/ocaml/ocaml/pull/12193
although only for "small" blocks, less than 128 * 8-byte words, which probably covers everything we do.
We likely don't have a structure type larger than 1KB :)
It seems like full_major is the way to force freeing of unreachable objects, in all versions of OCaml.
Ah, does that mean we don't need a version check here, after all? IIRC, you said that in OCaml 4, "compact" was a superset of "full_major". If "full_major" is sufficient for finalizing unreachable objects on OCaml 4 too, then we can downgrade "compact" to "full_major" regardless of OCaml version. Laszlo
On Thu, Jun 01, 2023 at 01:26:13PM +0200, Laszlo Ersek wrote:
On 6/1/23 13:18, Richard W.M. Jones wrote:
[Sorry, not read the other replies yet, in meetings all day today]
On Wed, May 31, 2023 at 05:13:58PM +0100, Richard W.M. Jones wrote:
To start with I have opened a discussion topic. We can think about opening bugs later.
https://discuss.ocaml.org/t/ocaml-heap-fsck-and-forcing-collection-of-unreac...
There were some replies to this thread. One open merge request is notable - it adds compaction back:
https://github.com/ocaml/ocaml/pull/12193
although only for "small" blocks, less than 128 * 8-byte words, which probably covers everything we do.
We likely don't have a structure type larger than 1KB :)
It seems like full_major is the way to force freeing of unreachable objects, in all versions of OCaml.
Ah, does that mean we don't need a version check here, after all? IIRC, you said that in OCaml 4, "compact" was a superset of "full_major". If "full_major" is sufficient for finalizing unreachable objects on OCaml 4 too, then we can downgrade "compact" to "full_major" regardless of OCaml version.
Yes .. we use Gc.compact in at least two different ways. Only where we want the "free unreachable" meaning, replacing it with full_major does seem sensible. But we have to be careful not to replace the other one ("do an fsck") at least until we understand the best way to do that. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On Sat, May 27, 2023 at 03:32:36PM +0200, Jürgen Hötzel wrote:
Fixes failing implice_close test on OCaml 5. --- ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml index 567e550b4..5e00c21ac 100644 --- a/ocaml/t/guestfs_065_implicit_close.ml +++ b/ocaml/t/guestfs_065_implicit_close.ml @@ -30,8 +30,8 @@ let () = *)
(* This should cause the GC to close the handle. *) -let () = Gc.compact () +let () = Gc.full_major ()
I pushed this hunk upstream, but not the second change below. That should be sufficient to fix it on OCaml 5 while maintaining the ability to compact the heap to check for integrity. See: https://github.com/libguestfs/libguestfs/commit/1274452d225da71f115e0cb8ad43...
let () = assert (!close_invoked = 1)
-let () = Gc.compact () +let () = Gc.full_major ()
Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
participants (4)
-
Eric Blake -
Jürgen Hötzel -
Laszlo Ersek -
Richard W.M. Jones