4 ms·
> but causes completely arbitrary behavior I think we have different definitions of "arbitrary"
by 0x696C6961 2y ago
> but causes completely arbitrary behavior
I think we have different definitions of "arbitrary"
- gf000 2y agoThe moment you go off the memory safe route, you have absolutely no way of ever going back - the best case scenario is that the OS catches your wrong-doing and you get a segfault. Everything else might silently corrupt the runtime's state or business data. As they say, here be dragons.
- judofyr 2y agoPlease elaborate! What's your definition? I was struggling a bit to phrase it precisely. My main point was to distinguish between "well-defined panic" (which is just like any other panic) and "silent memory corruption which keeps the program running". To me it seems rather arbitrary that appending to a slice concurrently in two different goroutines causes the garbage collector's sweep-phase to internally think another allocation has occurred.