Commit 66bcc1e
[dartdev] Fix race in DartDev::RunDartDev
It was checking DartDev::result_ was set to determine if
dartdev is done, however the intent of the code is to
only continue once we receive DartDev_Result_Exit from
dartdev (based on the fact that we only Notify in
ExitResultCallback).
This code was incorrect if we encounter a spurios wakeup:
we might reach RunExecResultCallback but only execute it
partially i.e. set result_ to DartDev_Result_RunExec but
only partially initialize argv_ and argc_, and not yet
initialize script_name_. However at this point we might
spuriously wakeup from our Wait in RunDartDev and think
that we can continue - which means we will hit a crash
once we try to use partially initialized information for
Process::Exec which would cause us to crash.
The bug was discovered based on stack traces provided by
Elliott Brooks (elliottbrooks) which occur on Dev Tools
CI.
TEST=too hard to reliably test this
Change-Id: Ied9cace6bec9505b51ac0142795708466d166f28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445180
Reviewed-by: Daco Harkes <[email protected]>
Commit-Queue: Slava Egorov <[email protected]>1 parent 67d39ca commit 66bcc1e
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
| 715 | + | |
715 | 716 | | |
716 | 717 | | |
717 | 718 | | |
| |||
779 | 780 | | |
780 | 781 | | |
781 | 782 | | |
782 | | - | |
| 783 | + | |
783 | 784 | | |
784 | 785 | | |
785 | 786 | | |
| |||
940 | 941 | | |
941 | 942 | | |
942 | 943 | | |
| 944 | + | |
943 | 945 | | |
944 | 946 | | |
945 | 947 | | |
| |||
949 | 951 | | |
950 | 952 | | |
951 | 953 | | |
| 954 | + | |
952 | 955 | | |
953 | 956 | | |
954 | 957 | | |
| |||
0 commit comments