Re: [go-nuts] Crash using gccheckmark=1, possible GC bug?

2023-08-18 Thread Tibor Halter
Ah reflect.StructOf! I totally missed that, that was the missing piece. Thanks for the detailed response Ian, much appreciated. Tibor On Friday, August 18, 2023 at 11:06:27 PM UTC+2 Ian Lance Taylor wrote: > On Fri, Aug 18, 2023 at 8:12 AM Tibor Halter wrote: > > > > Hi El

Re: [go-nuts] Crash using gccheckmark=1, possible GC bug?

2023-08-18 Thread Tibor Halter
("v[%X]", *numVal.ptr) } } var sink any func escape(x any) { sink = x sink = nil } On Friday, August 18, 2023 at 5:12:18 PM UTC+2 Tibor Halter wrote: > Hi Elias, thanks for chiming in! > > > The Go garbage collector is precise in that it only considers pointers > whe

Re: [go-nuts] Crash using gccheckmark=1, possible GC bug?

2023-08-18 Thread Tibor Halter
uct-like memory layout dynamically, that contains a mix of pointer and non-pointer types, in a way that is supported by the GC? (This is what I'm trying to do.) On Friday, August 18, 2023 at 3:49:03 PM UTC+2 ma...@eliasnaur.com wrote: > On Friday, 18 August 2023 at 05:57:38 UTC-6 Tibor H

Re: [go-nuts] Crash using gccheckmark=1, possible GC bug?

2023-08-18 Thread Tibor Halter
I am testing on Go 1.21.0, Linux, amd64 On Friday, August 18, 2023 at 1:57:38 PM UTC+2 Tibor Halter wrote: > Thanks Ian! > > I have managed to strip it down to its essence, see code below. > > *Summary of what I'm doing* > - reserve memory with make([]byte) > - get p

Re: [go-nuts] Crash using gccheckmark=1, possible GC bug?

2023-08-18 Thread Tibor Halter
mMemSize) sliceDataPtr := unsafe.Pointer(unsafe.SliceData(b)) (*Num)(sliceDataPtr).numData = &n runtime.GC() act := (*Num)(sliceDataPtr).numData if *act != 123456789 { t.Fatalf("v[%X]", *act) } } On Friday, August 18, 2023 at 2:59:46 AM UTC+2 Ian Lance Taylor wrote: > On Thu, A

[go-nuts] Crash using gccheckmark=1, possible GC bug?

2023-08-17 Thread Tibor Halter
Hi! I get this crash when using the GODEBUG option gccheckmark=1: runtime: marking free object 0xc0016c5668 found at *(0xc0046ca8e0+0x8) base=0xc0046ca8e0 s.base()=0xc0046ca000 s.limit=0xc0046cc000 s.spanclass=8 s.elemsize=32 s.state=mSpanInUse *(base+0) = 0x15e11f0 *(base+8) = 0xc0016c5668 <=