Skip to content
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

coyote replay --break does not wait for debugger to attach #47

Closed
thepalbi opened this issue Aug 18, 2020 · 6 comments
Closed

coyote replay --break does not wait for debugger to attach #47

thepalbi opened this issue Aug 18, 2020 · 6 comments

Comments

@thepalbi
Copy link

Hi Coyote team!

I'm playing around with the Coyote toolset with the HelloWorldTasks example. I want to try the coyote replay tool. I'm trying the following:

1- Run coyote test ./obj/Release/netcoreapp3.1/osx-x64/HelloWorldTasks.dll --iterations 100 to generate the faulty trace
2- Run coyote replay ./obj/Release/netcoreapp3.1/osx-x64/HelloWorldTasks.dll ./obj/Release/netcoreapp3.1/osx-x64/Output/HelloWorldTasks.dll/CoyoteOutput/HelloWorldTasks_0_1.schedule --break to replay the program with that trace
3- Expect that the coyote runtime will wait for a debugger to attach until it starts reproducing it. Not sure of this, that's my assumption of how it sould work

Any advice on how to use it? (I'm working with MacOS if it help in some way)

@akashlal
Copy link
Collaborator

I just tried this on my windows machine and I get a prompt to attach the debugger. Perhaps mac requires a different API to launch (or enable) the debugger? @lovettchris any ideas?

@akashlal
Copy link
Collaborator

You can try a workaround. You can go edit the source code of HelloWorldTasks and insert a breakpoint yourself at the beginning of the test (I usually do Debugger.Launch). Then you can rebuild and try coyote replay with the same schedule file. There is no need to rerun coyote test because the same schedule would still work for the test.

@thepalbi
Copy link
Author

Thanks for answering @akashlal . Just tried what you suggested and is also not working. I asked in the dotnet issues section to check if it's supported. dotnet/runtime#41029

@akashlal
Copy link
Collaborator

Ok, the issue then is to figure out how to attach the debugger from dotnet on mac. If you find out the answer, let us know so we can implement the same in coyote.

@lovettchris
Copy link
Member

Looks like from the runtime thread Debugger.Launch is not supported, so what you can do instead is "start" coyote replay in your debugger. I have not use VS on the Mac, but on Windows I can create any random console app and change the "Debug" tab to tell the debugger to launch something else instead, namely, dotnet.dll, with the command line arguments of coyote replay ./obj/Release/netcoreapp3.1/osx-x64/HelloWorldTasks.dll ./obj/Release/netcoreapp3.1/osx-x64/Output/HelloWorldTasks.dll/CoyoteOutput/HelloWorldTasks_0_1.schedule and then you should be able to put a breakpoint in your early code and continue on debugging into the replay that way.

@thepalbi
Copy link
Author

Thanks @lovettchris . The approach on launching coyote from VS worked.
In case anyone is interested:
1- Create a new Run Configuration
2- Execute the coyote binary, which is in /Users/thepalbi/.dotnet/tools/coyote in MacOS
3- Add the arguments replay ./obj/Release/netcoreapp3.1/osx-x64/HelloWorldTasks.dll ./obj/Release/netcoreapp3.1/osx-x64/Output/HelloWorldTasks.dll/CoyoteOutput/HelloWorldTasks_0_1.schedule
4- Insert the breakpoints where needed

There's no support for Debugger.Launch in either MacOS or Linux.

pdeligia pushed a commit that referenced this issue Aug 25, 2020
fix info about rewriting json file.
add troublshooting for --break on MacOS and Linux based on [github issue 57](#47).
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

No branches or pull requests

3 participants