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 mad

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 tr

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

2020-07-13 Thread Ian Lance Taylor
On Mon, Jul 13, 2020 at 6:03 PM Jason E. Aten wrote: > > go1.14.4 / darwin / amd64 > > I'm tracking down an issue where a certain code (not sure where, in large > legacy code) > is touching memory that it should not. > > I thought of the old electric fence technique from C. The electric fence >

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

2020-07-13 Thread Jason E. Aten
go1.14.4 / darwin / amd64 I'm tracking down an issue where a certain code (not sure where, in large legacy code) is touching memory that it should not. I thought of the old electric fence technique from C. The electric fence memory allocator would put each object on its own page on malloc(). T