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/pprof: deadlock during signal handler #2051

krasin opened this issue Jul 8, 2011 · 4 comments

runtime/pprof: deadlock during signal handler #2051

krasin opened this issue Jul 8, 2011 · 4 comments


Copy link

krasin commented Jul 8, 2011

What steps will reproduce the problem?
1. Get the source file (attached)
2. 6g lala.go && 6l lala.6 && ./lala
3. With high probability, you'll get a hang.

If I connect to the program from gdb, I see the following stacktrace:

(gdb) bt
#0  runtime.futex () at /home/krasin/go/src/pkg/runtime/linux/amd64/sys.s:164
#1  0x0000000000412dd9 in futexsleep (addr=void, val=void) at
#2  0x0000000000412f1d in futexlock (l=void) at
#3  0x0000000000413045 in runtime.lock (l=void) at
#4  0x0000000000412a23 in runtime.findfunc (addr=void) at
#5  0x0000000000413689 in runtime.gentraceback (pc0=void, sp=void, g=void, skip=void,
pcbuf=void, max=void) at /home/krasin/go/src/pkg/runtime/amd64/traceback.c:79
#6  0x000000000040f120 in runtime.sigprof (pc=void, sp=void, lr=void, gp=void) at
#7  0x0000000000410a0b in runtime.sighandler (sig=void, info=void, context=void,
gp=void) at /home/krasin/go/src/pkg/runtime/linux/amd64/signal.c:65
#8  0x0000000000412c32 in runtime.sigtramp () at
#9  0x0000000000412c46 in runtime.sigignore () at
#10 0x0000000000000001 in ?? ()
#11 0x0000000000000000 in ?? ()

It seems like a deadlock between append slice and profiler.
If you removed profiler or will do some I/O during the calculations, you'll unlikely get
a problem.

Which compiler are you using (5g, 6g, 8g, gccgo)?


Which operating system are you using?

Ubuntu 11.04 64 bit

Which revision are you using?  (hg identify)

krasin@krasin7:~/go/src$ hg identify
989b9018b05c tip

Please provide any additional information below.

The processor is
Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz

I will also test this bug on other hardware.


  1. lala.go (336 bytes)
Copy link

krasin commented Jul 8, 2011

Comment 1:

Yeah, I've got absolutely the same behavior on Linode Xen instance.

Copy link

robpike commented Jul 9, 2011

Comment 2:

Owner changed to @rsc.

Status changed to Accepted.

Copy link

rsc commented Jul 29, 2011

Comment 3:

The deadlock happens if the signal comes in and 
findfunc needs to create the tables.

Copy link

rsc commented Jul 29, 2011

Comment 4:

This issue was closed by revision bed7e3e.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

4 participants