Package: src:ocaml-domainslib
Version: 0.5.2-2
Severity: important
Tags: ftbfs forky sid patch
Control: forwarded -1 https://github.com/ocaml-multicore/domainslib/issues/135

Hello.

When I try to build this package on a VM with 1 CPU, the build never
ends and sbuild has to kill the dpkg-buildpackage process (see below).

Full build log available here:

https://people.debian.org/~sanvila/build-logs/202609/

Apparently this happens because of this line in kcas_integration:

num_domains = Domain.recommended_domain_count () - 2.

which yields 1 - 2 = -1, a negative value. The consequences of this
are explained in the forwarded URL above.

The attached trivial patch, which I also forwarded upstream, should fix it.

The build error may be reproduced easily with GRUB_CMDLINE_LINUX="nr_cpus=1",
but if that does not work, I can offer a VM for you to reproduce.

Thanks.

--------------------------------------------------------------------------------
[...]
Called from Dune__exe__Backtrace.main in file "test/backtrace.ml", lines 21-24, 
characters 2-46
Called from Dune__exe__Backtrace in file "test/backtrace.ml", line 29, 
characters 6-13
(cd _build/default/test && ./test_chan.exe)
Sender on domain 1 done
Receiver on domain 2 done
(cd _build/default/test && ./fib.exe)
fib(43) = 701408733
(cd _build/default/test && ./fib_par.exe)
fib(43) = 701408733
E: Build killed with signal TERM after 60 minutes of inactivity
--------------------------------------------------------------------------------
From: Santiago Vila <[email protected]>
Subject: test: fix kcas_integration hang on single-CPU systems

--- a/test/kcas_integration.ml
+++ b/test/kcas_integration.ml
@@ -8,7 +8,7 @@
   let pool_domain =
     Domain.spawn @@ fun () ->
     let pool =
-      T.setup_pool ~num_domains:(Domain.recommended_domain_count () - 2) ()
+      T.setup_pool ~num_domains:(max 0 (Domain.recommended_domain_count () - 2)) ()
     in
     T.run pool (fun () ->
         T.parallel_for ~start:1 ~finish:n

Reply via email to