Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kumpera
Copy link
Contributor

@kumpera kumpera commented Mar 5, 2018

No description provided.

kumpera added 2 commits March 5, 2018 14:17
…hread is running a cctor.

This eliminates a possible source of deadlocks found during AOT runs of Roslyn.
…imply deadlock in case of execution dependency bugs.
@kumpera kumpera requested review from luhenry and vargaz as code owners March 5, 2018 22:31
//Dependency management is too compilated and we want to get rid of this anyways.

//We can't suspend the current thread if it's running a protected block (such as a cctor)
//We can't relie only on JIT nesting as cctor's can be run from outside the JIT.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relie -> rely

@luhenry luhenry self-assigned this Mar 5, 2018
//We can't suspend the current thread if it's running a protected block (such as a cctor)
//We can't relie only on JIT nesting as cctor's can be run from outside the JIT.

//Finally, he hit a timeout or spurious wakeup. We're better of just giving up and keep recompiling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of => off

@kumpera
Copy link
Contributor Author

kumpera commented Mar 6, 2018

Fixed spelling.

g_assert (entry->has_cond);
mono_coop_cond_wait (&entry->cond, &compilation_data.lock);
mono_coop_cond_timedwait (&entry->cond, &compilation_data.lock, MAX_JIT_TIMEOUT_MS);
--entry->threads_waiting;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this going to mask bugs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will.
OTH, it ensures progress can be made even if slow enough. Do you think it's not worth it?

@luhenry
Copy link
Contributor

luhenry commented Mar 19, 2018

@monojenkins build Windows x64

@luhenry
Copy link
Contributor

luhenry commented Mar 19, 2018

@monojenkins build Windows i386

@luhenry
Copy link
Contributor

luhenry commented Mar 19, 2018

@monojenkins build OS X x64

@luhenry
Copy link
Contributor

luhenry commented Mar 19, 2018

@monojenkins build Linux x64 Acceptance Tests

@luhenry
Copy link
Contributor

luhenry commented Mar 19, 2018

@monojenkins build Linux AArch64

@marek-safar marek-safar merged commit 74daf13 into mono:master Mar 23, 2018
@luhenry
Copy link
Contributor

luhenry commented Mar 23, 2018

@marek-safar I am not sure we wanted to merge it 😉

@kumpera can you confirm if we should revert or keep it?

@kumpera
Copy link
Contributor Author

kumpera commented Mar 23, 2018

I think me and Zoltan were undecided on whether use a timeout and ensure progress or keep it invite and make bugs evident.

Merging this is fine. In case we decide of the later, I'll do a followup PR.

@kumpera
Copy link
Contributor Author

kumpera commented Mar 23, 2018

@vargaz what do you think?

@kumpera kumpera deleted the fix_possible_jit_deadlock branch March 23, 2018 17:33
@vargaz
Copy link
Contributor

vargaz commented Mar 23, 2018

I didn't like the timeout, but its fine.

@lewurm
Copy link
Contributor

lewurm commented Apr 13, 2018

@monojenkins backport 2018-02

UnityAlex pushed a commit to Unity-Technologies/mono that referenced this pull request Oct 12, 2021
* [mini] Don't wait for other threads to finish JITing if the current thread is running a cctor.

This eliminates a possible source of deadlocks found during AOT runs of Roslyn.

* [mini] Introduce a 1s timeout to JIT job control to ensure we don't simply deadlock in case of execution dependency bugs.

* [mini] fix spelling5DD
UnityAlex added a commit to Unity-Technologies/mono that referenced this pull request Oct 26, 2021
…1730-blindfix

Harden JIT job control against cctors deadlocking. (mono#7423)
dtomar-rythmos pushed a commit to Unity-Technologies/mono that referenced this pull request Dec 23, 2021
* [mini] Don't wait for other threads to finish JITing if the current thread is running a cctor.

This eliminates a possible source of deadlocks found during AOT runs of Roslyn.

* [mini] Introduce a 1s timeout to JIT job control to ensure we don't simply deadlock in case of execution dependency bugs.

* [mini] fix spelling5DD
dtomar-rythmos added a commit to Unity-Technologies/mono that referenced this pull request Jan 5, 2022
…1730-blindfix

Harden JIT job control against cctors deadlocking. (mono#7423)
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* [mini] Don't wait for other threads to finish JITing if the current thread is running a cctor.

This eliminates a possible source of deadlocks found during AOT runs of Roslyn.

* [mini] Introduce a 1s timeout to JIT job control to ensure we don't simply deadlock in case of execution dependency bugs.

* [mini] fix spelling5DD


Commit migrated from mono/mono@74daf13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants