gotools icon indicating copy to clipboard operation
gotools copied to clipboard

Errors creating symbol names on import of binary

Open deliciouslytyped opened this issue 6 years ago • 6 comments

Error creating symbol: type.struct {} - Symbol name contains invalid characters: type.struct {}
Error creating symbol: go.(*struct { sync.Mutex; reflect.m sync.Map }).Unlock - Symbol name contains invalid characters: go.(*struct { sync.Mutex; reflect.m sync.Map }).Unlock

deliciouslytyped avatar May 23 '19 13:05 deliciouslytyped

Do you know the version of go that was used to compile this binary? Do you happen to have the source of this binary?

felberj avatar May 23 '19 13:05 felberj

Yes and yes, I'm not very familiar with go though and I don't think I'm in a position to share the source. I'll see what I can do.

deliciouslytyped avatar May 23 '19 13:05 deliciouslytyped

Ok, I think it may have been go 1.11.6 and you specified 1.12

deliciouslytyped avatar May 23 '19 13:05 deliciouslytyped

Thanks! If your binary is not striped, you can just disable the "Go Function Name Analyzer". It looks like there are anonymous structs and I did not yet play around with those.

felberj avatar May 23 '19 13:05 felberj

Unless I messed up my build script, I get the same errors with 1.12.

deliciouslytyped avatar May 23 '19 13:05 deliciouslytyped

Can you try to provide a minimal code snipped with this go.(*struct { sync.Mutex; reflect.m sync.Map }).Unlock symbol? You might need to compile it like in https://github.com/felberj/gotools/blob/master/testdata/Makefile to avoid optimisations.

I am not sure what the best solution for this is. We might want to filter out these symbols, or as a quick and dirty hack just ignore them like here: https://github.com/felberj/gotools/blob/master/src/main/java/gotools/GoFunctionNameAnalyzer.java#L76

felberj avatar May 23 '19 13:05 felberj