On Tuesday, April 3, 2018 at 4:50:36 PM UTC+2, Dave Cheney wrote:
>
> I’ve not seen that problem before. I’d hazard a guess that it’s an
> incorrect go installation. Don’t set goroot, basically ever. But it’s just
> a guess.
>
It is basically problem when I run in docker container. This is sample
program.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
package main
import (
"os"
"runtime/pprof"
"runtime"
"fmt"
)
func main() {
f,_ :=os.Create("./ipcore_blocking.prof")
runtime.SetBlockProfileRate(1)
defer func() {
if err := pprof.Lookup("block").WriteTo(f,0); err !=nil
{
fmt.Printf("blocking profiler statistic collecition
initialization failed: %v", err)
}
f.Close()
runtime.SetBlockProfileRate(0)
}()
// create new channel of type int
ch := make(chan int)
// start new anonymous goroutine
go func() {
// send 42 to channel
ch <- 42
}()
// read from channel
<-ch
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
When I run localhost, it workes well. when I tries to run docker container,
it didnt work. I can give my dockerfile here.
FROM golang:1.9-alpine as dev
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
RUN apk add --no-cache --repository
http://dl-3.alpinelinux.org/alpine/edge/community upx
WORKDIR /go/src/project
COPY ./main.go /go/src/project
RUN go build -o /bin/project
FROM scratch
COPY --from=dev /bin/project /bin/project
ENTRYPOINT ["/bin/project"]
+++++++++++++++++++++++++++++++++++++++++++++++++
I have another problem when I run in Docker with CPU profile.
In this case where to report the issues?
Best regards
Sothy
>
> Are you able to create a stand alone program that demonstrates the issue
> with the profile? Please consider raising a bug, golang.org/issue/new
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.