-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
netcorebgb puts display to sleep on macOS #146
netcorebgb puts display to sleep on macOS #146
Comments
Did you build netcoredbg yourself or used provided binary? |
@gbalykov Thank you so much for looking into this. I actually tried it both ways. And no matter if I use the download version from github or compile it myself, the result is the same. |
Did you check any system logs? There might be some info there. Also maybe the whole system goes to suspend, not just the screen. |
The
|
Hmm...
not really sure this is debugger related at all, since we don't have any sleep or status change related code. I also see a lot of output in google search at "Entering DarkWake state due to Software Sleep" request, you probably could find something related. |
I have been able to track down the
That suggests that the sleep is related to
|
You can also try with same version of netcoredbg and different .net versions (.net8, .net6, .net core 3.1, etc) to gather more data. And also with different versions of netcoredbg with some fixed .net version. Netcoredbg doesn't have any sleep related logic, maybe there's smth in runtime, but that would also be strange. |
@gbalykov I have tried different versions of I will investigate further and I will let you know which version introduces the problem. |
The problem starts with the version from February 17, 2022
I have also tried 1.2.0-786 which introduces the Between April 16, 2021 and February 17, 2022 there are no releases with Mac binaries. |
Can you try with latest netcoredbg, but with different .net versions? |
@gbalykov Sorry, it took me a while to find time to try this. I have tried the latest version of |
@geraldspreer Can you also try to find commit, which introduced this problem? There're 109 commits between 1.2.0-786 and 2.0.0-58, all of them support .net 6 build, and it will take around 5 builds with bisect. It will help a lot to find the root cause of this issue. |
Unfortunately I cannot compile the code without errors. When I run
|
@geraldspreer please follow next instruction
cd /tmp
git clone https://github.com/dotnet/runtime
cd runtime
git checkout release/6.0
git cherry-pick 7ee73042f052261c0433c00d852f5ba0ea2fea12
# next one is not needed after Dec 16 2021
git cherry-pick 32698c72fe5d26ba70b714dc7d0e6e42b4662fe8
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCORECLR_DIR=/tmp/runtime/src/coreclr -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release
make
make install now you can find netcordbg in |
@gbalykov Even when following your instruction to the letter, I still get the same error message on commit
This issue is probably the same as described here: #70 at least it's also related to To verify the steps that I am taking - this is my compile script:
|
You should fix this by remove |
Thank you @viewizard, I will now try to find the commit that introduces the issue. |
This fixes issue Samsung#146 Samsung#146
After bisecting thru working and non-working commits, I have found that the issue is actually introduced by the second cherry-pick. Namely 32698c7 When I change the code to: I have no idea on how setting this Also when I leave the
|
@geraldspreer thank you for analysis! It seems strange though that |
@gbalykov I hope this helps...
|
@geraldspreer is this with or without force_flat_namespace? |
without, I will create one with force_flat_namespace |
This is when compiling and running the latest
Both outputs are exactly the same. |
Can you also try smth like strace (dtruss, ktrace, etc.) on mac to see syscalls and share logs with/without flat namespaces? |
@gbalykov See attached files. |
Inside both logs I found lines:
this looks strange for me. Are you sure, that you have debug session started for I also worry, why this logs starts from vscode protocol output from debugger related to managed debuggee process start, we need all debugger related lines (debugger process start, native libs load, etc). |
This must sound strange, but when I run
netcoredbg
on my Mac it reliably puts the display to sleep.❯ /usr/local/bin/netcoredbg/netcoredbg --log --interpreter=cli -- dotnet ./bin/Debug/net7.0/Hello.dll
The file
program.cs
contains just:Console.WriteLine("Hello, World!");
and in fact it does not matter what the code I am debugging is, I can reproduce this any time. As far as I can tell, when the debugger exits, the display goes to sleep.Steps to reproduce:
dotnet new console hello
cd hello
dotnet run
- so that we have a debug build$ /usr/local/bin/netcoredbg/netcoredbg --log --run --interpreter=cli -- dotnet ./bin/Debug/net7.0/Hello.dll
When I am setting breakpoints, I can
step
ornext
without any problems but,finish
orcontinue
will cause the display to sleep. When I run with--interpreter=vscode
and the sleeping occurs, when I wake the display I still need to hit a key to exit the debugger, so I guess while the debugger waits for some input, the problem occurs.I would appreciate your help. But maybe I am just making a mistake here.
My system is:
running macOS Big Sur 11.7.6
The text was updated successfully, but these errors were encountered: