-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
This issue comes from the investigation of: dotnet/macios#4509
There is a regression in macOS 10.14 where if all the following are true for me:
- Building with Xcode10GM
- Running on macOS 10.14
- Launching from Finder or via "open" on the command line
- In a project with a xib not a storyboard as the main entry point
AppKit starts drawing corrupted graphics.
If any of those preconditions are false, say launching from Xcode instead of Finder\open, everything appears to draw fine but sometimes later strange drawing behavior creeps in anyway.
I've tracked it down to a single mprotect call in startup after @lemonmojo did some amazing work and tracked it down to just mono_jit_init ().
I've filed radar://44763485 on this, but mono may need to implement some sort of work around.
Steps to Reproduce
- Unzip MProtectMadness_WithMono.zip
cd MProtectMadness
2 (a). You may need to open MProtectMadness.xcodeproj and change signing keysrm -fr build/ && xcodebuild -project MProtectMadness.xcodeproj/open ./build/Release/MProtectMadness.app
The built in screenshot tool doesn't correctly capture what's on the screen, but you should see a ghost outline of a modal dialog that is not painting correctly.
Hitting escape will break you out of it and let you close the main window \ quit.
A single mono_jit_init call or mprotect with some math I stole from the mono startup sequence both trigger it exactly the same. See USE_MONO define in sample.
Current Behavior
Trigger strange AppKit drawing bug.
Expected Behavior
Work around said brokeness
On which platforms did you notice this
[x] macOS
[ ] Linux
[ ] Windows
Version Used:
I've reproduced this on mono 5.12, 5.16, and 5.19 (master 3 commits ago today), and a local mono build at a90249f.