Re: [go-nuts] query for runtime.reportZombies data race PoC code

2024-11-20 Thread Ian Lance Taylor
On Tue, Nov 19, 2024 at 3:50 AM Lin Lin wrote: > > Thanks for your kind and instant reply. > > Allow me to explain myself a bit more. > > My code has two kinds of data races. First one is a global struct without any > pointer member being written and read by multiple Goroutines. Second one is a

Re: [go-nuts] query for runtime.reportZombies data race PoC code

2024-11-19 Thread Lin Lin
Thanks for your kind and instant reply. Allow me to explain myself a bit more. My code has two kinds of data races. First one is a global struct without any pointer member being written and read by multiple Goroutines. Second one is a struct's string member being written and read by multiple Gour

Re: [go-nuts] query for runtime.reportZombies data race PoC code

2024-11-19 Thread Lin Lin
Ian, thanks for your explanation, it really shed light on that for me. I certainly will fix the data race. Thanks to all for your time. On Tue, 19 Nov 2024 at 22:46, Ian Lance Taylor wrote: > On Tue, Nov 19, 2024 at 3:50 AM Lin Lin wrote: > > > > Thanks for your kind and instant reply. > > > >

Re: [go-nuts] query for runtime.reportZombies data race PoC code

2024-11-19 Thread Robert Engels
As I shared, ANY data race can lead to a panic. You can be interfering with the GC object tracking. I agree with you that it seems not possible, but I was surprised to learn that it is. It is not the case in Java as there are assignment guarantees even without concurrency - but the data race can ca

Re: [go-nuts] query for runtime.reportZombies data race PoC code

2024-11-18 Thread Kurtis Rader
On Mon, Nov 18, 2024 at 10:06 PM Lin Lin wrote: > Yes, I do agree that it's easy to write data race code. > Sorry, I didn't make it clear. I have the data race report, my concerning > is to prove the relation bewteen data race and the crash.The code I want is > actually that can trigger a runtim

Re: [go-nuts] query for runtime.reportZombies data race PoC code

2024-11-18 Thread robert engels
Any data race can cause a crash anywhere, see https://go.dev/doc/articles/race_detector so you need to fix the data races. As for the reasons, from Google Gemini (looks accurate): Yes, a Go data race can definitely cause a runtime crash. Here's why: Undefined Behavior: When two or more goroutine

Re: [go-nuts] query for runtime.reportZombies data race PoC code

2024-11-18 Thread Lin Lin
Yes, I do agree that it's easy to write data race code. Sorry, I didn't make it clear. I have the data race report, my concerning is to prove the relation bewteen data race and the crash.The code I want is actually that can trigger a runtime reportZombies crash. On Tuesday, 19 November 2024 at

Re: [go-nuts] query for runtime.reportZombies data race PoC code

2024-11-18 Thread Kurtis Rader
Your question is not clear. You seem to be saying you have a program that fails for a reason that might be a data race. Have you built and run your program with race detection enabled? If you do so the resulting race detection traceback should provide a clue regarding the nature of the race suffici

[go-nuts] query for runtime.reportZombies data race PoC code

2024-11-18 Thread Lin Lin
Hi, gophers Quite a few issues like https://github.com/golang/go/issues/47513 are caused by DATA RACE. I myselft also ran into one in Go1.17, and data race can be found in the code. But I'm unable to reproduce the issue stably, as I need to some PoC code to make the managers to believe it's cau