ACCESS_DENIED on Resume running on Windows7
thr27 opened this issue · 4 comments
Using damon on windows7 fails on starting an application.
Damon terminates with ACCESS_DENIED error on trying to resume threads in child process.
{"level":"info","cmdline":["D:\dev\go.dev\src\github.com\jet\damon\damon.exe","C:\Windows\System32\notepad.exe"],"revision":"90081519ee8206e7af6671120ed382b0298ec0af","version":{"Revision":"90081519ee8206e7af6671120ed382b0298ec0af","Number":"0.1.0","PreRelease":"","BuildMetadata":""},"time":"2019-05-17T17:16:44+02:00","message":"damon starting"}
{"level":"error","error":"The handle is invalid.","time":"2019-05-17T17:16:44+02:00","message":"win32: failed to close process handle"}
{"level":"error","stacktrace":["github.com/jet/damon/container.(*Container).Start\n\tD:/dev/go.dev/src/github.com/jet/damon/container/container.go:181","main.main\n\tD:/dev/go.dev/src/github.com/jet/damon/main.go:82","runtime.main\n\td:/dev/golang/src/runtime/proc.go:200","runtime.goexit\n\td:/dev/golang/src/runtime/asm_amd64.s:1337"],"error":"container: Could not resume process main thread: Access is denied.","time":"2019-05-17T17:16:44+02:00","message":"damon startup error"}
This can be fixed with a simple patch in win32\thread_win32.go, line 172
Instead of _THREAD_RESUME you need _THREAD_SUSPEND_RESUME
Issue_5_patch.zip
Hi @thr27 thanks for reporting this issue, and supplying a patch! Are you able to submit the patch as part of a PR?
Sorry havn't done a PR before ...
No problem. I've created a PR for you with your patch in #16