Re: [go-nuts] How does stack overflow handles in gollvm

2021-06-24 Thread 'Than McIntosh' via golang-nuts
Hello, If you go into your LLVM IR dump and look at the place where the function is defined, you'll see a reference to an attribute set, e.g. define void @main.foo(i8* nest %nest.1) #0 !dbg !16 { Here "#0" refers to this attribute set (appearing later in the dump): attributes #0 = {

Re: [go-nuts] How does stack overflow handles in gollvm

2021-06-23 Thread Kavindu Gimhan Zoysa
Hi Kurtis, Thank you for your input. I am searching how do languages handle stack overflow. Languages like rust, handle this by catching SIGSEGV. In golang, as I found, it was handled by increasing the stack[1], [2] (Sorry if my terms are wrong). I have generated object dump(objdump -d) for

Re: [go-nuts] How does stack overflow handles in gollvm

2021-06-23 Thread Kurtis Rader
This might be an XY Problem , or your question simply needs more context. Your sample program is an example of infinite recursion. How that is detected is platform specific. It might be done via a special signal. Or it might be done by a syscall to grow the stack returning

[go-nuts] How does stack overflow handles in gollvm

2021-06-23 Thread Kavindu Gimhan Zoysa
Hi all, *package main* *func main() {* * foo()* *}* *func foo() {* * a := 5* * _ = a* * foo()* *}* I have generated the below llvm ir using the command `./bin/llvm-goc -S test.go -dump-ir`. I expected there are some llvm intrinsics that have been used to handle stack overflow. But it is not