Re: [go-nuts] Issue with Adding Exception Vector Handler in Go

2025-01-19 Thread Jason E. Aten
I would strongly advise avoiding unix-signals from CGO. I've done it and can recommend against it (it needs very elaborate signal masking to avoid crashing the Go runtime); it was still very fraught and probably not supported :) Just catch C-side exceptions in C, turn them into strings, pass t

Re: [go-nuts] Issue with Adding Exception Vector Handler in Go

2025-01-19 Thread Robert Engels
After more reading, if you install the vectored exception handler it should work as it can receive the exceptions outside its own stack frames. On Jan 19, 2025, at 7:47 AM, Robert Engels wrote:Read this section: Go handles the exceptions listed otherwise this is the process:Raising an exception c

Re: [go-nuts] Issue with Adding Exception Vector Handler in Go

2025-01-19 Thread Robert Engels
Read this section: Go handles the exceptions listed otherwise this is the process:Raising an exception causes the exception dispatcher to go through the following search for an exception handler:The system first attempts to notify the process's debugger, if any.If the process is not being debugged,

Re: [go-nuts] Issue with Adding Exception Vector Handler in Go

2025-01-19 Thread Robert Engels
You need to install a handler using CGO. When it is not a Go exception it uses “continue” - eventually your handler will be called. You handle it in the native Go and communicate the signal back to Go using a channel of some other means. A lot depends on what you are trying to do and why? Why not j

Re: [go-nuts] Issue with Adding Exception Vector Handler in Go

2025-01-19 Thread rudeus greyrat
I investigated a little bit and got lost :p Basically I raise a windows exception with RaiseException windows API to simulate my exception (https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-raiseexception) >From what I understand, Go search the exception hand