[go-nuts] Current differences between runtime.FuncForPC and runtime.CallersFrames

2025-04-18 Thread 'Diego Molina' via golang-nuts
Hi everyone, I know by reading the docs (and lists, and every resource out there) that the output of runtime.Callers is meant to be used with runtime.CallersFrames, but I'm curious to learn in which cases using FuncForPC with the PCs returned by Callers (minus 1) would produce different result

[go-nuts] Re: Assembler, ABI0 frame & stack growth

2025-04-18 Thread 'Keith Randall' via golang-nuts
Ah, I think I understand what you're getting at. You'll want to read this: https://github.com/golang/go/blob/b44b360dd40a537e953225d70ca96361e2c57600/src/runtime/stack.go#L21 TL;DR the thing the header is checking against isn't the bottom of stack, it is a mark some constant above the bottom. >

[go-nuts] Re: Assembler, ABI0 frame & stack growth

2025-04-18 Thread 'Keith Randall' via golang-nuts
On Thursday, April 17, 2025 at 11:50:18 AM UTC-7 Wojciech Kaczmarek wrote: Hi Gophers, I am experimenting with assembler, ABI0 and stuff. While I was learning the ABI0 frame structure from disassembled code, I noticed that the stack check happens before subtracting from RSP (I'm on arm64, bu

[go-nuts] Re: Should os.WriteFile call Sync()?

2025-04-18 Thread 'Brian Candler' via golang-nuts
On Thursday, 17 April 2025 at 00:10:08 UTC+1 Karel Bílek wrote: I was quite surprised recently that, at least on linux, file.Close() does not guarantee file.Sync(); in some edge-cases, files can be not put properly to filesystem. If the data integrity is critical, it seems better to call file.S