Ricardo D.
-
Posts
2 -
Joined
-
Last visited
Posts posted by Ricardo D.
-
-
I think I'm facing a similar issue. This program:
// Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan.// See page 4.//!+// Echo1 prints its command-line arguments.package mainimport ("fmt""os")func main() {var s, sep stringfor i := 1; i < len(os.Args); i++ {s += sep + os.Args[i]sep = " "}fmt.Println(s)}//!-runs normally like this:
> go run main.go one two three
one two three
But when I modify it to debug the sep variable:package mainimport ("fmt""os")func main() {var s, sep stringfmt.Println("{", sep, "}")for i := 1; i < len(os.Args); i++ {fmt.Println("<", sep, ">")s += sep + os.Args[i]sep = " "}fmt.Println(s)}then I get this:
PS C:\Users\Ricardo\Documents\workspace\go\rdirani\gopl.io\ch1\echo1> go run echo1.go one two three
fork/exec C:\Users\Ricardo\AppData\Local\Temp\go-build1657779692\b001\exe\echo1.exe: Access is denied.
And Kaspersky records this:
Event: Application placed in restricted group
Component: Application Control
Name: VHO:Backdoor.MSIL.Crysan.gen
Object name: Untrusted
Reason: Detected: VHO:Backdoor.MSIL.Crysan.gen
and it doesn't give me any option to report this as a false positive.
Interestingly, if I build it, it doesn't get flagged:
PS C:\Users\Ricardo\Documents\workspace\go\rdirani\gopl.io\ch1\echo1> ./echo1 one two three
{ }
< >
< >
< >
one two three
VHO:Trojan.Win32.Krycka.gen detected in Golang go.exe.
in Kaspersky Anti-Virus
Posted
I found a workaround for this:
https://stackoverflow.com/questions/34033790/go-programs-hanging-on-windows-10
The trick is to set this environment variable:
go env -w GOTMPDIR="C:\Users<user>\go\tmp"
Now go run creates the executable there instead of in /tmp. Kaspersky doesn't seem to be bothered by that. I had disabled Kaspersky and was using Windows Defender when I applied that solution, and it still complained, but then I added an exclusion to that folder and it fixed the issue. Now I've reinstalled Kaspersky and it is also working fine with go run now.