Skip to content

runtime/race: externally link, PIE, race-enabled executable crashes on startup #15443

@mwhudson

Description

@mwhudson

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

go version devel +91824fb Fri Apr 22 10:21:03 2016 +1200 linux/amd64

or

go version go1.6.1 linux/amd64

  1. What operating system and processor architecture are you using (go env)?

linux/amd64, 16.04 or 16.10

  1. What did you do?

go run -ldflags='-linkmode=external -extldflags=-pie' -race /opt/opensource/go-test-cases/trivial.go

  1. What did you expect to see?

No output.

  1. What did you see instead?

==12590==ERROR: ThreadSanitizer failed to allocate 0x2698000 (40468480) bytes at address 1765924f4c680 (errno: 12)
signal: segmentation fault (core dumped)

This came to my attention because the development release of Ubuntu has enabled PIE by default on amd64 and ./all.bash fails in the "Testing race detector" step. This could be patched around by passing -no-pie to the external linker when -race is passed to the linker but that seems like a short term hack only.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions