/ go Public

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

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

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

opened this issue Jul 30, 2013 · 9 comments
Labels
Milestone

### shivakumargn commented Jul 30, 2013

 With GORACE set, in path like D:\ only "D" can stripped and what remains is :\ ":" 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 The text was updated successfully, but these errors were encountered:

### 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 commented Jul 30, 2013

 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 commented Jul 31, 2013

 Comment 3: Owner changed to @dvyukov.

### 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 commented Aug 8, 2013

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

### dvyukov commented Aug 8, 2013

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

### dvyukov commented Aug 8, 2013

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

### shivakumargn commented Aug 8, 2013

 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 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.

added this to the Go1.2 milestone Apr 14, 2015
removed the go1.2maybe label Apr 14, 2015
locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.