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

fix panic: divide by zero #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simakvladimir
Copy link

Hi, thx for the great tool!

Problem

In production we use fgprof + alloy + pyroscope. Sometimes we catch panic:

runtime error: integer divide by zero\ngoroutine 11398149 [running]:\nnet/http.(*conn).serve.func1()\n\t/usr/local/go/src/net/http/server.go:1854 +0xbf\npanic({0x15b3320, 0x260a9b0})\n\t/usr/local/go/src/runtime/panic.go:890 +0x263\ngithub.com/felixge/fgprof.(*wallclockProfile).exportPprof(0xc013442a00, 0x0, {0xc000100000?, 0xc015015020?, 0x262e600?}, {0xc005ccd540?, 0x40e007?, 0x262e600?})\n\t/go/src/app/vendor/github.com/felixge/fgprof/fgprof.go:220

Same problem described here.

Panic reproduced in tests when stop called straight after start without sleep.

Possible solution

Check pprof sampling rate on zero before exportPprof calling.

@simakvladimir simakvladimir changed the title fix panic: divide on zero fix panic: divide by zero Sep 4, 2024
check pprof sampling rate on zero before exportPprof calling
@simakvladimir
Copy link
Author

simakvladimir commented Sep 25, 2024

@felixge sorry to interrupt, but could you review PR, please?

@chif84
Copy link

chif84 commented Oct 23, 2024

Same error. Pls fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants