[go-nuts] directory name and module name not same, go tool pprof, list function faild
hi, i create a project, directory name and module name not same, and i profile it , use list command to print code and profile, it tips me not find the file, how to make it works? macbookpro:tejia_analysis fredlee$ go tool pprof http://ip:6065/debug/pprof/heap Fetching profile over HTTP from http://ip:6065/debug/pprof/heap Saved profile in /Users/fredlee/pprof/pprof.tejia_analysis.alloc_objects.alloc_space.inuse_objects.inuse_space.006.pb.gz File: tejia_analysis Type: inuse_space Time: Jul 30, 2020 at 2:03pm (CST) Entering interactive mode (type "help" for commands, "o" for options) (pprof) top20 -cum Showing nodes accounting for 2509.12MB, 98.97% of 2535.11MB total Dropped 37 nodes (cum <= 12.68MB) flat flat% sum%cum cum% 0 0% 0% 2533.11MB 99.92% app_server/util.(*Analysis).Job 0 0% 0% 2533.11MB 99.92% app_server/util.(*Analysis).Start 1007.72MB 39.75% 39.75% 2523.10MB 99.53% app_server/util.(*Analysis).LoadSearchLog 0 0% 39.75% 1466.37MB 57.84% go.mongodb.org/mongo-driver/bson.(*Decoder).Decode 0 0% 39.75% 1466.37MB 57.84% go.mongodb.org/mongo-driver/bson.UnmarshalWithRegistry 0 0% 39.75% 1466.37MB 57.84% go.mongodb.org/mongo-driver/bson.unmarshalFromReader 0 0% 39.75% 1466.37MB 57.84% go.mongodb.org/mongo-driver/bson/bsoncodec.(*StructCodec).DecodeValue 0 0% 39.75% 1466.37MB 57.84% go.mongodb.org/mongo-driver/mongo.(*Cursor).Decode (inline) 0 0% 39.75% 1457.37MB 57.49% go.mongodb.org/mongo-driver/bson/bsoncodec.(*StringCodec).DecodeValue 0 0% 39.75% 1457.37MB 57.49% go.mongodb.org/mongo-driver/bson/bsonrw.(*valueReader).ReadString 1457.37MB 57.49% 97.24% 1457.37MB 57.49% go.mongodb.org/mongo-driver/bson/bsonrw.(*valueReader).readString 0 0% 97.24%44.03MB 1.74% net/url.ParseQuery (inline) 44.03MB 1.74% 98.97%44.03MB 1.74% net/url.parseQuery (pprof) list LoadSearchLog Total: 2.48GB ROUTINE app_server/util.(*Analysis).LoadSearchLog in app_server/util/analysis.go 1007.72MB 2.46GB (flat, cum) 99.53% of Total Error: could not find file app_server/util/analysis.go on path /Users/fredlee/Documents/tool/tejia_analysis -- 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/ccdf226f-5e9b-4818-805c-d275b669e120n%40googlegroups.com.
[go-nuts] strconv.ParseFloat panic
i check my code, and strconv.ParseFloat(s, 64), s is a string, it is correct, but after run my program for a while, it's panic and report some output info. i cant't find why , anyone can help me output infor: panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4a2654] goroutine 2948735 [running]: strconv.special(0x0, 0x4, 0x0, 0x3ff2e147ae147ae1, 0x1) strconv/atof.go:48 +0x34 strconv.atof64(0x0, 0x4, 0x41421d, 0xc05323c380, 0xc05dd95ab0, 0xa) strconv/atof.go:612 +0x50 strconv.parseFloatPrefix(0x0, 0x4, 0x40, 0x3, 0xc078741b48, 0xc05dd95ab0, 0xc078741b40) strconv/atof.go:695 +0x95 strconv.ParseFloat(0x0, 0x4, 0x40, 0xa, 0xc078741bc8, 0xc05dd95a01) strconv/atof.go:683 +0x45 xx/api.handleDPriceRange(0xc01777c820) xx/api/PriceCalendar.go:1008 +0x212 xx/api.priceCalendarItemExpand(0xc016e34a80, 0xc96, 0xc96) xx/api/PriceCalendar.go:1104 +0xb9b xx/api.FlightlineRT(0xc001bd9d98, 0xc0002294f0, 0x1306020, 0xc04f1415c0, 0xc05e653a70, 0x1c000229518, 0xc05193dc00) xx/api/external_api.go:146 +0x108 xx/api.aaa.func2(0xc04f1456b0, 0xc04f102340, 0xc05d23aa68, 0x3, 0xc05465c230, 0x63, 0xc04f13c301, 0x7, 0x0, 0x0, ...) xx/api/external_api.go:343 +0x25b created by xx/api.AppMainpage xx/api/external_api.go:330 +0x57e -- 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/9c672d72-7daa-4fe1-9f84-136c2eaa2065n%40googlegroups.com.
Re: [go-nuts] strconv.ParseFloat panic
go version is 1.15 , cross compile on darwin and run on linux, i will try to run with race deector 在2020年11月6日星期五 UTC+8 下午4:34:21 写道: > The full panic would help, but somehow you have a string with a nil > pointer that is 4 bytes long. Where is the string generated? Are you > using Cgo? Have you run with the race detector? Also, what version of > Go are you using? > > On Fri, 2020-11-06 at 00:00 -0800, blade...@gmail.com wrote: > > i check my code, and strconv.ParseFloat(s, 64), s is a string, it is > > correct, but after run my program for a while, it's panic and report > > some output info. i cant't find why , anyone can help me > > > > > > output infor: > > panic: runtime error: invalid memory address or nil pointer > > dereference > > [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 > > pc=0x4a2654] > > > > goroutine 2948735 [running]: > > strconv.special(0x0, 0x4, 0x0, 0x3ff2e147ae147ae1, 0x1) > > strconv/atof.go:48 +0x34 > > strconv.atof64(0x0, 0x4, 0x41421d, 0xc05323c380, 0xc05dd95ab0, 0xa) > > strconv/atof.go:612 +0x50 > > strconv.parseFloatPrefix(0x0, 0x4, 0x40, 0x3, 0xc078741b48, > > 0xc05dd95ab0, 0xc078741b40) > > strconv/atof.go:695 +0x95 > > strconv.ParseFloat(0x0, 0x4, 0x40, 0xa, 0xc078741bc8, 0xc05dd95a01) > > strconv/atof.go:683 +0x45 > > xx/api.handleDPriceRange(0xc01777c820) > > xx/api/PriceCalendar.go:1008 +0x212 > > xx/api.priceCalendarItemExpand(0xc016e34a80, 0xc96, 0xc96) > > xx/api/PriceCalendar.go:1104 +0xb9b > > xx/api.FlightlineRT(0xc001bd9d98, 0xc0002294f0, 0x1306020, > > 0xc04f1415c0, 0xc05e653a70, 0x1c000229518, 0xc05193dc00) > > xx/api/external_api.go:146 +0x108 > > xx/api.aaa.func2(0xc04f1456b0, 0xc04f102340, 0xc05d23aa68, 0x3, > > 0xc05465c230, 0x63, 0xc04f13c301, 0x7, 0x0, 0x0, ...) > > xx/api/external_api.go:343 +0x25b > > created by xx/api.AppMainpage > > xx/api/external_api.go:330 +0x57e > > -- > > 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 golang-nuts...@googlegroups.com. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/golang-nuts/9c672d72-7daa-4fe1-9f84-136c2eaa2065n%40googlegroups.com > > . > > > -- 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/afa99a55-f4ec-46d7-8a5f-fc981953583bn%40googlegroups.com.
Re: [go-nuts] strconv.ParseFloat panic
thanks all, i find a race problem, and fix it. 在2020年11月7日星期六 UTC+8 上午5:28:51 写道: > OK, so you're not using Cgo, that leaves some other unsafe use, a data > race or unlikely some weird compiler bug. > > I'd start looking in api.handleDPriceRange to see where the string > input to strconv.ParseFloat is being constructed. > > On Fri, 2020-11-06 at 01:10 -0800, blade...@gmail.com wrote: > > go version is 1.15 , cross compile on darwin and run on linux, i > > will try to run with race deector > > > > > > > > 在2020年11月6日星期五 UTC+8 下午4:34:21 写道: > > > The full panic would help, but somehow you have a string with a > > > nil > > > pointer that is 4 bytes long. Where is the string generated? Are > > > you > > > using Cgo? Have you run with the race detector? Also, what version > > > of > > > Go are you using? > > > > > > -- 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e0939854-7dea-450e-a1ec-c3985b889cb2n%40googlegroups.com.