On Fri, Feb 24, 2017 at 2:39 PM, Owen Waller <go-n...@kulawe.com> wrote:
> Hi Dimitry,
>
> C++ ThreadSanitizer works on arm64. So making it work for Go should be
> a modest amount of work.
>
>
> Thanks for confirming this. Should I now Open a issue on Github so we can
> track adding this?

If there is somebody who is willing to work on this, then yes. Otherwise, maybe.

> Also, does it exist for any other platforms? There are hints of PPC64. What
> about MIPS64? or any of the other platforms that Go supports (at least on
> linux) - SPARC64?

Supported platforms are enumerated in
llvm/projects/compiler-rt/lib/tsan/rtl/tsan_platform.h
I see x86_64, aarch64, mips64 and powerpc64


> ThreadSanitizer does not work on any 32-bit platforms. It assumes that
> it can reserve huge continuous chunks of address space for various
> things.
>
>
> I have no idea how the ThreadSanitizer works, but can you clarify what you
> mean by "huge"?
> I'm coming at this from am embedded angle, So huge to me is a program that
> swallows 10's of Megs of RAM.

Tsan reserves 4X for shadow memory (where X is amount of memory where
user data resides), 0.5X for another shadow memory, 1TB for heap and
128GB for thread info. You can see the details in
llvm/projects/compiler-rt/lib/tsan/rtl/tsan_platform.h.



> 32bit support would potentially also allow support on Android - on current
> hardware.

There are 64-bit androids already. I would rather test with tsan
there. That's what we do for kernel ASAN.


> ThreadSanitizer is not dependend on underlying hardware memory model,
> it check against abstract language memory model. So even if you
> production code runs on arm32, you can well test it for races on
> x86_64.
>
>
> Unfortunately I'm in a case where this isn't possible. I'm trying to make
> sure that an library I am writing is go routine safe. The library itself
> writes directly to the i2c bus on a Raspberry Pi to control an IC. The code
> isn't ARM only (per say) but the hardware element means it is.

Maybe it's possible to stub the i2c part? That would make testing much
simpler regardless of tsan.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to