-
Notifications
You must be signed in to change notification settings - Fork 31
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 with two task pools #58
Comments
I've dug a bit to investigate this issue. Running through
With the following stack trace:
Arising from these lines: Lines 126 to 128 in df30722
domainslib/lib/multi_channel.ml Lines 111 to 113 in df30722
Lines 51 to 54 in df30722
let pool2_prom0 = Task.async pool2 work in Concretely, This seems to arise from the two
|
I've also tried changing the example to be closer to the 2 work-pool example in test/test_task.ml. [...]
begin
let pool1 = Task.setup_pool ~name:"pool1" ~num_additional_domains:2 () in
let pool2 = Task.setup_pool ~name:"pool2" ~num_additional_domains:1 () in
Task.run pool1 (fun () ->
let p1 = Option.get @@ Task.lookup_pool "pool1" in
let pool1_prom0 = Task.async p1 work in
List.iter (fun p -> Task.await p1 p) [pool1_prom0]);
Task.run pool2 (fun () ->
let p2 = Option.get @@ Task.lookup_pool "pool2" in
let pool2_prom0 = Task.async p2 work in
let pool2_prom1 = Task.async p2 work in
List.iter (fun p -> Task.await p2 p) [pool2_prom0; pool2_prom1]);
Task.teardown_pool pool1;
Task.teardown_pool pool2;
end
|
Out of curiosity, to try the setup with different domain sizes in each pool I just tried changing test/test_task.ml: $ diff -u test_task.ml{~,}
--- test_task.ml~ 2021-12-20 15:29:11.049259293 +0100
+++ test_task.ml 2021-12-20 15:30:31.916631932 +0100
@@ -38,7 +38,7 @@
let () =
let pool1 = Task.setup_pool ~num_additional_domains:2 ~name:"pool1" () in
- let pool2 = Task.setup_pool ~num_additional_domains:2 ~name:"pool2" () in
+ let pool2 = Task.setup_pool ~num_additional_domains:1 ~name:"pool2" () in
Task.run pool1 (fun _ ->
let p1 = Option.get @@ Task.lookup_pool "pool1" in
modify_arr pool1 0 (); The resulting program also segfaults on my machine. |
This PR is still not merged: #50. Perhaps explains the issue? |
Ah yes, thanks! With this PR they all run smoothly. I found a minor remaining issue - but I'll report that separately. I've resolved the conflicts from merging @edwintorok's PR against the latest master and added the crash test on top. |
@jmid don't worry, updating my PR is much appreciated, I've incorporated your branch into my PR now. |
Solved with the merge of #50 |
The following program triggers a segfault on my machine.
dune:
task_issue_crash.ml:
$ dune exec ./task_issue_crash.exe Segmentation fault (core dumped)
I think that the
Task.run
usage abides by the specification:I get a segfault running it on both
and with the latest domainslib installed through opam with
opam source domainslib --dev --pin
.This is on an old Intel dual-core x86_64 Thinkpad (w/4 CPU threads) running Linux 5.4.0-91-generic.
The text was updated successfully, but these errors were encountered: