Re: [go-nuts] Recommendation for Fuzzed Types without Native On-Disk Format

2021-02-09 Thread 'Axel Wagner' via golang-nuts
I don't have a really good answer for you, but just in case it helps, I asked a loosely related question on Twitter once: https://twitter.com/TheMerovius/status/1068459958256246784 It's a different problem, but maybe some of the follow-up links can still help? In any case, please let me know if

[go-nuts] Is it possible to embed generic structs with go2go?

2021-02-09 Thread Kristian Aadalen
First of all, I hope this is an appropriate place to ask this question, please let me know if it's not. I wonder if it is possible to use composition and embed a generic struct (with go2go of course)? I wan’t to do something like this, where I try to embed a generic struct to another generic

Re: [go-nuts] efence and changing the read-validity of memory pages on darwin/amd64

2021-02-09 Thread 'Evan Jones' via golang-nuts
I just spent a solid day debugging memory corruption with a Cgo library that was passing a pointer as uintptr, which failed in rare cases when the stack was copied then overwritten. The GODEBUG=efence=1 flag actually made the bug go away ... unless you make the Goroutine stacks big enough to

Re: [go-nuts] ParseInt confusion

2021-02-09 Thread jsievers
Jochen Voss writes: > Dear all, > > The command strconv.ParseInt("256", 8, 8) should not return an error, > because octal 256 is decimal 174 which fits into 8 bits. Right? Not unless the int is unsigned. > > I'm asking, because actually running this command gives > 'strconv.ParseInt: parsing

[go-nuts] Unable to find small memory leak

2021-02-09 Thread Miles Hex
Hi, I'm using golang (1.15.6) to write a daemon that handle system task(network, time, updates, etc..) in embedded device (an onion omega 2+), and i'm encountering a small memory leak that i'm unable to identify and fix. The device is using linux 4.14.171, the architecture is mips. At

[go-nuts] cas ABA problem?

2021-02-09 Thread xie cui
https://github.com/golang/go/blob/master/src/runtime/proc.go#L5926 how the cas in this line avoid ABA problem? -- 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

[go-nuts] Re: Unable to find small memory leak

2021-02-09 Thread Uli Kunitz
GODEBUG=allocfreetrace may be what you are looking for. You might want to check the output with sort | uniq -c. On Tuesday, February 9, 2021 at 8:05:23 PM UTC+1 Miles Hex wrote: > > Hi, > > I'm using golang (1.15.6) to write a daemon that handle system > task(network, time, updates, etc..) in

[go-nuts] Re: Is it possible to embed generic structs with go2go?

2021-02-09 Thread 'Carla Pfaff' via golang-nuts
It seems to be this issue: https://github.com/golang/go/issues/40814 -- 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

[go-nuts] Re: Unable to find small memory leak

2021-02-09 Thread Uli Kunitz
It is GODEBUG=allocfreetrace=1 . Documentation for GODEBUG can be found here: https://pkg.go.dev/runtime On Tuesday, February 9, 2021 at 8:39:27 PM UTC+1 Uli Kunitz wrote: > GODEBUG=allocfreetrace may be what you are looking for. You might want to > check the output with sort | uniq -c. > > On

[go-nuts] Re: Recommendation for Fuzzed Types without Native On-Disk Format

2021-02-09 Thread Tamás Gulácsi
Use the []byte slice to fill your Table, and use the simplest possible encoding, which uses as few constraints as possible: 1. Attrs on a line, separated by space, k-v separated by colon; 2. Each Entry on a separate line, have the fields encoded as in 1. 3. Decide how often do you want to

[go-nuts] Re: [generics] notes on adding generics to a package

2021-02-09 Thread Ben Burkert
Thanks for reading! > One question: did you consider using data []*T in the buffer? If so, > what made you discount it? It seems a natural way to indicate "empty" > slots in the slice. I didn't consider using a []*T at the outset because I assumed that the Buffer type would still need to be

Re: [go-nuts] ParseInt confusion

2021-02-09 Thread Jochen Voss
Oh, yes, thank you and sorry about the noise! On Tuesday, 9 February 2021 at 17:02:41 UTC ja...@kastelo.net wrote: > An int8 has a range of -128 to +127. You may be looking for > strconv.ParseUint if you want an 8 bit unsigned int? > > //jb > > On 9 Feb 2021, at 17:51, Jochen Voss wrote: > >

[go-nuts] ParseInt confusion

2021-02-09 Thread Jochen Voss
Dear all, The command strconv.ParseInt("256", 8, 8) should not return an error, because octal 256 is decimal 174 which fits into 8 bits. Right? I'm asking, because actually running this command gives 'strconv.ParseInt: parsing "256": value out of range'! https://play.golang.org/p/gNKN0kKLfDd

Re: [go-nuts] ParseInt confusion

2021-02-09 Thread Jakob Borg
An int8 has a range of -128 to +127. You may be looking for strconv.ParseUint if you want an 8 bit unsigned int? //jb On 9 Feb 2021, at 17:51, Jochen Voss mailto:jochen.v...@gmail.com>> wrote: Dear all, The command strconv.ParseInt("256", 8, 8) should not return an error, because octal 256

[go-nuts] Re: Unable to find small memory leak

2021-02-09 Thread Miles Hex
Thank you, tomorrow i will try it! Do you know if it possible to enable it without changing the enviroment variable? My application is started by another one and i can't (easily) change the enviroment variables. On Tuesday, February 9, 2021 at 8:57:36 PM UTC+1 Uli Kunitz wrote: > It is

[go-nuts] Re: Unable to find small memory leak

2021-02-09 Thread Uli Kunitz
I looked at your data again. Are you sure that you have a memory leak? According to the heap dump you have less reachable objects after 7 days than before. The reachable object size is in both cases 1.6 MByte. The live heap is a little bit larger than seven days before, but is probably caused

[go-nuts] Golang can be a foundation project? #44184

2021-02-09 Thread 文以载道博学多能
Hello , today , the Rust foundation complete setup. I wonder to know how do google think about golang. Can it be setup an opensource foundation to contribute golang as well? I can see Google also backed up with Rust lang. -- You received this message because you are subscribed to the Google

[go-nuts] Re: Golang can be a foundation project? #44184

2021-02-09 Thread 文以载道博学多能
https://github.com/golang/go/issues/44184 文以载道博学多能 在 2021年2月10日 星期三上午7:53:18 [UTC+8] 的信中寫道: > Hello , today , the Rust foundation complete setup. > I wonder to know how do google think about golang. > Can it be setup an opensource foundation to contribute golang as well? > > I can see Google

Re: [go-nuts] efence and changing the read-validity of memory pages on darwin/amd64

2021-02-09 Thread 'Keith Randall' via golang-nuts
On Tuesday, February 9, 2021 at 11:05:23 AM UTC-8 Evan Jones wrote: > I just spent a solid day debugging memory corruption with a Cgo library > that was passing a pointer as uintptr, which failed in rare cases when the > stack was copied then overwritten. The GODEBUG=efence=1 flag actually

Re: [go-nuts] cas ABA problem?

2021-02-09 Thread Ian Lance Taylor
On Tue, Feb 9, 2021 at 11:18 AM xie cui wrote: > > https://github.com/golang/go/blob/master/src/runtime/proc.go#L5926 > how the cas in this line avoid ABA problem? The ABA problem occurs if some thread compares the value to A, and then a different thread changes the value to B and then changes

[go-nuts] Re: Is it possible to embed generic structs with go2go?

2021-02-09 Thread Kristian Aadalen
Aha. Thanks a lot! tirsdag 9. februar 2021 kl. 20:40:58 UTC+1 skrev Carla Pfaff: > It seems to be this issue: https://github.com/golang/go/issues/40814 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop