Repository: ollama
Issue: ggml.c:4044: GGML_ASSERT(view_src == NULL || data_size == 0 || data_size + view_offs <= ggml_nbytes(view_src)) failed
Labels: bug

### What is the issue?

On certain API requests, the server throws a segmentation fault error and the API responds with a HTTP 500. So far, I have encountered this twice in thousands of requests. Unfortunately I do not have the particular prompts that resulted in this logged but I do not expect this to be directly reproducible based on a prompt.

Full stack trace:

```
ggml.c:4044: GGML_ASSERT(view_src == NULL || data_size == 0 || data_size + view_offs <= ggml_nbytes(view_src)) failed
SIGSEGV: segmentation violation
PC=0x7ae06884d1d7 m=4 sigcode=1 addr=0x204803fbc
signal arrived during cgo execution

goroutine 7 gp=0xc000156000 m=4 mp=0xc00004d808 [syscall]:
runtime.cgocall(0x5bb738602e90, 0xc000056b60)
        runtime/cgocall.go:157 +0x4b fp=0xc000056b38 sp=0xc000056b00 pc=0x5bb7383853cb
github.com/ollama/ollama/llama._Cfunc_llama_decode(0x7adfec006460, {0x1, 0x7adfec3acb70, 0x0, 0x0, 0x7adfec3ad380, 0x7adfec3adb90, 0x7adfec17b380, 0x7adfd10c2910,
0x0, ...})
        _cgo_gotypes.go:543 +0x52 fp=0xc000056b60 sp=0xc000056b38 pc=0x5bb738482952
github.com/ollama/ollama/llama.(*Context).Decode.func1(0x5bb7385fed4b?, 0x7adfec006460?)
        github.com/ollama/ollama/llama/llama.go:167 +0xd8 fp=0xc000056c80 sp=0xc000056b60 pc=0x5bb738484e78
github.com/ollama/ollama/llama.(*Context).Decode(0xc000056d68?, 0x1?)
        github.com/ollama/ollama/llama/llama.go:167 +0x17 fp=0xc000056cc8 sp=0xc000056c80 pc=0x5bb738484cd7
main.(*Server).processBatch(0xc000128120, 0xc000126150, 0xc0001261c0)
        github.com/ollama/ollama/llama/runner/runner.go:424 +0x29e fp=0xc000056ed0 sp=0xc000056cc8 pc=0x5bb7385fdd7e
main.(*Server).run(0xc000128120, {0x5bb73893ca40, 0xc00007c050})
        github.com/ollama/ollama/llama/runner/runner.go:338 +0x1a5 fp=0xc000056fb8 sp=0xc000056ed0 pc=0x5bb7385fd765
main.main.gowrap2()
        github.com/ollama/ollama/llama/runner/runner.go:901 +0x28 fp=0xc000056fe0 sp=0xc000056fb8 pc=0x5bb738601ec8
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc000056fe8 sp=0xc000056fe0 pc=0x5bb7383edde1
created by main.main in goroutine 1
        github.com/ollama/ollama/llama/runner/runner.go:901 +0xc2b

goroutine 1 gp=0xc0000061c0 m=nil [IO wait, 520 minutes]:
runtime.gopark(0xc000038a08?, 0xc00014b908?, 0xb1?, 0x7a?, 0x2000?)
        runtime/proc.go:402 +0xce fp=0xc00014b888 sp=0xc00014b868 pc=0x5bb7383bc00e
runtime.netpollblock(0xc00014b920?, 0x38384b26?, 0xb7?)
        runtime/netpoll.go:573 +0xf7 fp=0xc00014b8c0 sp=0xc00014b888 pc=0x5bb7383b4257
internal/poll.runtime_pollWait(0x7ae067dc7fe0, 0x72)
        runtime/netpoll.go:345 +0x85 fp=0xc00014b8e0 sp=0xc00014b8c0 pc=0x5bb7383e8aa5
internal/poll.(*pollDesc).wait(0x3?, 0x7c?, 0x0)
        internal/poll/fd_poll_runtime.go:84 +0x27 fp=0xc00014b908 sp=0xc00014b8e0 pc=0x5bb7384389c7
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0xc000150080)
        internal/poll/fd_unix.go:611 +0x2ac fp=0xc00014b9b0 sp=0xc00014b908 pc=0x5bb738439e8c
net.(*netFD).accept(0xc000150080)
        net/fd_unix.go:172 +0x29 fp=0xc00014ba68 sp=0xc00014b9b0 pc=0x5bb7384a88a9
net.(*TCPListener).accept(0xc0000321e0)
        net/tcpsock_posix.go:159 +0x1e fp=0xc00014ba90 sp=0xc00014ba68 pc=0x5bb7384b95de
net.(*TCPListener).Accept(0xc0000321e0)
        net/tcpsock.go:327 +0x30 fp=0xc00014bac0 sp=0xc00014ba90 pc=0x5bb7384b8930
net/http.(*onceCloseListener).Accept(0xc000190090?)
        <autogenerated>:1 +0x24 fp=0xc00014bad8 sp=0xc00014bac0 pc=0x5bb7385dfa44
net/http.(*Server).Serve(0xc000168000, {0x5bb73893c400, 0xc0000321e0})
        net/http/server.go:3260 +0x33e fp=0xc00014bc08 sp=0xc00014bad8 pc=0x5bb7385d685e
main.main()
        github.com/ollama/ollama/llama/runner/runner.go:921 +0xfcc fp=0xc00014bf50 sp=0xc00014bc08 pc=0x5bb738601c4c
runtime.main()
        runtime/proc.go:271 +0x29d fp=0xc00014bfe0 sp=0xc00014bf50 pc=0x5bb7383bbbdd
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00014bfe8 sp=0xc00014bfe0 pc=0x5bb7383edde1

goroutine 2 gp=0xc000006c40 m=nil [force gc (idle), 3 minutes]:
runtime.gopark(0x1dd19be52e23?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc000046fa8 sp=0xc000046f88 pc=0x5bb7383bc00e
runtime.goparkunlock(...)
        runtime/proc.go:408
runtime.forcegchelper()
        runtime/proc.go:326 +0xb8 fp=0xc000046fe0 sp=0xc000046fa8 pc=0x5bb7383bbe98
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc000046fe8 sp=0xc000046fe0 pc=0x5bb7383edde1
created by runtime.init.6 in goroutine 1
        runtime/proc.go:314 +0x1a

goroutine 3 gp=0xc000007180 m=nil [GC sweep wait]:
runtime.gopark(0x5bb738b09e01?, 0x5bb738b09e40?, 0xc?, 0x9?, 0x1?)
        runtime/proc.go:402 +0xce fp=0xc000047780 sp=0xc000047760 pc=0x5bb7383bc00e
runtime.goparkunlock(...)
        runtime/proc.go:408
runtime.bgsweep(0xc00006e000)
        runtime/mgcsweep.go:318 +0xdf fp=0xc0000477c8 sp=0xc000047780 pc=0x5bb7383a6b9f
runtime.gcenable.gowrap1()
        runtime/mgc.go:203 +0x25 fp=0xc0000477e0 sp=0xc0000477c8 pc=0x5bb73839b685
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000477e8 sp=0xc0000477e0 pc=0x5bb7383edde1
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:203 +0x66

goroutine 4 gp=0xc000007340 m=nil [GC scavenge wait]:
runtime.gopark(0x10000?, 0x166b9ea?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc000047f78 sp=0xc000047f58 pc=0x5bb7383bc00e
runtime.goparkunlock(...)
        runtime/proc.go:408
runtime.(*scavengerState).park(0x5bb738b0a4c0)
        runtime/mgcscavenge.go:425 +0x49 fp=0xc000047fa8 sp=0xc000047f78 pc=0x5bb7383a4549
runtime.bgscavenge(0xc00006e000)
        runtime/mgcscavenge.go:658 +0x59 fp=0xc000047fc8 sp=0xc000047fa8 pc=0x5bb7383a4af9
runtime.gcenable.gowrap2()
        runtime/mgc.go:204 +0x25 fp=0xc000047fe0 sp=0xc000047fc8 pc=0x5bb73839b625
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc000047fe8 sp=0xc000047fe0 pc=0x5bb7383edde1
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:204 +0xa5

goroutine 5 gp=0xc000007c00 m=nil [finalizer wait, 3 minutes]:
runtime.gopark(0x0?, 0x5bb7389381a0?, 0x0?, 0x60?, 0x1000000010?)
        runtime/proc.go:402 +0xce fp=0xc000046620 sp=0xc000046600 pc=0x5bb7383bc00e
runtime.runfinq()
        runtime/mfinal.go:194 +0x107 fp=0xc0000467e0 sp=0xc000046620 pc=0x5bb73839a6c7
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000467e8 sp=0xc0000467e0 pc=0x5bb7383edde1
created by runtime.createfing in goroutine 1
        runtime/mfinal.go:164 +0x3d

goroutine 22 gp=0xc000196000 m=nil [select]:
runtime.gopark(0xc000147a80?, 0x2?, 0x18?, 0x77?, 0xc000147824?)
        runtime/proc.go:402 +0xce fp=0xc000147698 sp=0xc000147678 pc=0x5bb7383bc00e
runtime.selectgo(0xc000147a80, 0xc000147820, 0xc00037de00?, 0x0, 0x2?, 0x1)
        runtime/select.go:327 +0x725 fp=0xc0001477b8 sp=0xc000147698 pc=0x5bb7383cd3e5
main.(*Server).completion(0xc000128120, {0x5bb73893c5b0, 0xc0000e22a0}, 0xc0000c0360)
        github.com/ollama/ollama/llama/runner/runner.go:652 +0x8fe fp=0xc000147ab8 sp=0xc0001477b8 pc=0x5bb7385ff6de
main.(*Server).completion-fm({0x5bb73893c5b0?, 0xc0000e22a0?}, 0x5bb7385dab8d?)
        <autogenerated>:1 +0x36 fp=0xc000147ae8 sp=0xc000147ab8 pc=0x5bb7386026b6
net/http.HandlerFunc.ServeHTTP(0xc00010cb60?, {0x5bb73893c5b0?, 0xc0000e22a0?}, 0x10?)
        net/http/server.go:2171 +0x29 fp=0xc000147b10 sp=0xc000147ae8 pc=0x5bb7385d3629
net/http.(*ServeMux).ServeHTTP(0x5bb73838ef85?, {0x5bb73893c5b0, 0xc0000e22a0}, 0xc0000c0360)
        net/http/server.go:2688 +0x1ad fp=0xc000147b60 sp=0xc000147b10 pc=0x5bb7385d54ad
net/http.serverHandler.ServeHTTP({0x5bb73893b900?}, {0x5bb73893c5b0?, 0xc0000e22a0?}, 0x6?)
        net/http/server.go:3142 +0x8e fp=0xc000147b90 sp=0xc000147b60 pc=0x5bb7385d64ce
net/http.(*conn).serve(0xc000190090, {0x5bb73893ca08, 0xc00010adb0})
        net/http/server.go:2044 +0x5e8 fp=0xc000147fb8 sp=0xc000147b90 pc=0x5bb7385d2268
net/http.(*Server).Serve.gowrap3()
        net/http/server.go:3290 +0x28 fp=0xc000147fe0 sp=0xc000147fb8 pc=0x5bb7385d6c48
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc000147fe8 sp=0xc000147fe0 pc=0x5bb7383edde1
created by net/http.(*Server).Serve in goroutine 1
        net/http/server.go:3290 +0x4b4

goroutine 21 gp=0xc000082a80 m=nil [GC worker (idle), 4 minutes]:
runtime.gopark(0x1db5aaee6275?, 0x3?, 0x58?, 0xf?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc0000cdf50 sp=0xc0000cdf30 pc=0x5bb7383bc00e
runtime.gcBgMarkWorker()
        runtime/mgc.go:1310 +0xe5 fp=0xc0000cdfe0 sp=0xc0000cdf50 pc=0x5bb73839d585
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000cdfe8 sp=0xc0000cdfe0 pc=0x5bb7383edde1
created by runtime.gcBgMarkStartWorkers in goroutine 18
        runtime/mgc.go:1234 +0x1c

goroutine 41 gp=0xc000082fc0 m=nil [GC worker (idle), 3 minutes]:
runtime.gopark(0x1db5aaee606c?, 0x3?, 0xc?, 0xfe?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc0000cf750 sp=0xc0000cf730 pc=0x5bb7383bc00e
runtime.gcBgMarkWorker()
        runtime/mgc.go:1310 +0xe5 fp=0xc0000cf7e0 sp=0xc0000cf750 pc=0x5bb73839d585
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000cf7e8 sp=0xc0000cf7e0 pc=0x5bb7383edde1
created by runtime.gcBgMarkStartWorkers in goroutine 18
        runtime/mgc.go:1234 +0x1c

goroutine 50 gp=0xc0005e2000 m=nil [GC worker (idle), 3 minutes]:
runtime.gopark(0x1dd19bf2c88b?, 0x3?, 0xbf?, 0x40?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc0000c8750 sp=0xc0000c8730 pc=0x5bb7383bc00e
runtime.gcBgMarkWorker()
        runtime/mgc.go:1310 +0xe5 fp=0xc0000c87e0 sp=0xc0000c8750 pc=0x5bb73839d585
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000c87e8 sp=0xc0000c87e0 pc=0x5bb7383edde1
created by runtime.gcBgMarkStartWorkers in goroutine 18
        runtime/mgc.go:1234 +0x1c

goroutine 42 gp=0xc000083180 m=nil [GC worker (idle), 66 minutes]:
runtime.gopark(0x1a5228359582?, 0x3?, 0x1c?, 0x4?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc0000cff50 sp=0xc0000cff30 pc=0x5bb7383bc00e
runtime.gcBgMarkWorker()
        runtime/mgc.go:1310 +0xe5 fp=0xc0000cffe0 sp=0xc0000cff50 pc=0x5bb73839d585
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000cffe8 sp=0xc0000cffe0 pc=0x5bb7383edde1
created by runtime.gcBgMarkStartWorkers in goroutine 18
        runtime/mgc.go:1234 +0x1c

goroutine 11112 gp=0xc000156a80 m=nil [IO wait, 4 minutes]:
runtime.gopark(0x10?, 0x10?, 0xf0?, 0xbd?, 0xb?)
        runtime/proc.go:402 +0xce fp=0xc00019bda8 sp=0xc00019bd88 pc=0x5bb7383bc00e
runtime.netpollblock(0x5bb738422558?, 0x38384b26?, 0xb7?)
        runtime/netpoll.go:573 +0xf7 fp=0xc00019bde0 sp=0xc00019bda8 pc=0x5bb7383b4257
internal/poll.runtime_pollWait(0x7ae067dc7ee8, 0x72)
        runtime/netpoll.go:345 +0x85 fp=0xc00019be00 sp=0xc00019bde0 pc=0x5bb7383e8aa5
internal/poll.(*pollDesc).wait(0xc000164a00?, 0xc00010ab81?, 0x0)
        internal/poll/fd_poll_runtime.go:84 +0x27 fp=0xc00019be28 sp=0xc00019be00 pc=0x5bb7384389c7
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc000164a00, {0xc00010ab81, 0x1, 0x1})
        internal/poll/fd_unix.go:164 +0x27a fp=0xc00019bec0 sp=0xc00019be28 pc=0x5bb73843951a
net.(*netFD).Read(0xc000164a00, {0xc00010ab81?, 0xc00019bf48?, 0x5bb7383ea6d0?})
        net/fd_posix.go:55 +0x25 fp=0xc00019bf08 sp=0xc00019bec0 pc=0x5bb7384a77a5
net.(*conn).Read(0xc00004a000, {0xc00010ab81?, 0x385041544f792f41?, 0xc00010ab78?})
        net/net.go:185 +0x45 fp=0xc00019bf50 sp=0xc00019bf08 pc=0x5bb7384b1a65
net.(*TCPConn).Read(0xc00010ab70?, {0xc00010ab81?, 0x3450472f58332f59?, 0x636f422b44786847?})
        <autogenerated>:1 +0x25 fp=0xc00019bf80 sp=0xc00019bf50 pc=0x5bb7384bd445
net/http.(*connReader).backgroundRead(0xc00010ab70)
        net/http/server.go:681 +0x37 fp=0xc00019bfc8 sp=0xc00019bf80 pc=0x5bb7385cc1d7
net/http.(*connReader).startBackgroundRead.gowrap2()
        net/http/server.go:677 +0x25 fp=0xc00019bfe0 sp=0xc00019bfc8 pc=0x5bb7385cc105
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00019bfe8 sp=0xc00019bfe0 pc=0x5bb7383edde1
created by net/http.(*connReader).startBackgroundRead in goroutine 22
        net/http/server.go:677 +0xba

rax    0x204803fbc
rbx    0x7adfd17adce0
rcx    0xfef
rdx    0x7adfd10edb90
rdi    0x7adfd10edba0
rsi    0x0
rbp    0x7adffa7ddeb0
rsp    0x7adffa7dde90
r8     0x1
r9     0x7adfd16203b8
r10    0x0
r11    0x246
r12    0x7ade6000ccc0
r13    0x7adfd10edba0
r14    0x0
r15    0x7ae0b4ef57d0
rip    0x7ae06884d1d7
rflags 0x10297
cs     0x33
fs     0x0
gs     0x0
SIGABRT: abort
PC=0x7ae04269eb1c m=4 sigcode=18446744073709551610
signal arrived during cgo execution

goroutine 7 gp=0xc000156000 m=4 mp=0xc00004d808 [syscall]:
runtime.cgocall(0x5bb738602e90, 0xc000056b60)
        runtime/cgocall.go:157 +0x4b fp=0xc000056b38 sp=0xc000056b00 pc=0x5bb7383853cb
github.com/ollama/ollama/llama._Cfunc_llama_decode(0x7adfec006460, {0x1, 0x7adfec3acb70, 0x0, 0x0, 0x7adfec3ad380, 0x7adfec3adb90, 0x7adfec17b380, 0x7adfd10c2910,
0x0, ...})
        _cgo_gotypes.go:543 +0x52 fp=0xc000056b60 sp=0xc000056b38 pc=0x5bb738482952
github.com/ollama/ollama/llama.(*Context).Decode.func1(0x5bb7385fed4b?, 0x7adfec006460?)
        github.com/ollama/ollama/llama/llama.go:167 +0xd8 fp=0xc000056c80 sp=0xc000056b60 pc=0x5bb738484e78
github.com/ollama/ollama/llama.(*Context).Decode(0xc000056d68?, 0x1?)
        github.com/ollama/ollama/llama/llama.go:167 +0x17 fp=0xc000056cc8 sp=0xc000056c80 pc=0x5bb738484cd7
main.(*Server).processBatch(0xc000128120, 0xc000126150, 0xc0001261c0)
        github.com/ollama/ollama/llama/runner/runner.go:424 +0x29e fp=0xc000056ed0 sp=0xc000056cc8 pc=0x5bb7385fdd7e
main.(*Server).run(0xc000128120, {0x5bb73893ca40, 0xc00007c050})
        github.com/ollama/ollama/llama/runner/runner.go:338 +0x1a5 fp=0xc000056fb8 sp=0xc000056ed0 pc=0x5bb7385fd765
main.main.gowrap2()
        github.com/ollama/ollama/llama/runner/runner.go:901 +0x28 fp=0xc000056fe0 sp=0xc000056fb8 pc=0x5bb738601ec8
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc000056fe8 sp=0xc000056fe0 pc=0x5bb7383edde1
created by main.main in goroutine 1
        github.com/ollama/ollama/llama/runner/runner.go:901 +0xc2b

goroutine 1 gp=0xc0000061c0 m=nil [IO wait, 520 minutes]:
runtime.gopark(0xc000038a08?, 0xc00014b908?, 0xb1?, 0x7a?, 0x2000?)
        runtime/proc.go:402 +0xce fp=0xc00014b888 sp=0xc00014b868 pc=0x5bb7383bc00e
runtime.netpollblock(0xc00014b920?, 0x38384b26?, 0xb7?)
        runtime/netpoll.go:573 +0xf7 fp=0xc00014b8c0 sp=0xc00014b888 pc=0x5bb7383b4257
internal/poll.runtime_pollWait(0x7ae067dc7fe0, 0x72)
        runtime/netpoll.go:345 +0x85 fp=0xc00014b8e0 sp=0xc00014b8c0 pc=0x5bb7383e8aa5
internal/poll.(*pollDesc).wait(0x3?, 0x7c?, 0x0)
        internal/poll/fd_poll_runtime.go:84 +0x27 fp=0xc00014b908 sp=0xc00014b8e0 pc=0x5bb7384389c7
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0xc000150080)
        internal/poll/fd_unix.go:611 +0x2ac fp=0xc00014b9b0 sp=0xc00014b908 pc=0x5bb738439e8c
net.(*netFD).accept(0xc000150080)
        net/fd_unix.go:172 +0x29 fp=0xc00014ba68 sp=0xc00014b9b0 pc=0x5bb7384a88a9
net.(*TCPListener).accept(0xc0000321e0)
        net/tcpsock_posix.go:159 +0x1e fp=0xc00014ba90 sp=0xc00014ba68 pc=0x5bb7384b95de
net.(*TCPListener).Accept(0xc0000321e0)
        net/tcpsock.go:327 +0x30 fp=0xc00014bac0 sp=0xc00014ba90 pc=0x5bb7384b8930
net/http.(*onceCloseListener).Accept(0xc000190090?)
        <autogenerated>:1 +0x24 fp=0xc00014bad8 sp=0xc00014bac0 pc=0x5bb7385dfa44
net/http.(*Server).Serve(0xc000168000, {0x5bb73893c400, 0xc0000321e0})
        net/http/server.go:3260 +0x33e fp=0xc00014bc08 sp=0xc00014bad8 pc=0x5bb7385d685e
main.main()
        github.com/ollama/ollama/llama/runner/runner.go:921 +0xfcc fp=0xc00014bf50 sp=0xc00014bc08 pc=0x5bb738601c4c
runtime.main()
        runtime/proc.go:271 +0x29d fp=0xc00014bfe0 sp=0xc00014bf50 pc=0x5bb7383bbbdd
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00014bfe8 sp=0xc00014bfe0 pc=0x5bb7383edde1

goroutine 2 gp=0xc000006c40 m=nil [force gc (idle), 3 minutes]:
runtime.gopark(0x1dd19be52e23?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc000046fa8 sp=0xc000046f88 pc=0x5bb7383bc00e
runtime.goparkunlock(...)
        runtime/proc.go:408
runtime.forcegchelper()
        runtime/proc.go:326 +0xb8 fp=0xc000046fe0 sp=0xc000046fa8 pc=0x5bb7383bbe98
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc000046fe8 sp=0xc000046fe0 pc=0x5bb7383edde1
created by runtime.init.6 in goroutine 1
        runtime/proc.go:314 +0x1a

goroutine 3 gp=0xc000007180 m=nil [GC sweep wait]:
runtime.gopark(0x5bb738b09e01?, 0x5bb738b09e40?, 0xc?, 0x9?, 0x1?)
        runtime/proc.go:402 +0xce fp=0xc000047780 sp=0xc000047760 pc=0x5bb7383bc00e
runtime.goparkunlock(...)
        runtime/proc.go:408
runtime.bgsweep(0xc00006e000)
        runtime/mgcsweep.go:318 +0xdf fp=0xc0000477c8 sp=0xc000047780 pc=0x5bb7383a6b9f
runtime.gcenable.gowrap1()
        runtime/mgc.go:203 +0x25 fp=0xc0000477e0 sp=0xc0000477c8 pc=0x5bb73839b685
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000477e8 sp=0xc0000477e0 pc=0x5bb7383edde1
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:203 +0x66

goroutine 4 gp=0xc000007340 m=nil [GC scavenge wait]:
runtime.gopark(0x10000?, 0x166b9ea?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc000047f78 sp=0xc000047f58 pc=0x5bb7383bc00e
runtime.goparkunlock(...)
        runtime/proc.go:408
runtime.(*scavengerState).park(0x5bb738b0a4c0)
        runtime/mgcscavenge.go:425 +0x49 fp=0xc000047fa8 sp=0xc000047f78 pc=0x5bb7383a4549
runtime.bgscavenge(0xc00006e000)
        runtime/mgcscavenge.go:658 +0x59 fp=0xc000047fc8 sp=0xc000047fa8 pc=0x5bb7383a4af9
runtime.gcenable.gowrap2()
        runtime/mgc.go:204 +0x25 fp=0xc000047fe0 sp=0xc000047fc8 pc=0x5bb73839b625
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc000047fe8 sp=0xc000047fe0 pc=0x5bb7383edde1
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:204 +0xa5

goroutine 5 gp=0xc000007c00 m=nil [finalizer wait, 3 minutes]:
runtime.gopark(0x0?, 0x5bb7389381a0?, 0x0?, 0x60?, 0x1000000010?)
        runtime/proc.go:402 +0xce fp=0xc000046620 sp=0xc000046600 pc=0x5bb7383bc00e
runtime.runfinq()
        runtime/mfinal.go:194 +0x107 fp=0xc0000467e0 sp=0xc000046620 pc=0x5bb73839a6c7
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000467e8 sp=0xc0000467e0 pc=0x5bb7383edde1
created by runtime.createfing in goroutine 1
        runtime/mfinal.go:164 +0x3d

goroutine 22 gp=0xc000196000 m=nil [select]:
runtime.gopark(0xc000147a80?, 0x2?, 0x18?, 0x77?, 0xc000147824?)
        runtime/proc.go:402 +0xce fp=0xc000147698 sp=0xc000147678 pc=0x5bb7383bc00e
runtime.selectgo(0xc000147a80, 0xc000147820, 0xc00037de00?, 0x0, 0x2?, 0x1)
        runtime/select.go:327 +0x725 fp=0xc0001477b8 sp=0xc000147698 pc=0x5bb7383cd3e5
main.(*Server).completion(0xc000128120, {0x5bb73893c5b0, 0xc0000e22a0}, 0xc0000c0360)
        github.com/ollama/ollama/llama/runner/runner.go:652 +0x8fe fp=0xc000147ab8 sp=0xc0001477b8 pc=0x5bb7385ff6de
main.(*Server).completion-fm({0x5bb73893c5b0?, 0xc0000e22a0?}, 0x5bb7385dab8d?)
        <autogenerated>:1 +0x36 fp=0xc000147ae8 sp=0xc000147ab8 pc=0x5bb7386026b6
net/http.HandlerFunc.ServeHTTP(0xc00010cb60?, {0x5bb73893c5b0?, 0xc0000e22a0?}, 0x10?)
        net/http/server.go:2171 +0x29 fp=0xc000147b10 sp=0xc000147ae8 pc=0x5bb7385d3629
net/http.(*ServeMux).ServeHTTP(0x5bb73838ef85?, {0x5bb73893c5b0, 0xc0000e22a0}, 0xc0000c0360)
        net/http/server.go:2688 +0x1ad fp=0xc000147b60 sp=0xc000147b10 pc=0x5bb7385d54ad
net/http.serverHandler.ServeHTTP({0x5bb73893b900?}, {0x5bb73893c5b0?, 0xc0000e22a0?}, 0x6?)
        net/http/server.go:3142 +0x8e fp=0xc000147b90 sp=0xc000147b60 pc=0x5bb7385d64ce
net/http.(*conn).serve(0xc000190090, {0x5bb73893ca08, 0xc00010adb0})
        net/http/server.go:2044 +0x5e8 fp=0xc000147fb8 sp=0xc000147b90 pc=0x5bb7385d2268
net/http.(*Server).Serve.gowrap3()
        net/http/server.go:3290 +0x28 fp=0xc000147fe0 sp=0xc000147fb8 pc=0x5bb7385d6c48
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc000147fe8 sp=0xc000147fe0 pc=0x5bb7383edde1
created by net/http.(*Server).Serve in goroutine 1
        net/http/server.go:3290 +0x4b4

goroutine 21 gp=0xc000082a80 m=nil [GC worker (idle), 4 minutes]:
runtime.gopark(0x1db5aaee6275?, 0x3?, 0x58?, 0xf?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc0000cdf50 sp=0xc0000cdf30 pc=0x5bb7383bc00e
runtime.gcBgMarkWorker()
        runtime/mgc.go:1310 +0xe5 fp=0xc0000cdfe0 sp=0xc0000cdf50 pc=0x5bb73839d585
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000cdfe8 sp=0xc0000cdfe0 pc=0x5bb7383edde1
created by runtime.gcBgMarkStartWorkers in goroutine 18
        runtime/mgc.go:1234 +0x1c

goroutine 41 gp=0xc000082fc0 m=nil [GC worker (idle), 3 minutes]:
runtime.gopark(0x1db5aaee606c?, 0x3?, 0xc?, 0xfe?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc0000cf750 sp=0xc0000cf730 pc=0x5bb7383bc00e
runtime.gcBgMarkWorker()
        runtime/mgc.go:1310 +0xe5 fp=0xc0000cf7e0 sp=0xc0000cf750 pc=0x5bb73839d585
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000cf7e8 sp=0xc0000cf7e0 pc=0x5bb7383edde1
created by runtime.gcBgMarkStartWorkers in goroutine 18
        runtime/mgc.go:1234 +0x1c

goroutine 50 gp=0xc0005e2000 m=nil [GC worker (idle), 3 minutes]:
runtime.gopark(0x1dd19bf2c88b?, 0x3?, 0xbf?, 0x40?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc0000c8750 sp=0xc0000c8730 pc=0x5bb7383bc00e
runtime.gcBgMarkWorker()
        runtime/mgc.go:1310 +0xe5 fp=0xc0000c87e0 sp=0xc0000c8750 pc=0x5bb73839d585
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000c87e8 sp=0xc0000c87e0 pc=0x5bb7383edde1
created by runtime.gcBgMarkStartWorkers in goroutine 18
        runtime/mgc.go:1234 +0x1c

goroutine 42 gp=0xc000083180 m=nil [GC worker (idle), 66 minutes]:
runtime.gopark(0x1a5228359582?, 0x3?, 0x1c?, 0x4?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc0000cff50 sp=0xc0000cff30 pc=0x5bb7383bc00e
runtime.gcBgMarkWorker()
        runtime/mgc.go:1310 +0xe5 fp=0xc0000cffe0 sp=0xc0000cff50 pc=0x5bb73839d585
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000cffe8 sp=0xc0000cffe0 pc=0x5bb7383edde1
created by runtime.gcBgMarkStartWorkers in goroutine 18
        runtime/mgc.go:1234 +0x1c

goroutine 11112 gp=0xc000156a80 m=nil [IO wait, 4 minutes]:
runtime.gopark(0x10?, 0x10?, 0xf0?, 0xbd?, 0xb?)
        runtime/proc.go:402 +0xce fp=0xc00019bda8 sp=0xc00019bd88 pc=0x5bb7383bc00e
runtime.netpollblock(0x5bb738422558?, 0x38384b26?, 0xb7?)
        runtime/netpoll.go:573 +0xf7 fp=0xc00019bde0 sp=0xc00019bda8 pc=0x5bb7383b4257
internal/poll.runtime_pollWait(0x7ae067dc7ee8, 0x72)
        runtime/netpoll.go:345 +0x85 fp=0xc00019be00 sp=0xc00019bde0 pc=0x5bb7383e8aa5
internal/poll.(*pollDesc).wait(0xc000164a00?, 0xc00010ab81?, 0x0)
        internal/poll/fd_poll_runtime.go:84 +0x27 fp=0xc00019be28 sp=0xc00019be00 pc=0x5bb7384389c7
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc000164a00, {0xc00010ab81, 0x1, 0x1})
        internal/poll/fd_unix.go:164 +0x27a fp=0xc00019bec0 sp=0xc00019be28 pc=0x5bb73843951a
net.(*netFD).Read(0xc000164a00, {0xc00010ab81?, 0xc00019bf48?, 0x5bb7383ea6d0?})
        net/fd_posix.go:55 +0x25 fp=0xc00019bf08 sp=0xc00019bec0 pc=0x5bb7384a77a5
net.(*conn).Read(0xc00004a000, {0xc00010ab81?, 0x385041544f792f41?, 0xc00010ab78?})
        net/net.go:185 +0x45 fp=0xc00019bf50 sp=0xc00019bf08 pc=0x5bb7384b1a65
net.(*TCPConn).Read(0xc00010ab70?, {0xc00010ab81?, 0x3450472f58332f59?, 0x636f422b44786847?})
        <autogenerated>:1 +0x25 fp=0xc00019bf80 sp=0xc00019bf50 pc=0x5bb7384bd445
net/http.(*connReader).backgroundRead(0xc00010ab70)
        net/http/server.go:681 +0x37 fp=0xc00019bfc8 sp=0xc00019bf80 pc=0x5bb7385cc1d7
net/http.(*connReader).startBackgroundRead.gowrap2()
        net/http/server.go:677 +0x25 fp=0xc00019bfe0 sp=0xc00019bfc8 pc=0x5bb7385cc105
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00019bfe8 sp=0xc00019bfe0 pc=0x5bb7383edde1
created by net/http.(*connReader).startBackgroundRead in goroutine 22
        net/http/server.go:677 +0xba

rax    0x0
rbx    0xa6ba
rcx    0x7ae04269eb1c
rdx    0x6
rdi    0xa6b7
rsi    0xa6ba
rbp    0x7adffa7de010
rsp    0x7adffa7ddfd0
r8     0x0
r9     0x0
r10    0x8
r11    0x246
r12    0x6
r13    0xfcc
r14    0x16
r15    0x0
rip    0x7ae04269eb1c
rflags 0x246
cs     0x33
fs     0x0
gs     0x0
[GIN] 2024/11/19 - 07:09:34 | 500 |         3m37s |       127.0.0.1 | POST     "/api/generate"
```

### OS

Linux

### GPU

Nvidia

### CPU

AMD

### Ollama version

0.4.1