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

runtime/race: GORACE="strip_path_prefix..." ignored with Windows paths #5992

Closed
shivakumargn opened this issue Jul 30, 2013 · 9 comments
Closed

Comments

@shivakumargn
Copy link
Contributor

With GORACE set, in path like D:\<fullpath> only "D" can stripped and
what remains is :\<fullpath>

":" and later characters in GORACE are ignored.

Example:
 
set GORACE="strip_path_prefix=D:\sources"

D:\sources\gopath\src\learn>go run -race race.go
==================
WARNING: DATA RACE
Read by goroutine 4:
  main.func┬╖002()
      :/sources/gopath/src/learn/race.go:37 +0x56

Previous write by goroutine 1:
  main.main()
      :/sources/gopath/src/learn/race.go:30 +0x1af

Goroutine 4 (running) created at:
  main.main()
      :/sources/gopath/src/learn/race.go:38 +0x19f

Goroutine 1 (running) created at:
  _rt0_go()
      :/sources/golang/src/pkg/runtime/asm_amd64.s:95 +0x117

==================
Found 1 data race(s)
exit status 66
@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 1:

Have you tried using forward slashes, as in D:/sources ?
I don't know if it will help but maybe.

Status changed to Accepted.

@shivakumargn
Copy link
Contributor Author

Comment 2:

The problem is not with the path separator but with the removal of ":" itself.
I have tried "\", "/", "\\" for path separator with no difference in result.
I have also tried escaping the ":" with "\".

@dvyukov
Copy link
Member

dvyukov commented Jul 31, 2013

Comment 3:

Owner changed to @dvyukov.

@dvyukov
Copy link
Member

dvyukov commented Aug 8, 2013

Comment 4:

Unfortunately, long time ago somebody decided that ':' is a good delimiter for
parameters, so "strip_path_prefix=c:\foo" becomes just "strip_path_prefix=c", and you
should see that it strips "c" from paths.
Fortunately, the string does not need to be a prefix, so instead of
"strip_path_prefix=c:\foo\bar\", you can set "strip_path_prefix=foo\bar\", and it will
have the same effect.

Status changed to Unfortunate.

@shivakumargn
Copy link
Contributor Author

Comment 5:

"strip_path_prefix=foo\bar\" has no effect. No stripping happens with this option.

@dvyukov
Copy link
Member

dvyukov commented Aug 8, 2013

Comment 6:

There is something weird with windows env handling.
Try
set GORACE=strip_path_prefix=sources

@dvyukov
Copy link
Member

dvyukov commented Aug 8, 2013

Comment 7:

I mean, I've just checked and it works for me.

@shivakumargn
Copy link
Contributor Author

Comment 8:

Yes, works partly. Good enough for my needs.
If strip_path_prefix=D:\sources\golang:D:\sources\gopath, stripping is done only for the
first path. Path after ":" is not picked.

@dvyukov
Copy link
Member

dvyukov commented Aug 8, 2013

Comment 9:

As of now, strip_path_prefix value is a single string, there is no support for a list of
paths to strip.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants