Skip to content

6prof sometimes fails on Linux amd64 with "unexpected new tid" when using goroutines #1027

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

Closed
gopherbot opened this issue Aug 13, 2010 · 5 comments

Comments

@gopherbot
Copy link
Contributor

by namegduf:

What steps will reproduce the problem?
1. Copy the following into a file:

package main

import "fmt"

func main() {
        wait := make(chan bool)
        go func() {
                <-wait
                fmt.Printf("Test!")
        }()
        fmt.Println("Hello World!")
}

2. Build the file with 6g file.go; 6l file.go
2. Run 6prof on the output executable

What is the expected output?

The program's own output, follwed by a sample count and profiling output. Absence of
errors.

What do you see instead?

"ptrace waitpid: unexpected new tid <some tid> status 0x137f", followed
by the program's output, followed by the program hanging. No output from 6prof.

What is your $GOOS?  $GOARCH?

GOOS=linux
GOARCH=amd64

Which revision are you using?  (hg identify)

58cc2828bfd2 tip


It seems to work sometimes with even an empty goroutine, but removing the channel seems
to make things inconsistent.
@adg
Copy link
Contributor

adg commented Aug 16, 2010

Comment 1:

adg@quoll:~/test$ 6prof ./6.out 
Hello World!
5 samples (avg 2 threads)
 60.00% clone
 20.00% etext
 20.00% exit
 20.00% futex
It works fine for me on linux/amd64, and (as well as 6prof does) on darwin/amd64.
Is that the correct test program? Is there any other information you can provide?

Status changed to WaitingForReply.

@FlorianUekermann
Copy link
Contributor

Comment 3:

Same problem here on linux/amd64 using the test program above:
florian@FlorianLaptop:...$ $GOBIN/6prof 6.out 
ptrace waitpid: unexpected new tid 14833 status 0x137f
Hello World!
^C
florian@FlorianLaptop:...$
Additional information:
florian@FlorianLaptop:~$ uname -a
Linux FlorianLaptop 2.6.32-5-amd64 #1 SMP Sat Jul 24 01:47:24 UTC 2010 x86_64 GNU/Linux
Do you need any other information.

@gopherbot
Copy link
Contributor Author

Comment 4 by namegduf:

Other information... I'm using the same kernel as the above comment (2.6.32-5),
distribution is Debian Unstable if there's any other variations it causes.
The test program works here, and is not the only program affected. Running 6prof on
godoc causes it, but only (at least only reproducibly) if it starts a listening HTTP
socket, not if simply printing usage information or a single package's documentation to
stdout. I originally found it while attempting to profile a much larger program of my
own.

@FlorianUekermann
Copy link
Contributor

Comment 5:

$ $GOBIN/6prof 6.out 
ptrace waitpid: unexpected new tid 2410 status 0x137f
Hello World!
^C
$ uname -a
Linux FlorianLaptop 2.6.30-2-amd64 #1 SMP Mon Dec 7 05:21:45 UTC 2009 x86_64 GNU/Linux
Same behavior, different kernel. I'm using Debian testing. The same happens, as
mentioned by OP, with every Program using goroutines and channels, using only channels 
works perfectly well. I never tested using a goroutine without channels as the OP did.

@rsc
Copy link
Contributor

rsc commented Sep 11, 2010

Comment 6:

Status changed to Duplicate.

Merged into issue #251.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

4 participants