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: memory leak in race runtime #16441

Closed
dvyukov opened this issue Jul 20, 2016 · 4 comments
Closed

runtime/race: memory leak in race runtime #16441

dvyukov opened this issue Jul 20, 2016 · 4 comments

Comments

@dvyukov
Copy link
Member

dvyukov commented Jul 20, 2016

The leak was reported internally on a sever canary that runs for days.
After a day server consumes 5.6GB, after 6 days -- 12.2GB.
The leak is exposed by the following benchmark:

func BenchmarkStackLeak(b *testing.B) {
    done := make(chan bool, 1)
    for i := 0; i < b.N; i++ {
        go func() {
            growStack(rand.Intn(100))
            done <- true
        }()
        <-done
    }
}

func growStack(i int) {
    if i == 0 {
        return
    }
    growStack(i - 1)
}

The leak is fixed upstream in :
http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_thread.cc?view=diff&r1=276102&r2=276103&pathrev=276103

@dvyukov dvyukov added this to the Go1.7Maybe milestone Jul 20, 2016
@dvyukov dvyukov self-assigned this Jul 20, 2016
@gopherbot
Copy link

CL https://golang.org/cl/25091 mentions this issue.

@dvyukov
Copy link
Member Author

dvyukov commented Jul 20, 2016

The change is submitted. The is not autoclosed for some reason. Closing.

@dvyukov dvyukov closed this as completed Jul 20, 2016
@dvyukov dvyukov reopened this Jul 20, 2016
@dvyukov
Copy link
Member Author

dvyukov commented Jul 20, 2016

Reopened in case this needs to be merged into 1.7.

@bradfitz
Copy link
Contributor

@dvyukov, we use separate bugs for master fixes vs branch cherry-picks now.

@golang golang locked and limited conversation to collaborators Jul 20, 2017
@rsc rsc unassigned dvyukov Jun 23, 2022
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

3 participants