Skip to content

Commit ce95b01

Browse files
committed
Disable linked failure tests
The implementation currently contains a race that leads to segfaults.
1 parent b735e6b commit ce95b01

17 files changed

+48
-8
lines changed

doc/tutorial-tasks.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ there is no way to "catch" the exception.
424424
All tasks are, by default, _linked_ to each other. That means that the fates
425425
of all tasks are intertwined: if one fails, so do all the others.
426426

427-
~~~
427+
~~~{.xfail-test .linked-failure}
428428
# use std::task::spawn;
429429
# use std::task;
430430
# fn do_some_work() { loop { task::yield() } }
@@ -447,7 +447,7 @@ pattern-match on a result to check whether it's an `Ok` result with an `int`
447447
field (representing a successful result) or an `Err` result (representing
448448
termination with an error).
449449

450-
~~~
450+
~~~{.xfail-test .linked-failure}
451451
# use std::task;
452452
# fn some_condition() -> bool { false }
453453
# fn calculate_result() -> int { 0 }
@@ -490,7 +490,7 @@ proceed). Hence, you will need different _linked failure modes_.
490490
By default, task failure is _bidirectionally linked_, which means that if
491491
either task fails, it kills the other one.
492492

493-
~~~
493+
~~~{.xfail-test .linked-failure}
494494
# use std::task;
495495
# use std::comm::oneshot;
496496
# fn sleep_forever() { loop { let (p, c) = oneshot::<()>(); p.recv(); } }
@@ -512,7 +512,7 @@ function `task::try`, which we saw previously, uses `spawn_supervised`
512512
internally, with additional logic to wait for the child task to finish
513513
before returning. Hence:
514514

515-
~~~
515+
~~~{.xfail-test .linked-failure}
516516
# use std::comm::{stream, Chan, Port};
517517
# use std::comm::oneshot;
518518
# use std::task::{spawn, try};
@@ -543,7 +543,7 @@ also fail.
543543
Supervised task failure propagates across multiple generations even if
544544
an intermediate generation has already exited:
545545

546-
~~~
546+
~~~{.xfail-test .linked-failure}
547547
# use std::task;
548548
# use std::comm::oneshot;
549549
# fn sleep_forever() { loop { let (p, c) = oneshot::<()>(); p.recv(); } }
@@ -563,7 +563,7 @@ fail!(); // Will kill grandchild even if child has already exited
563563
Finally, tasks can be configured to not propagate failure to each
564564
other at all, using `task::spawn_unlinked` for _isolated failure_.
565565

566-
~~~
566+
~~~{.xfail-test .linked-failure}
567567
# use std::task;
568568
# fn random() -> uint { 100 }
569569
# fn sleep_for(i: uint) { for _ in range(0, i) { task::yield() } }
@@ -591,7 +591,7 @@ that repeatedly receives a `uint` message, converts it to a string, and sends
591591
the string in response. The child terminates when it receives `0`.
592592
Here is the function that implements the child task:
593593

594-
~~~~
594+
~~~{.xfail-test .linked-failure}
595595
# use extra::comm::DuplexStream;
596596
# use std::uint;
597597
fn stringifier(channel: &DuplexStream<~str, uint>) {
@@ -614,7 +614,7 @@ response itself is simply the stringified version of the received value,
614614
615615
Here is the code for the parent task:
616616
617-
~~~~
617+
~~~{.xfail-test .linked-failure}
618618
# use std::task::spawn;
619619
# use std::uint;
620620
# use extra::comm::DuplexStream;

src/libextra/arc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ mod tests {
611611
}
612612
}
613613
}
614+
614615
#[test] #[should_fail] #[ignore(cfg(windows))]
615616
fn test_arc_condvar_poison() {
616617
unsafe {

src/libextra/sync.rs

+2
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,7 @@ mod tests {
935935
// child task must have finished by the time try returns
936936
do m.lock { }
937937
}
938+
#[ignore(reason = "linked failure")]
938939
#[test] #[ignore(cfg(windows))]
939940
fn test_mutex_killed_cond() {
940941
// Getting killed during cond wait must not corrupt the mutex while
@@ -961,6 +962,7 @@ mod tests {
961962
assert!(!woken);
962963
}
963964
}
965+
#[ignore(reason = "linked failure")]
964966
#[test] #[ignore(cfg(windows))]
965967
fn test_mutex_killed_broadcast() {
966968
use std::unstable::finally::Finally;

src/libstd/rt/kill.rs

+6
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ mod test {
614614
// Test cases don't care about the spare killed flag.
615615
fn make_kill_handle() -> KillHandle { let (h,_) = KillHandle::new(); h }
616616

617+
#[ignore(reason = "linked failure")]
617618
#[test]
618619
fn no_tombstone_success() {
619620
do run_in_newsched_task {
@@ -819,6 +820,7 @@ mod test {
819820
}
820821
}
821822

823+
#[ignore(reason = "linked failure")]
822824
#[test]
823825
fn block_and_get_killed() {
824826
do with_test_task |mut task| {
@@ -830,6 +832,7 @@ mod test {
830832
}
831833
}
832834

835+
#[ignore(reason = "linked failure")]
833836
#[test]
834837
fn block_already_killed() {
835838
do with_test_task |mut task| {
@@ -839,6 +842,7 @@ mod test {
839842
}
840843
}
841844

845+
#[ignore(reason = "linked failure")]
842846
#[test]
843847
fn block_unkillably_and_get_killed() {
844848
do with_test_task |mut task| {
@@ -856,6 +860,7 @@ mod test {
856860
}
857861
}
858862

863+
#[ignore(reason = "linked failure")]
859864
#[test]
860865
fn block_on_pipe() {
861866
// Tests the "killable" path of casting to/from uint.
@@ -869,6 +874,7 @@ mod test {
869874
}
870875
}
871876

877+
#[ignore(reason = "linked failure")]
872878
#[test]
873879
fn block_unkillably_on_pipe() {
874880
// Tests the "indestructible" path of casting to/from uint.

src/libstd/task/mod.rs

+19
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ pub unsafe fn rekillable<U>(f: &fn() -> U) -> U {
659659
}
660660
}
661661

662+
#[ignore(reason = "linked failure")]
662663
#[test] #[ignore(cfg(windows))]
663664
fn test_kill_unkillable_task() {
664665
use rt::test::*;
@@ -679,6 +680,7 @@ fn test_kill_unkillable_task() {
679680
}
680681
}
681682

683+
#[ignore(reason = "linked failure")]
682684
#[test] #[ignore(cfg(windows))]
683685
fn test_kill_rekillable_task() {
684686
use rt::test::*;
@@ -720,6 +722,7 @@ fn test_cant_dup_task_builder() {
720722
#[cfg(test)]
721723
fn block_forever() { let (po, _ch) = stream::<()>(); po.recv(); }
722724

725+
#[ignore(reason = "linked failure")]
723726
#[test] #[ignore(cfg(windows))]
724727
fn test_spawn_unlinked_unsup_no_fail_down() { // grandchild sends on a port
725728
use rt::test::run_in_newsched_task;
@@ -738,13 +741,15 @@ fn test_spawn_unlinked_unsup_no_fail_down() { // grandchild sends on a port
738741
po.recv();
739742
}
740743
}
744+
#[ignore(reason = "linked failure")]
741745
#[test] #[ignore(cfg(windows))]
742746
fn test_spawn_unlinked_unsup_no_fail_up() { // child unlinked fails
743747
use rt::test::run_in_newsched_task;
744748
do run_in_newsched_task {
745749
do spawn_unlinked { fail!(); }
746750
}
747751
}
752+
#[ignore(reason = "linked failure")]
748753
#[test] #[ignore(cfg(windows))]
749754
fn test_spawn_unlinked_sup_no_fail_up() { // child unlinked fails
750755
use rt::test::run_in_newsched_task;
@@ -754,6 +759,7 @@ fn test_spawn_unlinked_sup_no_fail_up() { // child unlinked fails
754759
do 16.times { task::yield(); }
755760
}
756761
}
762+
#[ignore(reason = "linked failure")]
757763
#[test] #[ignore(cfg(windows))]
758764
fn test_spawn_unlinked_sup_fail_down() {
759765
use rt::test::run_in_newsched_task;
@@ -766,6 +772,7 @@ fn test_spawn_unlinked_sup_fail_down() {
766772
}
767773
}
768774

775+
#[ignore(reason = "linked failure")]
769776
#[test] #[ignore(cfg(windows))]
770777
fn test_spawn_linked_sup_fail_up() { // child fails; parent fails
771778
use rt::test::run_in_newsched_task;
@@ -786,6 +793,7 @@ fn test_spawn_linked_sup_fail_up() { // child fails; parent fails
786793
assert!(result.is_err());
787794
}
788795
}
796+
#[ignore(reason = "linked failure")]
789797
#[test] #[ignore(cfg(windows))]
790798
fn test_spawn_linked_sup_fail_down() { // parent fails; child fails
791799
use rt::test::run_in_newsched_task;
@@ -802,6 +810,7 @@ fn test_spawn_linked_sup_fail_down() { // parent fails; child fails
802810
assert!(result.is_err());
803811
}
804812
}
813+
#[ignore(reason = "linked failure")]
805814
#[test] #[ignore(cfg(windows))]
806815
fn test_spawn_linked_unsup_fail_up() { // child fails; parent fails
807816
use rt::test::run_in_newsched_task;
@@ -814,6 +823,7 @@ fn test_spawn_linked_unsup_fail_up() { // child fails; parent fails
814823
assert!(result.is_err());
815824
}
816825
}
826+
#[ignore(reason = "linked failure")]
817827
#[test] #[ignore(cfg(windows))]
818828
fn test_spawn_linked_unsup_fail_down() { // parent fails; child fails
819829
use rt::test::run_in_newsched_task;
@@ -826,6 +836,7 @@ fn test_spawn_linked_unsup_fail_down() { // parent fails; child fails
826836
assert!(result.is_err());
827837
}
828838
}
839+
#[ignore(reason = "linked failure")]
829840
#[test] #[ignore(cfg(windows))]
830841
fn test_spawn_linked_unsup_default_opts() { // parent fails; child fails
831842
use rt::test::run_in_newsched_task;
@@ -844,6 +855,7 @@ fn test_spawn_linked_unsup_default_opts() { // parent fails; child fails
844855
// A couple bonus linked failure tests - testing for failure propagation even
845856
// when the middle task exits successfully early before kill signals are sent.
846857

858+
#[ignore(reason = "linked failure")]
847859
#[test] #[ignore(cfg(windows))]
848860
fn test_spawn_failure_propagate_grandchild() {
849861
use rt::test::run_in_newsched_task;
@@ -860,6 +872,7 @@ fn test_spawn_failure_propagate_grandchild() {
860872
}
861873
}
862874

875+
#[ignore(reason = "linked failure")]
863876
#[test] #[ignore(cfg(windows))]
864877
fn test_spawn_failure_propagate_secondborn() {
865878
use rt::test::run_in_newsched_task;
@@ -876,6 +889,7 @@ fn test_spawn_failure_propagate_secondborn() {
876889
}
877890
}
878891

892+
#[ignore(reason = "linked failure")]
879893
#[test] #[ignore(cfg(windows))]
880894
fn test_spawn_failure_propagate_nephew_or_niece() {
881895
use rt::test::run_in_newsched_task;
@@ -892,6 +906,7 @@ fn test_spawn_failure_propagate_nephew_or_niece() {
892906
}
893907
}
894908

909+
#[ignore(reason = "linked failure")]
895910
#[test] #[ignore(cfg(windows))]
896911
fn test_spawn_linked_sup_propagate_sibling() {
897912
use rt::test::run_in_newsched_task;
@@ -1195,6 +1210,7 @@ fn test_avoid_copying_the_body_unlinked() {
11951210
}
11961211
}
11971212
1213+
#[ignore(reason = "linked failure")]
11981214
#[test]
11991215
#[ignore(cfg(windows))]
12001216
#[should_fail]
@@ -1230,6 +1246,7 @@ fn test_unkillable() {
12301246
po.recv();
12311247
}
12321248

1249+
#[ignore(reason = "linked failure")]
12331250
#[test]
12341251
#[ignore(cfg(windows))]
12351252
#[should_fail]
@@ -1296,6 +1313,7 @@ fn test_simple_newsched_spawn() {
12961313
}
12971314
}
12981315

1316+
#[ignore(reason = "linked failure")]
12991317
#[test] #[ignore(cfg(windows))]
13001318
fn test_spawn_watched() {
13011319
use rt::test::run_in_newsched_task;
@@ -1318,6 +1336,7 @@ fn test_spawn_watched() {
13181336
}
13191337
}
13201338

1339+
#[ignore(reason = "linked failure")]
13211340
#[test] #[ignore(cfg(windows))]
13221341
fn test_indestructible() {
13231342
use rt::test::run_in_newsched_task;

src/test/run-fail/extern-fail.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test linked failure
1112
// error-pattern:explicit failure
1213
// Testing that runtime failure doesn't cause callbacks to abort abnormally.
1314
// Instead the failure will be delivered after the callbacks return.

src/test/run-fail/linked-failure.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// except according to those terms.
1111

1212

13+
// xfail-test linked failure
1314
// error-pattern:1 == 2
1415
extern mod extra;
1516

src/test/run-fail/linked-failure2.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// except according to those terms.
1111

1212

13+
// xfail-test linked failure
1314
// error-pattern:fail
1415

1516
use std::comm;

src/test/run-fail/linked-failure3.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// except according to those terms.
1111

1212

13+
// xfail-test linked failure
1314
// error-pattern:fail
1415

1516
use std::comm;

src/test/run-fail/linked-failure4.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// option. This file may not be copied, modified, or distributed
1010
// except according to those terms.
1111

12+
// xfail-test linked failure
1213
// error-pattern:1 == 2
1314

1415
use std::comm;

src/test/run-fail/spawnfail.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test linked failure
1112
// xfail-win32
1213
// error-pattern:explicit
1314
extern mod extra;

src/test/run-fail/task-comm-recv-block.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test linked failure
1112
// error-pattern:goodfail
1213

1314
use std::comm;

src/test/run-pass/issue-3168.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test linked failure
1112
// xfail-fast
1213
// xfail-win32 #7999
1314

src/test/run-pass/lots-a-fail.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test linked failure
1112
// xfail-win32 leaks
1213
extern mod extra;
1314

src/test/run-pass/send-iloop.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test linked failure
1112
// xfail-win32
1213
extern mod extra;
1314

src/test/run-pass/task-killjoin-rsrc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test linked failure
1112
// xfail-win32
1213

1314
// A port of task-killjoin to use a class with a dtor to manage

src/test/run-pass/task-killjoin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test linked failure
1112
// xfail-win32
1213

1314
// Create a task that is supervised by another task, join the supervised task

0 commit comments

Comments
 (0)