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

Closed
krasin opened this issue Jul 8, 2011 · 4 comments
Closed

runtime/pprof: deadlock during signal handler #2051

krasin opened this issue Jul 8, 2011 · 4 comments

Comments

@krasin
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
/home/krasin/go/src/pkg/runtime/linux/thread.c:52
#2  0x0000000000412f1d in futexlock (l=void) at
/home/krasin/go/src/pkg/runtime/linux/thread.c:120
#3  0x0000000000413045 in runtime.lock (l=void) at
/home/krasin/go/src/pkg/runtime/linux/thread.c:159
#4  0x0000000000412a23 in runtime.findfunc (addr=void) at
/home/krasin/go/src/pkg/runtime/symtab.c:423
#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
/home/krasin/go/src/pkg/runtime/proc.c:1313
#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
/home/krasin/go/src/pkg/runtime/linux/amd64/sys.s:105
#9  0x0000000000412c46 in runtime.sigignore () at
/home/krasin/go/src/pkg/runtime/linux/amd64/sys.s:114
#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)?

6g

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.

Attachments:

  1. lala.go (336 bytes)
@krasin
Copy link
Author

krasin commented Jul 8, 2011

Comment 1:

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

@robpike
Copy link
Contributor

robpike commented Jul 9, 2011

Comment 2:

Owner changed to @rsc.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jul 29, 2011

Comment 3:

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

@rsc
Copy link
Contributor

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.
Projects
None yet
Development

No branches or pull requests

4 participants