Closed lovasoa closed 3 years ago
I have similar errors without this added test.
What do you mean ? Do you have errors running cargo test
on master ? I don't.
I do
Also, I don't have the same result with the multithread test
like 1/10 it fails
Running
S=0; F=0; for i in {1..100}; do cargo test; if [ $? == 0 ]; then let S+=1; else let F+=1; fi; done; echo "Successes: $S"; echo "Failures: $F"
I get
Successes: 100
Failures: 0
Both on Linux and MacOS
I don't have the same lib as you I suppose, I have the debian stable one.
i=0; while cargo test; do i=$((i+1)); done; echo $i
gives between 0 and 11 depending on the case.
I have the latest one in ubuntu: 2.10.5. Debian stable has 2.9.9 : https://packages.debian.org/buster/coinor-libcbc-dev It probably has bugs that have been fixed in more recent versions.
If the bug is a memory corruption bug, you may get debian to issue a security update on stable.
I clearly need the lock for the raw::Model::new
Ok, let's add it then
I also don't have the same results on the tests, but I don't see what we can do for that
With the lock on new, this test pass here.
+ // Solve an empty problem
+ let mut m = Model::new();
+ m.load_problem(1, 0, &[0, 0], &[], &[], None, None, None, None, None)
;
+ m.solve();
+ assert_eq!(Status::Finished, m.status());
+ assert_eq!(SecondaryStatus::HasSolution, m.secondary_status());
+ assert!((m.col_solution()[0]).abs() < 1e-6);
I'll open a PR within a few minutes for my problems.
So, as this test pass on my coin version, can we say that's a coin bug and close this?
Yes, this is a bug in cbc. I reported it as https://github.com/coin-or/Cbc/issues/367
This adds a test for #9. You should see the reproduction on the CI run.