Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggml assert hook #701

Closed
wants to merge 3 commits into from
Closed

Conversation

Cyberhan123
Copy link
Contributor

@Cyberhan123 Cyberhan123 commented Jan 18, 2024

Hello, @slaren @ggerganov , if you have time, please give your suggestions.
When I was writing the desktop version of stable-diffusion.cpp, I encountered many situations where the program crashed due to the abort of GGML_ASSERT. Even though there was no error in the desktop program, it was just user input errors. I tracked the historical issues: #123

I found that this is an ambitious plan, but it is too complicated for ggml. I want to add a behavior hook only for GGML_ASSERT. While ensuring the default behavior, it also allows users to customize the behavior.

For c++ users, they can use throw And catch the exception, release the memory and restore the program.

For C users, they can use the C exception library to hook, or they can implement their own exception mechanism through
by longjump.

It will also be friendly to golang users like me. I can use try catch in stable-diffusion.cpp to manage exceptions, and then pass errors by exposing methods like sd_get_latest_err().

To be honest, I am not good at c/c++, so I don’t want to expand the scope of implementation. I want to leave the remaining thinking space to the community. Can we add a GGML_ERROR method, and then refine the error, and Eliminate the coexistence of assert and GGML_ASSERT in the library, and gradually convert from GGML_ASSERT to GGML_ERROR, so that we can avoid hard-coding error messages or having to look at the code and line number of assertions.

I have collected the related questions below:

ggerganov/llama.cpp#4627

ggerganov/llama.cpp#4385

If the program is aborted, it is not allowed to be put on the windows store. see detail:https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/abort?view=msvc-170

@slaren
Copy link
Collaborator

slaren commented Jan 18, 2024

ggml needs better error handling, but when a GGML_ASSERT fails, the program is likely to be in an irrecoverable state the only thing that can be done is to end the program. It would be ok to add a callback so that the program can get the error and log or print it in some other way, but the abort at the end must remain.

If you have a program that absolutely must never end with an abort, the only solution right now would be to run ggml in a different process.

@Cyberhan123
Copy link
Contributor Author

ggml needs better error handling, but when a GGML_ASSERT fails, the program is likely to be in an irrecoverable state the only thing that can be done is to end the program. It would be ok to add a callback so that the program can get the error and log or print it in some other way, but the abort at the end must remain.

If you have a program that absolutely must never end with an abort, the only solution right now would be to run ggml in a different process.

I don't agree with this. For example, in stable-diffusion, I can try catch each model, and then reallocate memory and initialize it. Compared with abort, we can try catch globally in our own program and restart the program. This is better than abort.

@Cyberhan123
Copy link
Contributor Author

Cyberhan123 commented Jan 18, 2024

If we want to maintain the abort logic, I would rather force the abort logic to be maintained in the debug stage. However, once we reach the release stage, we still need to have recovery measures. Otherwise, we will have to spend a lot of energy to open a daemon process, and these performances are originally used for inferential.

@slaren
Copy link
Collaborator

slaren commented Jan 18, 2024

Well, this is not a matter of opinion, a failed GGML_ASSERT means that a pre-condition assumed by the code was not met, and as a result the program may be in any state. Furthermore, the code following the GGML_ASSERT assumes that the assert didn't fail, and running it will only cause the state to be corrupted even more. The only thing that can be done in this case is to end the program.

To be clear,I agree that we need better error handling in ggml, asserts should be used only to detect logical errors in ggml, but as it is right now, this is just the way it is.

@Cyberhan123
Copy link
Contributor Author

I have read the previous history, and I know the purpose of ggml's current ASSERT, so I retained the original logic in the code, and this hook is only left to those who think carefully and know how to handle them.If you think it's not possible, do you have any better measures?

@slaren
Copy link
Collaborator

slaren commented Jan 18, 2024

There are a few things you can do to minimize the chance of hitting an assert:

  • Verify the user inputs before passing them to ggml
  • Common errors such as GPU memory allocation failures should not result in an assert. If there are any of these cases remaining, fix it and open a PR, or let us know so that we can fix it
  • Ultimately, if calling abort is never ok, the only way to avoid this is to run the ggml code in a different process and handle it in any way you want if the process crashes (tell the user, restart the process, use a different model, etc).

@Cyberhan123
Copy link
Contributor Author

I need to show you the hell I encountered. This is very scary for me at the moment. Since golang has a defer recover mechanism, a segmentation fault is received and the program should exit, but it enters suspended animation and does not know how to recover.

DEB | /Users/cyberhan/development/stable-diffusion/models/mysd.safetensors
SIGSEGV: segmentation violation
PC=0x14db84ad0 m=8 sigcode=2
signal arrived during cgo execution

goroutine 244 [syscall]:
runtime.cgocall(0x100a81190, 0x140004fc000)
        /usr/local/go/src/runtime/cgocall.go:157 +0x44 fp=0x140000d17a0 sp=0x140000d1760 pc=0x10091ae64
github.com/ebitengine/purego.RegisterFunc.func4({0x14000186140, 0xd, 0xd})
        /Users/cyberhan/go/pkg/mod/github.com/ebitengine/[email protected]/func.go:272 +0x970 fp=0x140000d1d90 sp=0x140000d17a0 pc=0x100a7e450
reflect.callReflect(0x140002127e0, 0x140001f85b8, 0x140000d2418, 0x140000d2420)
        /usr/local/go/src/reflect/value.go:782 +0x494 fp=0x140000d23c0 sp=0x140000d1d90 pc=0x100a067a4
reflect.callReflect(0x140002127e0, 0x140001f85b8, 0x140001f8418, 0x140001f8420)
        <autogenerated>:1 +0x28 fp=0x140000d23f0 sp=0x140000d23c0 pc=0x100a1b428
reflect.makeFuncStub()
        /usr/local/go/src/reflect/asm_arm64.s:48 +0x58 fp=0x140000d25b0 sp=0x140000d23f0 pc=0x100a15c78
github.com/seasonjs/stable-diffusion.(*CStableDiffusionImpl).ImagePredictImage(0x1400021c230, 0x1400040c768, {0x100, 0x100, 0x3, {0x14000646000, 0x30000, 0x30000}}, {0x140000107a0, 0xc}, ...)
        /Users/cyberhan/go/pkg/mod/github.com/seasonjs/[email protected]/binding.go:182 +0x128 fp=0x140000d26b0 sp=0x140000d25b0 pc=0x100ad5ba8
github.com/seasonjs/stable-diffusion.(*Model).ImagePredict(0x14000226780, {0x1011bba38, 0x1400040e270}, {0x140000107a0, 0xc}, {{0x0, 0x0}, 0x0, 0x40e00000, 0x100, ...}, ...)
        /Users/cyberhan/go/pkg/mod/github.com/seasonjs/[email protected]/sd.go:233 +0x25c fp=0x140000d28f0 sp=0x140000d26b0 pc=0x100ad7cbc
main.(*App).PredictImage(0x1400018a9c0, {0x14000408060, 0x21}, {0x140000107a0, 0xc}, {{0x0, 0x0}, 0x0, 0x40e00000, 0x100, ...})
        /Users/cyberhan/development/stable-diffusion-desktop/app.go:134 +0x324 fp=0x140000d2b50 sp=0x140000d28f0 pc=0x100f23384
runtime.call256(0x1400040e1e0, 0x14000058168, 0x0, 0x0, 0x0, 0x90, 0x140000d3580)
        /usr/local/go/src/runtime/asm_arm64.s:482 +0x80 fp=0x140000d2c60 sp=0x140000d2b50 pc=0x10097ff90
runtime.reflectcall(0x0?, 0x8?, 0x8?, 0x25e140?, 0x140?, 0x12?, 0x101199ea0?)
        <autogenerated>:1 +0x34 fp=0x140000d2ca0 sp=0x140000d2c60 pc=0x100985044
reflect.Value.call({0x101191260, 0x1400018a9c0, 0x1a13}, {0x100f36178, 0x4}, {0x140000322d0, 0x3, 0x3})
        /usr/local/go/src/reflect/value.go:596 +0x9e8 fp=0x140000d3710 sp=0x140000d2ca0 pc=0x100a051f8
reflect.Value.Call({0x101191260, 0x1400018a9c0, 0x1a13}, {0x140000322d0, 0x3, 0x3})
        /usr/local/go/src/reflect/value.go:380 +0x74 fp=0x140000d3790 sp=0x140000d3710 pc=0x100a046c4
github.com/wailsapp/wails/v2/internal/binding.(*BoundMethod).Call(0x140000de3f0, {0x1400040e060, 0x3, 0x3})
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/binding/boundMethod.go:72 +0x31c fp=0x140000d3a50 sp=0x140000d3790 pc=0x100e5731c
github.com/wailsapp/wails/v2/internal/frontend/dispatcher.(*Dispatcher).processCallMessage(0x1400009a5c0, {0x140000dc140, 0x129}, {0x1011c3140, 0x1400009c7e0})
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/dispatcher/calls.go:45 +0x414 fp=0x140000d3d70 sp=0x140000d3a50 pc=0x100f19164
github.com/wailsapp/wails/v2/internal/frontend/dispatcher.(*Dispatcher).ProcessMessage(0x1400009a5c0, {0x140000dc140, 0x129}, {0x1011c3140, 0x1400009c7e0})
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/dispatcher/dispatcher.go:43 +0x18c fp=0x140000d3ec0 sp=0x140000d3d70 pc=0x100f19cbc
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).processMessage.func1()
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:381 +0x70 fp=0x140000d3fd0 sp=0x140000d3ec0 pc=0x100e6f070
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000d3fd0 sp=0x140000d3fd0 pc=0x100981d24
created by github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).processMessage in goroutine 23
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:380 +0x4d0

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x100f27de0, 0x1400072bd38)
        /usr/local/go/src/runtime/cgocall.go:157 +0x44 fp=0x1400072bd00 sp=0x1400072bcc0 pc=0x10091ae64
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin._Cfunc_RunMainLoop()
        _cgo_gotypes.go:563 +0x30 fp=0x1400072bd30 sp=0x1400072bd00 pc=0x100e68f20
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).RunMainLoop(0x1400009c7e0)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:69 +0x20 fp=0x1400072bd40 sp=0x1400072bd30 pc=0x100e6c4c0
github.com/wailsapp/wails/v2/internal/frontend/devserver.(*DevWebServer).RunMainLoop(0x140000b8990)
        <autogenerated>:1 +0x3c fp=0x1400072bd60 sp=0x1400072bd40 pc=0x100f1658c
github.com/wailsapp/wails/v2/internal/app.(*App).Run(0x140000b29b0)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/app/app_dev.go:33 +0x78 fp=0x1400072bdd0 sp=0x1400072bd60 pc=0x100f1f1f8
github.com/wailsapp/wails/v2/pkg/application.(*Application).Run(0x140000750c0)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/pkg/application/application.go:73 +0x180 fp=0x1400072be70 sp=0x1400072bdd0 pc=0x100f22180
github.com/wailsapp/wails/v2.Run(0x14000172160)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/wails.go:14 +0x30 fp=0x1400072beb0 sp=0x1400072be70 pc=0x100f22380
main.main()
        /Users/cyberhan/development/stable-diffusion-desktop/main.go:19 +0x370 fp=0x1400072bf50 sp=0x1400072beb0 pc=0x100f25d70
runtime.main()
        /usr/local/go/src/runtime/proc.go:267 +0x244 fp=0x1400072bfd0 sp=0x1400072bf50 pc=0x1009518d4
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x1400072bfd0 sp=0x1400072bfd0 pc=0x100981d24

goroutine 2 [force gc (idle), 3 minutes]:
runtime.gopark(0x1011b8c08, 0x1018f1490, 0x11, 0x14, 0x1)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000054f70 sp=0x14000054f40 pc=0x100951d30
runtime.goparkunlock(0x0?, 0x0?, 0x0?, 0x0?)
        /usr/local/go/src/runtime/proc.go:404 +0x34 fp=0x14000054fa0 sp=0x14000054f70 pc=0x100951dc4
runtime.forcegchelper()
        /usr/local/go/src/runtime/proc.go:322 +0xb4 fp=0x14000054fd0 sp=0x14000054fa0 pc=0x100951b54
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000054fd0 sp=0x14000054fd0 pc=0x100981d24
created by runtime.init.6 in goroutine 1
        /usr/local/go/src/runtime/proc.go:310 +0x24

goroutine 18 [GC sweep wait]:
runtime.gopark(0x1011b8c08, 0x1018f1ba0, 0xc, 0x14, 0x1)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000050730 sp=0x14000050700 pc=0x100951d30
runtime.goparkunlock(0x1?, 0x0?, 0x0?, 0x0?)
        /usr/local/go/src/runtime/proc.go:404 +0x34 fp=0x14000050760 sp=0x14000050730 pc=0x100951dc4
runtime.bgsweep(0x0?)
        /usr/local/go/src/runtime/mgcsweep.go:321 +0xdc fp=0x140000507b0 sp=0x14000050760 pc=0x10093cf4c
runtime.gcenable.func1()
        /usr/local/go/src/runtime/mgc.go:200 +0x28 fp=0x140000507d0 sp=0x140000507b0 pc=0x100931d58
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000507d0 sp=0x140000507d0 pc=0x100981d24
created by runtime.gcenable in goroutine 1
        /usr/local/go/src/runtime/mgc.go:200 +0x6c

goroutine 19 [GC scavenge wait]:
runtime.gopark(0x1011b8c08, 0x1018f24e0, 0xd, 0x14, 0x2)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000050f20 sp=0x14000050ef0 pc=0x100951d30
runtime.goparkunlock(0x1e536db7?, 0x5a?, 0x5c?, 0x0?)
        /usr/local/go/src/runtime/proc.go:404 +0x34 fp=0x14000050f50 sp=0x14000050f20 pc=0x100951dc4
runtime.(*scavengerState).park(0x1018f24e0)
        /usr/local/go/src/runtime/mgcscavenge.go:425 +0x4c fp=0x14000050f80 sp=0x14000050f50 pc=0x10093a3dc
runtime.bgscavenge(0x0?)
        /usr/local/go/src/runtime/mgcscavenge.go:658 +0x60 fp=0x14000050fb0 sp=0x14000050f80 pc=0x10093a930
runtime.gcenable.func2()
        /usr/local/go/src/runtime/mgc.go:201 +0x28 fp=0x14000050fd0 sp=0x14000050fb0 pc=0x100931cf8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000050fd0 sp=0x14000050fd0 pc=0x100981d24
created by runtime.gcenable in goroutine 1
        /usr/local/go/src/runtime/mgc.go:201 +0xac

goroutine 3 [finalizer wait, 3 minutes]:
runtime.gopark(0x1011b8948, 0x1019333a0, 0x10, 0x14, 0x1)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000054580 sp=0x14000054550 pc=0x100951d30
runtime.runfinq()
        /usr/local/go/src/runtime/mfinal.go:193 +0xf0 fp=0x140000547d0 sp=0x14000054580 pc=0x100930f40
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000547d0 sp=0x140000547d0 pc=0x100981d24
created by runtime.createfing in goroutine 1
        /usr/local/go/src/runtime/mfinal.go:163 +0x4c

goroutine 22 [chan receive, 3 minutes]:
runtime.gopark(0x1011b88e8, 0x140001905f8, 0xe, 0x17, 0x2)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x140000516a0 sp=0x14000051670 pc=0x100951d30
runtime.chanrecv(0x140001905a0, 0x14000051798, 0x1)
        /usr/local/go/src/runtime/chan.go:583 +0x27c fp=0x14000051720 sp=0x140000516a0 pc=0x10091cc1c
runtime.chanrecv2(0x140000b60a0?, 0x1011c11f8?)
        /usr/local/go/src/runtime/chan.go:447 +0x14 fp=0x14000051750 sp=0x14000051720 pc=0x10091c984
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).startRequestProcessor(0x1400009c7e0)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:154 +0x3c fp=0x140000517b0 sp=0x14000051750 pc=0x100e6d5dc
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend.func1()
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:114 +0x2c fp=0x140000517d0 sp=0x140000517b0 pc=0x100e6d23c
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000517d0 sp=0x140000517d0 pc=0x100981d24
created by github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend in goroutine 1
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:114 +0x848

goroutine 24 [chan receive, 3 minutes]:
runtime.gopark(0x1011b88e8, 0x140001a2058, 0xe, 0x17, 0x2)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x140000526a0 sp=0x14000052670 pc=0x100951d30
runtime.chanrecv(0x140001a2000, 0x14000052778, 0x1)
        /usr/local/go/src/runtime/chan.go:583 +0x27c fp=0x14000052720 sp=0x140000526a0 pc=0x10091cc1c
runtime.chanrecv2(0x0?, 0x0?)
        /usr/local/go/src/runtime/chan.go:447 +0x14 fp=0x14000052750 sp=0x14000052720 pc=0x10091c984
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).startCallbackProcessor(0x1400009c7e0)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:160 +0x38 fp=0x140000527b0 sp=0x14000052750 pc=0x100e6d678
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend.func3()
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:118 +0x2c fp=0x140000527d0 sp=0x140000527b0 pc=0x100e6d17c
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000527d0 sp=0x140000527d0 pc=0x100981d24
created by github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend in goroutine 1
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:118 +0x914

goroutine 23 [chan receive]:
runtime.gopark(0x1011b88e8, 0x14000190598, 0xe, 0x17, 0x2)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000069ea0 sp=0x14000069e70 pc=0x100951d30
runtime.chanrecv(0x14000190540, 0x14000069f98, 0x1)
        /usr/local/go/src/runtime/chan.go:583 +0x27c fp=0x14000069f20 sp=0x14000069ea0 pc=0x10091cc1c
runtime.chanrecv2(0x1400009c7e0?, 0x140000dc140?)
        /usr/local/go/src/runtime/chan.go:447 +0x14 fp=0x14000069f50 sp=0x14000069f20 pc=0x10091c984
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).startMessageProcessor(0x1400009c7e0)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:148 +0x3c fp=0x14000069fb0 sp=0x14000069f50 pc=0x100e6d53c
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend.func2()
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:117 +0x2c fp=0x14000069fd0 sp=0x14000069fb0 pc=0x100e6d1dc
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000069fd0 sp=0x14000069fd0 pc=0x100981d24
created by github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend in goroutine 1
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:117 +0x8b0

goroutine 25 [chan receive, 3 minutes]:
runtime.gopark(0x1011b88e8, 0x14000190658, 0xe, 0x17, 0x2)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000052ea0 sp=0x14000052e70 pc=0x100951d30
runtime.chanrecv(0x14000190600, 0x14000052f98, 0x1)
        /usr/local/go/src/runtime/chan.go:583 +0x27c fp=0x14000052f20 sp=0x14000052ea0 pc=0x10091cc1c
runtime.chanrecv2(0x0?, 0x0?)
        /usr/local/go/src/runtime/chan.go:447 +0x14 fp=0x14000052f50 sp=0x14000052f20 pc=0x10091c984
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).startFileOpenProcessor(0x1400009c7e0)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:127 +0x3c fp=0x14000052fb0 sp=0x14000052f50 pc=0x100e6d2ac
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend.func4()
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:119 +0x2c fp=0x14000052fd0 sp=0x14000052fb0 pc=0x100e6d11c
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000052fd0 sp=0x14000052fd0 pc=0x100981d24
created by github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend in goroutine 1
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:119 +0x978

goroutine 26 [chan receive, 3 minutes]:
runtime.gopark(0x1011b88e8, 0x140001906b8, 0xe, 0x17, 0x2)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x140000536a0 sp=0x14000053670 pc=0x100951d30
runtime.chanrecv(0x14000190660, 0x14000053798, 0x1)
        /usr/local/go/src/runtime/chan.go:583 +0x27c fp=0x14000053720 sp=0x140000536a0 pc=0x10091cc1c
runtime.chanrecv2(0x0?, 0x0?)
        /usr/local/go/src/runtime/chan.go:447 +0x14 fp=0x14000053750 sp=0x14000053720 pc=0x10091c984
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).startUrlOpenProcessor(0x1400009c7e0)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:133 +0x3c fp=0x140000537b0 sp=0x14000053750 pc=0x100e6d34c
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend.func5()
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:120 +0x2c fp=0x140000537d0 sp=0x140000537b0 pc=0x100e6d0bc
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000537d0 sp=0x140000537d0 pc=0x100981d24
created by github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend in goroutine 1
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:120 +0x9dc

goroutine 27 [chan receive, 3 minutes]:
runtime.gopark(0x1011b88e8, 0x14000190718, 0xe, 0x17, 0x2)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000053e60 sp=0x14000053e30 pc=0x100951d30
runtime.chanrecv(0x140001906c0, 0x14000053f80, 0x1)
        /usr/local/go/src/runtime/chan.go:583 +0x27c fp=0x14000053ee0 sp=0x14000053e60 pc=0x10091cc1c
runtime.chanrecv2(0x0?, 0x0?)
        /usr/local/go/src/runtime/chan.go:447 +0x14 fp=0x14000053f10 sp=0x14000053ee0 pc=0x10091c984
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).startSecondInstanceProcessor(0x1400009c7e0)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:139 +0x48 fp=0x14000053fb0 sp=0x14000053f10 pc=0x100e6d3f8
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend.func6()
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:121 +0x2c fp=0x14000053fd0 sp=0x14000053fb0 pc=0x100e6d05c
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000053fd0 sp=0x14000053fd0 pc=0x100981d24
created by github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend in goroutine 1
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:121 +0xa40

goroutine 28 [select, 3 minutes, locked to thread]:
runtime.gopark(0x1011b8c70, 0x0, 0x9, 0x18, 0x1)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x140000f85f0 sp=0x140000f85c0 pc=0x100951d30
runtime.selectgo(0x140000f87a0, 0x140000f8798, 0x0?, 0x0, 0x0?, 0x1)
        /usr/local/go/src/runtime/select.go:327 +0x77c fp=0x140000f8740 sp=0x140000f85f0 pc=0x10096188c
runtime.ensureSigM.func1()
        /usr/local/go/src/runtime/signal_unix.go:1014 +0x10c fp=0x140000f87d0 sp=0x140000f8740 pc=0x1009789cc
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000f87d0 sp=0x140000f87d0 pc=0x100981d24
created by runtime.ensureSigM in goroutine 1
        /usr/local/go/src/runtime/signal_unix.go:997 +0xd8

goroutine 35 [syscall, 3 minutes]:
runtime.sigNoteSleep(0x1011c0270)
        /usr/local/go/src/runtime/os_darwin.go:124 +0x20 fp=0x14000055780 sp=0x14000055740 pc=0x10094c310
os/signal.signal_recv()
        /usr/local/go/src/runtime/sigqueue.go:149 +0x2c fp=0x140000557a0 sp=0x14000055780 pc=0x10097dd3c
os/signal.loop()
        /usr/local/go/src/os/signal/signal_unix.go:23 +0x24 fp=0x140000557d0 sp=0x140000557a0 pc=0x100f216f4
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000557d0 sp=0x140000557d0 pc=0x100981d24
created by os/signal.Notify.func1.1 in goroutine 1
        /usr/local/go/src/os/signal/signal.go:151 +0x34

goroutine 5 [chan receive, 3 minutes]:
runtime.gopark(0x1011b88e8, 0x1400010e178, 0xe, 0x17, 0x2)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000055ed0 sp=0x14000055ea0 pc=0x100951d30
runtime.chanrecv(0x1400010e120, 0x0, 0x1)
        /usr/local/go/src/runtime/chan.go:583 +0x27c fp=0x14000055f50 sp=0x14000055ed0 pc=0x10091cc1c
runtime.chanrecv1(0x0?, 0x0?)
        /usr/local/go/src/runtime/chan.go:442 +0x14 fp=0x14000055f80 sp=0x14000055f50 pc=0x10091c964
github.com/wailsapp/wails/v2/internal/signal.Start.func1()
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/signal/signal.go:31 +0x28 fp=0x14000055fd0 sp=0x14000055f80 pc=0x100f21ca8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000055fd0 sp=0x14000055fd0 pc=0x100981d24
created by github.com/wailsapp/wails/v2/internal/signal.Start in goroutine 1
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/signal/signal.go:30 +0xe0

goroutine 6 [IO wait, 3 minutes]:
runtime.gopark(0x1011b8be8, 0x14879ce58, 0x2, 0x1b, 0x5)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000211360 sp=0x14000211330 pc=0x100951d30
runtime.netpollblock(0x14879ce38, 0x72, 0x0)
        /usr/local/go/src/runtime/netpoll.go:564 +0xb8 fp=0x140002113a0 sp=0x14000211360 pc=0x10094b348
internal/poll.runtime_pollWait(0x1011bbe98?, 0x72)
        /usr/local/go/src/runtime/netpoll.go:343 +0x44 fp=0x140002113d0 sp=0x140002113a0 pc=0x10097bf54
internal/poll.(*pollDesc).wait(0x14000220120, 0x72, 0x0)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x84 fp=0x14000211420 sp=0x140002113d0 pc=0x100a30014
internal/poll.(*pollDesc).waitRead(0x14000220120, 0x0)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 +0x34 fp=0x14000211470 sp=0x14000211420 pc=0x100a300a4
internal/poll.(*FD).Accept(0x14000220100)
        /usr/local/go/src/internal/poll/fd_unix.go:611 +0x36c fp=0x14000211700 sp=0x14000211470 pc=0x100a35a6c
net.(*netFD).accept(0x14000220100)
        /usr/local/go/src/net/fd_unix.go:172 +0x48 fp=0x140002118a0 sp=0x14000211700 pc=0x100bec598
net.(*TCPListener).accept(0x14000236060)
        /usr/local/go/src/net/tcpsock_posix.go:152 +0x44 fp=0x14000211940 sp=0x140002118a0 pc=0x100c124f4
net.(*TCPListener).AcceptTCP(0x14000236060)
        /usr/local/go/src/net/tcpsock.go:302 +0x4c fp=0x140002119e0 sp=0x14000211940 pc=0x100c104ec
github.com/labstack/echo/v4.tcpKeepAliveListener.Accept({0x14000236060})
        /Users/cyberhan/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:989 +0x38 fp=0x14000211a70 sp=0x140002119e0 pc=0x100efb888
github.com/labstack/echo/v4.(*tcpKeepAliveListener).Accept(0x14000216018)
        <autogenerated>:1 +0x54 fp=0x14000211af0 sp=0x14000211a70 pc=0x100f06694
net/http.(*onceCloseListener).Accept(0x140002121e0)
        <autogenerated>:1 +0x50 fp=0x14000211b70 sp=0x14000211af0 pc=0x100d891b0
net/http.(*Server).Serve(0x140000f0000, {0x1011c0040, 0x14000216018})
        /usr/local/go/src/net/http/server.go:3056 +0x3d4 fp=0x14000211e80 sp=0x14000211b70 pc=0x100d57484
github.com/labstack/echo/v4.(*Echo).Start(0x140000d46c0, {0x140000280ea, 0xf})
        /Users/cyberhan/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:686 +0x130 fp=0x14000211f10 sp=0x14000211e80 pc=0x100ef8d30
github.com/wailsapp/wails/v2/internal/frontend/devserver.(*DevWebServer).Run.func3(0x140000d46c0, 0x1400000e948)
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/devserver/devserver.go:117 +0x48 fp=0x14000211f90 sp=0x14000211f10 pc=0x100f12e58
github.com/wailsapp/wails/v2/internal/frontend/devserver.(*DevWebServer).Run.func4()
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/devserver/devserver.go:122 +0x48 fp=0x14000211fd0 sp=0x14000211f90 pc=0x100f12dd8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000211fd0 sp=0x14000211fd0 pc=0x100981d24
created by github.com/wailsapp/wails/v2/internal/frontend/devserver.(*DevWebServer).Run in goroutine 1
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/devserver/devserver.go:116 +0xb88

goroutine 63 [IO wait, 3 minutes]:
runtime.gopark(0x1011b8be8, 0x14879c980, 0x2, 0x1b, 0x5)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x1400020d300 sp=0x1400020d2d0 pc=0x100951d30
runtime.netpollblock(0x14879c960, 0x72, 0x0)
        /usr/local/go/src/runtime/netpoll.go:564 +0xb8 fp=0x1400020d340 sp=0x1400020d300 pc=0x10094b348
internal/poll.runtime_pollWait(0x1b?, 0x72)
        /usr/local/go/src/runtime/netpoll.go:343 +0x44 fp=0x1400020d370 sp=0x1400020d340 pc=0x10097bf54
internal/poll.(*pollDesc).wait(0x140002204a0, 0x72, 0x0)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x84 fp=0x1400020d3c0 sp=0x1400020d370 pc=0x100a30014
internal/poll.(*pollDesc).waitRead(0x140002204a0, 0x0)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 +0x34 fp=0x1400020d410 sp=0x1400020d3c0 pc=0x100a300a4
internal/poll.(*FD).Read(0x14000220480, {0x140002ec000, 0x8000, 0x8000})
        /usr/local/go/src/internal/poll/fd_unix.go:164 +0x308 fp=0x1400020d5a0 sp=0x1400020d410 pc=0x100a317f8
net.(*netFD).Read(0x14000220480, {0x140002ec000, 0x8000, 0x8000})
        /usr/local/go/src/net/fd_posix.go:55 +0x54 fp=0x1400020d630 sp=0x1400020d5a0 pc=0x100bea014
net.(*conn).Read(0x14000412040, {0x140002ec000, 0x8000, 0x8000})
        /usr/local/go/src/net/net.go:179 +0x6c fp=0x1400020d6e0 sp=0x1400020d630 pc=0x100c0415c
net.(*TCPConn).Read(0x14000412040, {0x140002ec000, 0x8000, 0x8000})
        <autogenerated>:1 +0x58 fp=0x1400020d760 sp=0x1400020d6e0 pc=0x100c22ad8
net/http.(*readWriteCloserBody).Read(0x140002c4198, {0x140002ec000, 0x8000, 0x8000})
        /usr/local/go/src/net/http/transport.go:2406 +0x184 fp=0x1400020d810 sp=0x1400020d760 pc=0x100d76724
io.copyBuffer({0x1011bccd8, 0x140002b0420}, {0x2900c0188, 0x140002c4198}, {0x140002ec000, 0x8000, 0x8000})
        /usr/local/go/src/io/io.go:430 +0x314 fp=0x1400020d9c0 sp=0x1400020d810 pc=0x1009966c4
io.Copy({0x1011bccd8, 0x140002b0420}, {0x2900c0188, 0x140002c4198})
        /usr/local/go/src/io/io.go:389 +0x58 fp=0x1400020da50 sp=0x1400020d9c0 pc=0x1009961f8
net.genericReadFrom({0x1011bce58, 0x140002160d8}, {0x2900c0188, 0x140002c4198})
        /usr/local/go/src/net/net.go:671 +0x78 fp=0x1400020dae0 sp=0x1400020da50 pc=0x100c06a38
net.(*TCPConn).readFrom(0x140002160d8, {0x2900c0188, 0x140002c4198})
        /usr/local/go/src/net/tcpsock_posix.go:54 +0x164 fp=0x1400020dbd0 sp=0x1400020dae0 pc=0x100c118c4
net.(*TCPConn).ReadFrom(0x140002160d8, {0x2900c0188, 0x140002c4198})
        /usr/local/go/src/net/tcpsock.go:130 +0x60 fp=0x1400020dc80 sp=0x1400020dbd0 pc=0x100c0f080
io.copyBuffer({0x1011bce58, 0x140002160d8}, {0x2900c0188, 0x140002c4198}, {0x0, 0x0, 0x0})
        /usr/local/go/src/io/io.go:416 +0x18c fp=0x1400020de30 sp=0x1400020dc80 pc=0x10099653c
io.Copy({0x1011bce58, 0x140002160d8}, {0x2900c0188, 0x140002c4198})
        /usr/local/go/src/io/io.go:389 +0x58 fp=0x1400020dec0 sp=0x1400020de30 pc=0x1009961f8
net/http/httputil.switchProtocolCopier.copyFromBackend({{0x2900c0138, 0x140002160d8}, {0x2900c0160, 0x140002c4198}}, 0x140002a67e0)
        /usr/local/go/src/net/http/httputil/reverseproxy.go:794 +0xa4 fp=0x1400020df70 sp=0x1400020dec0 pc=0x100da8af4
net/http/httputil.(*ReverseProxy).handleUpgradeResponse.func5()
        /usr/local/go/src/net/http/httputil/reverseproxy.go:783 +0x5c fp=0x1400020dfd0 sp=0x1400020df70 pc=0x100da87bc
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x1400020dfd0 sp=0x1400020dfd0 pc=0x100981d24
created by net/http/httputil.(*ReverseProxy).handleUpgradeResponse in goroutine 38
        /usr/local/go/src/net/http/httputil/reverseproxy.go:783 +0xb54

goroutine 62 [IO wait]:
runtime.gopark(0x1011b8be8, 0x14879ca78, 0x2, 0x1b, 0x5)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000401820 sp=0x140004017f0 pc=0x100951d30
runtime.netpollblock(0x14879ca58, 0x72, 0x0)
        /usr/local/go/src/runtime/netpoll.go:564 +0xb8 fp=0x14000401860 sp=0x14000401820 pc=0x10094b348
internal/poll.runtime_pollWait(0x1a?, 0x72)
        /usr/local/go/src/runtime/netpoll.go:343 +0x44 fp=0x14000401890 sp=0x14000401860 pc=0x10097bf54
internal/poll.(*pollDesc).wait(0x140002203a0, 0x72, 0x0)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x84 fp=0x140004018e0 sp=0x14000401890 pc=0x100a30014
internal/poll.(*pollDesc).waitRead(0x140002203a0, 0x0)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 +0x34 fp=0x14000401930 sp=0x140004018e0 pc=0x100a300a4
internal/poll.(*FD).Read(0x14000220380, {0x14000330000, 0x8000, 0x8000})
        /usr/local/go/src/internal/poll/fd_unix.go:164 +0x308 fp=0x14000401ac0 sp=0x14000401930 pc=0x100a317f8
net.(*netFD).Read(0x14000220380, {0x14000330000, 0x8000, 0x8000})
        /usr/local/go/src/net/fd_posix.go:55 +0x54 fp=0x14000401b50 sp=0x14000401ac0 pc=0x100bea014
net.(*conn).Read(0x140002160d8, {0x14000330000, 0x8000, 0x8000})
        /usr/local/go/src/net/net.go:179 +0x6c fp=0x14000401c00 sp=0x14000401b50 pc=0x100c0415c
net.(*TCPConn).Read(0x140002160d8, {0x14000330000, 0x8000, 0x8000})
        <autogenerated>:1 +0x58 fp=0x14000401c80 sp=0x14000401c00 pc=0x100c22ad8
io.copyBuffer({0x2900c0068, 0x140002c4198}, {0x2900fffb0, 0x140002160d8}, {0x14000330000, 0x8000, 0x8000})
        /usr/local/go/src/io/io.go:430 +0x314 fp=0x14000401e30 sp=0x14000401c80 pc=0x1009966c4
io.Copy({0x2900c0068, 0x140002c4198}, {0x2900fffb0, 0x140002160d8})
        /usr/local/go/src/io/io.go:389 +0x58 fp=0x14000401ec0 sp=0x14000401e30 pc=0x1009961f8
net/http/httputil.switchProtocolCopier.copyToBackend({{0x2900c0138, 0x140002160d8}, {0x2900c0160, 0x140002c4198}}, 0x140002a67e0)
        /usr/local/go/src/net/http/httputil/reverseproxy.go:799 +0xa4 fp=0x14000401f70 sp=0x14000401ec0 pc=0x100da8c14
net/http/httputil.(*ReverseProxy).handleUpgradeResponse.func4()
        /usr/local/go/src/net/http/httputil/reverseproxy.go:782 +0x5c fp=0x14000401fd0 sp=0x14000401f70 pc=0x100da884c
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000401fd0 sp=0x14000401fd0 pc=0x100981d24
created by net/http/httputil.(*ReverseProxy).handleUpgradeResponse in goroutine 38
        /usr/local/go/src/net/http/httputil/reverseproxy.go:782 +0xa74

goroutine 61 [select, 3 minutes]:
runtime.gopark(0x1011b8c70, 0x0, 0x9, 0x18, 0x1)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000400db0 sp=0x14000400d80 pc=0x100951d30
runtime.selectgo(0x14000400fa8, 0x140000f4f50, 0x0?, 0x0, 0x0?, 0x1)
        /usr/local/go/src/runtime/select.go:327 +0x77c fp=0x14000400f00 sp=0x14000400db0 pc=0x10096188c
net/http/httputil.(*ReverseProxy).handleUpgradeResponse.func1()
        /usr/local/go/src/net/http/httputil/reverseproxy.go:754 +0xac fp=0x14000400fd0 sp=0x14000400f00 pc=0x100da89fc
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000400fd0 sp=0x14000400fd0 pc=0x100981d24
created by net/http/httputil.(*ReverseProxy).handleUpgradeResponse in goroutine 38
        /usr/local/go/src/net/http/httputil/reverseproxy.go:751 +0x474

goroutine 38 [chan receive, 3 minutes]:
runtime.gopark(0x1011b88e8, 0x140002a6838, 0xe, 0x17, 0x2)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x140001f4880 sp=0x140001f4850 pc=0x100951d30
runtime.chanrecv(0x140002a67e0, 0x0, 0x1)
        /usr/local/go/src/runtime/chan.go:583 +0x27c fp=0x140001f4900 sp=0x140001f4880 pc=0x10091cc1c
runtime.chanrecv1(0x140002ae1c0?, 0x1?)
        /usr/local/go/src/runtime/chan.go:442 +0x14 fp=0x140001f4930 sp=0x140001f4900 pc=0x10091c964
net/http/httputil.(*ReverseProxy).handleUpgradeResponse(0x14000032460, {0x1011bfa70, 0x14000226960}, 0x14000238400, 0x140002ce3f0)
        /usr/local/go/src/net/http/httputil/reverseproxy.go:784 +0xb60 fp=0x140001f4dd0 sp=0x140001f4930 pc=0x100da8550
net/http/httputil.(*ReverseProxy).ServeHTTP(0x14000032460, {0x1011bfa70, 0x14000226960}, 0x14000238100)
        /usr/local/go/src/net/http/httputil/reverseproxy.go:484 +0xd28 fp=0x140001f5430 sp=0x140001f4dd0 pc=0x100da58f8
github.com/wailsapp/wails/v2/internal/frontend/devserver.(*DevWebServer).Run.func2({0x1011c32d8, 0x1400050a000})
        /Users/cyberhan/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/devserver/devserver.go:107 +0xc0 fp=0x140001f54a0 sp=0x140001f5430 pc=0x100f12fc0
github.com/labstack/echo/v4.(*Echo).add.func1({0x1011c32d8, 0x1400050a000})
        /Users/cyberhan/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:582 +0x74 fp=0x140001f5520 sp=0x140001f54a0 pc=0x100ef7fd4
github.com/labstack/echo/v4.(*Echo).ServeHTTP(0x140000d46c0, {0x1011bf708, 0x14000506000}, 0x14000238100)
        /Users/cyberhan/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:669 +0x210 fp=0x140001f5620 sp=0x140001f5520 pc=0x100ef8a10
net/http.serverHandler.ServeHTTP({0x140000f0000}, {0x1011bf708, 0x14000506000}, 0x14000238100)
        /usr/local/go/src/net/http/server.go:2938 +0x2a0 fp=0x140001f5670 sp=0x140001f5620 pc=0x100d56e10
net/http.(*conn).serve(0x14000244360, {0x1011c0270, 0x1400021c320})
        /usr/local/go/src/net/http/server.go:2009 +0x155c fp=0x140001f5f90 sp=0x140001f5670 pc=0x100d521dc
net/http.(*Server).Serve.func3()
        /usr/local/go/src/net/http/server.go:3086 +0x40 fp=0x140001f5fd0 sp=0x140001f5f90 pc=0x100d57940
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140001f5fd0 sp=0x140001f5fd0 pc=0x100981d24
created by net/http.(*Server).Serve in goroutine 6
        /usr/local/go/src/net/http/server.go:3086 +0x7f8

goroutine 75 [GC worker (idle)]:
runtime.gopark(0x1011b8968, 0x14000420100, 0x1a, 0x14, 0x0)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x140000f5720 sp=0x140000f56f0 pc=0x100951d30
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1293 +0xd8 fp=0x140000f57d0 sp=0x140000f5720 pc=0x1009334c8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000f57d0 sp=0x140000f57d0 pc=0x100981d24
created by runtime.gcBgMarkStartWorkers in goroutine 146
        /usr/local/go/src/runtime/mgc.go:1217 +0x28

goroutine 74 [GC worker (idle)]:
runtime.gopark(0x1011b8968, 0x1400034c0c0, 0x1a, 0x14, 0x0)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x140000f8f20 sp=0x140000f8ef0 pc=0x100951d30
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1293 +0xd8 fp=0x140000f8fd0 sp=0x140000f8f20 pc=0x1009334c8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140000f8fd0 sp=0x140000f8fd0 pc=0x100981d24
created by runtime.gcBgMarkStartWorkers in goroutine 146
        /usr/local/go/src/runtime/mgc.go:1217 +0x28

goroutine 147 [GC worker (idle), 3 minutes]:
runtime.gopark(0x1011b8968, 0x140006ac020, 0x1a, 0x14, 0x0)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000318720 sp=0x140003186f0 pc=0x100951d30
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1293 +0xd8 fp=0x140003187d0 sp=0x14000318720 pc=0x1009334c8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140003187d0 sp=0x140003187d0 pc=0x100981d24
created by runtime.gcBgMarkStartWorkers in goroutine 146
        /usr/local/go/src/runtime/mgc.go:1217 +0x28

goroutine 163 [GC worker (idle), 3 minutes]:
runtime.gopark(0x1011b8968, 0x14000730000, 0x1a, 0x14, 0x0)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000714720 sp=0x140007146f0 pc=0x100951d30
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1293 +0xd8 fp=0x140007147d0 sp=0x14000714720 pc=0x1009334c8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140007147d0 sp=0x140007147d0 pc=0x100981d24
created by runtime.gcBgMarkStartWorkers in goroutine 146
        /usr/local/go/src/runtime/mgc.go:1217 +0x28

goroutine 164 [GC worker (idle), 3 minutes]:
runtime.gopark(0x1011b8968, 0x1400034c080, 0x1a, 0x14, 0x0)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000714f20 sp=0x14000714ef0 pc=0x100951d30
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1293 +0xd8 fp=0x14000714fd0 sp=0x14000714f20 pc=0x1009334c8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000714fd0 sp=0x14000714fd0 pc=0x100981d24
created by runtime.gcBgMarkStartWorkers in goroutine 146
        /usr/local/go/src/runtime/mgc.go:1217 +0x28

goroutine 165 [GC worker (idle), 3 minutes]:
runtime.gopark(0x1011b8968, 0x14000628020, 0x1a, 0x14, 0x0)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000715720 sp=0x140007156f0 pc=0x100951d30
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1293 +0xd8 fp=0x140007157d0 sp=0x14000715720 pc=0x1009334c8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140007157d0 sp=0x140007157d0 pc=0x100981d24
created by runtime.gcBgMarkStartWorkers in goroutine 146
        /usr/local/go/src/runtime/mgc.go:1217 +0x28

goroutine 178 [GC worker (idle), 3 minutes]:
runtime.gopark(0x1011b8968, 0x1400034c0a0, 0x1a, 0x14, 0x0)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000056f20 sp=0x14000056ef0 pc=0x100951d30
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1293 +0xd8 fp=0x14000056fd0 sp=0x14000056f20 pc=0x1009334c8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000056fd0 sp=0x14000056fd0 pc=0x100981d24
created by runtime.gcBgMarkStartWorkers in goroutine 146
        /usr/local/go/src/runtime/mgc.go:1217 +0x28

goroutine 179 [GC worker (idle), 3 minutes]:
runtime.gopark(0x1011b8968, 0x14000628040, 0x1a, 0x14, 0x0)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000710720 sp=0x140007106f0 pc=0x100951d30
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1293 +0xd8 fp=0x140007107d0 sp=0x14000710720 pc=0x1009334c8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140007107d0 sp=0x140007107d0 pc=0x100981d24
created by runtime.gcBgMarkStartWorkers in goroutine 146
        /usr/local/go/src/runtime/mgc.go:1217 +0x28

goroutine 166 [GC worker (idle)]:
runtime.gopark(0x1011b8968, 0x14000628060, 0x1a, 0x14, 0x0)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000715f20 sp=0x14000715ef0 pc=0x100951d30
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1293 +0xd8 fp=0x14000715fd0 sp=0x14000715f20 pc=0x1009334c8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000715fd0 sp=0x14000715fd0 pc=0x100981d24
created by runtime.gcBgMarkStartWorkers in goroutine 146
        /usr/local/go/src/runtime/mgc.go:1217 +0x28

goroutine 167 [GC worker (idle)]:
runtime.gopark(0x1011b8968, 0x14000420120, 0x1a, 0x14, 0x0)
        /usr/local/go/src/runtime/proc.go:398 +0xe0 fp=0x14000716720 sp=0x140007166f0 pc=0x100951d30
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1293 +0xd8 fp=0x140007167d0 sp=0x14000716720 pc=0x1009334c8
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x140007167d0 sp=0x140007167d0 pc=0x100981d24
created by runtime.gcBgMarkStartWorkers in goroutine 146
        /usr/local/go/src/runtime/mgc.go:1217 +0x28

r0      0x14dc6cdb0
r1      0x0
r2      0x2efb70020
r3      0x1
r4      0x1
r5      0x1
r6      0x1
r7      0x1
r8      0xcc0ea9fdfcee00c3
r9      0x1
r10     0xb
r11     0x805
r12     0x160360000
r13     0x20
r14     0x7fb
r15     0xc18418f8
r16     0x188c49320
r17     0x1e84685d0
r18     0x0
r19     0x2efb70020
r20     0x0
r21     0x1
r22     0x1
r23     0x1
r24     0x1
r25     0x1
r26     0x1
r27     0x172e4adf8
r28     0x0
r29     0x172e4aaa0
lr      0x14db84e5c
sp      0x172e4aa00
pc      0x14db84ad0
fault   0x20

@Cyberhan123
Copy link
Contributor Author

What's even more helpless is that I can't catch any errors at all.

@ggerganov
Copy link
Owner

@Cyberhan123 What kind of errors do you want to handle in ggml? I'm failing to see a meaningful use case:

  • If your tensors are the wrong shape, this a problem of the user app - not ggml, so no error handling is necessary
  • If your data is corrupt or invalid, again - not a ggml problem
  • If ggml works incorrectly - this is a bug and has to be fixed, not handled

Think about ggml as something that allows you to compute 2+2. You don't need to handle errors - it will always compute the result and return it.

If Microsoft is scanning for abort in the applications, the best we can do is a compile-time flag to remove abort() calls which would make MS happy, but will obviously lead to corrupted states and crashes when ggml is used incorrectly

@Cyberhan123
Copy link
Contributor Author

It's a very simple idea. I can get the intended error when calling the language through golang. The above error is actually a simple setting problem. I found it through gdb tracking. For stable-diffusion.cpp, it is needed in image generation. When img2img, set vae_decode_only to false, but I found that the process is indeed very difficult. I even need to go into binary memory to track.
@ggerganov I admit that you are very powerful programmers, But it’s a bit unfriendly for an ordinary developer like me, although it allowed me to learn a lot of low-level knowledge.

@Cyberhan123
Copy link
Contributor Author

Cyberhan123 commented Jan 18, 2024

And when we use common app, there are often many serious errors. As a person with experience in developing for mass users, my usual approach is to try xxx catch, report to the log and then restore the program, pretending that nothing happened. The app is very friendly to people who don’t know programming, and we can improve it through logs. As a console program, it can of course be aborted. But what if you are using an Apple app?

@Cyberhan123
Copy link
Contributor Author

So the problem is that the assumption of abort makes the program too strict. As a developer, I cannot guarantee that the coding is completely error-free, so that the tensor entered in ggml is also perfect. I and the developers who have invested a lot of energy Including you, there is nothing wrong. If your suggestion is to start a daemon process, then I can only accept it.

@slaren
Copy link
Collaborator

slaren commented Jan 18, 2024

I think that it is very important to do proper error handling for application developers to be able to use ggml in production software. The software should never crash except for purely logical errors within ggml. Currently, ggml does not have a framework to report errors to the user. The only way we have to report an error in some functions is by returning NULL, but that's not enough information for the user to debug the issue. Some functions do not return a value that can be checked for errors, and in these cases we cannot even report an error to the user, all we can do is crash.

At some point, we will approach a "ggml 1.0" release and we will need to address this and other issues, but we are not there yet. I think that running the ggml code as a daemon in a different process is the best solution at the moment.

@Cyberhan123
Copy link
Contributor Author

Glad you can reply, I think reporting log is not something done by ggml library, it should be done by llama.cpp, of course it is up to you to decide. I also hope that ggml can have a better error handling mechanism. Thank you for your selfless dedication, which allows me to use ai on the amd gpu of windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants