Fixed SEH in fibers on Windows Server OSes. #150
Conversation
@CyberShadow: Since I happen to know that you use a Windows Server box, could you please test the commit, if you have time? |
I can't seem to build this branch of druntime... the
Edit: never mind, works after merging into master. |
Unittests pass for me. |
Windows Server 2008 and 2008 R2 validate the exception chain by default, so we need to install a Windows-internal default handler at the root of the chain. See in-code comment for details.
Okay, thanks (and rebased to latest master). |
Fixed SEH in fibers on Windows Server OSes.
I know this is ancient code, but it's failing on windows server 2012 for 32 bit windows apps. See the thread I started on dmd-internal. |
Do the tests pass if you revert the change (and disable SEHOP)? Otherwise, broken EH in fibres is hardly related to this PR. |
Daniel's investigations suggest while it looks similar, it might be a different cause for the same test to fail. He's digging into it, though more eyes couldn't hurt. I haven't tried reverting this change to see if it helps yet. I'm more focused on other things right now since disabling the tests isn't the end of the world. |
Okay, I see. Fibres being broken on Windows is sort of a big deal, given that vibe.d makes extensive use of them and there is |
@klickverbot I tried disabling SEHOP and it didn't seem to make a difference. |
We cannot use ldc.intrinsics.llvm_readcyclecounter because that is not an accurate time counter (it is a counter of CPU cycles, where here we want a time clock). Also, priviledged execution rights are needed to enable correct counting with ldc.intrinsics.llvm_readcyclecounter on AArch64. So instead, we use the general virtual counter register, and also read out the frequency of that counter.
Windows Server 2008 and 2008 R2 validate the exception chain by default, so we need to install a Windows-internal default handler at the root of the chain. See in-code comment for details.