ollama - 💡(How to fix) Fix Version 0.2 Crashes on windows with any command. This was present in .19 but still is present in .2 (MLX issue on windwos [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15300Fetched 2026-04-08 02:44:27
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
closed ×1labeled ×1

Error Message

Exception 0xc0000005 0x8 0x7ffba390cb12 0x7ffba390cb12

RAW_BUFFERClick to expand / collapse

What is the issue?

Check the log here:

Microsoft Windows [Version 10.0.26200.8037] (c) Microsoft Corporation. All rights reserved.

C:\Users\Prem Maddali>ollama --version Exception 0xc0000005 0x8 0x7ffba390cb12 0x7ffba390cb12 PC=0x7ffba390cb12 signal arrived during external code execution

runtime.cgocall(0x7ff7ecd9e9f0, 0xc000045da0) runtime/cgocall.go:167 +0x3e fp=0xc000045d78 sp=0xc000045d10 pc=0x7ff7ebc7243e github.com/ollama/ollama/x/imagegen/mlx._Cfunc_mlx_random_key(0xc00008e2e0, 0x19d5493c54e) _cgo_gotypes.go:1978 +0x50 fp=0xc000045da0 sp=0xc000045d78 pc=0x7ff7ec3004b0 github.com/ollama/ollama/x/imagegen/mlx.RandomKey.func1(...) github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1870 github.com/ollama/ollama/x/imagegen/mlx.RandomKey(0x19d5493c54e) github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1870 +0x5d fp=0xc000045dd8 sp=0xc000045da0 pc=0x7ff7ec3093dd github.com/ollama/ollama/x/imagegen/mlx.init.0() github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1848 +0xa9 fp=0xc000045e28 sp=0xc000045dd8 pc=0x7ff7ec3091e9 runtime.doInit1(0x7ff7ee12c2c0) runtime/proc.go:7350 +0xdd fp=0xc000045f50 sp=0xc000045e28 pc=0x7ff7ebc5343d runtime.doInit(...) runtime/proc.go:7317 runtime.main() runtime/proc.go:254 +0x325 fp=0xc000045fe0 sp=0xc000045f50 pc=0x7ff7ebc44e85 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc000045fe8 sp=0xc000045fe0 pc=0x7ff7ebc7db21

goroutine 2 gp=0xc0000028c0 m=nil [force gc (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:435 +0xce fp=0xc000087fa8 sp=0xc000087f88 pc=0x7ff7ebc7598e runtime.goparkunlock(...) runtime/proc.go:441 runtime.forcegchelper() runtime/proc.go:348 +0xb8 fp=0xc000087fe0 sp=0xc000087fa8 pc=0x7ff7ebc450f8 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc000087fe8 sp=0xc000087fe0 pc=0x7ff7ebc7db21 created by runtime.init.7 in goroutine 1 runtime/proc.go:336 +0x1a

goroutine 3 gp=0xc000002c40 m=nil [GC sweep wait]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:435 +0xce fp=0xc000089f80 sp=0xc000089f60 pc=0x7ff7ebc7598e runtime.goparkunlock(...) runtime/proc.go:441 runtime.bgsweep(0xc000096000) runtime/mgcsweep.go:276 +0x94 fp=0xc000089fc8 sp=0xc000089f80 pc=0x7ff7ebc2de74 runtime.gcenable.gowrap1() runtime/mgc.go:204 +0x25 fp=0xc000089fe0 sp=0xc000089fc8 pc=0x7ff7ebc22285 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc000089fe8 sp=0xc000089fe0 pc=0x7ff7ebc7db21 created by runtime.gcenable in goroutine 1 runtime/mgc.go:204 +0x66

goroutine 4 gp=0xc000002e00 m=nil [GC scavenge wait]: runtime.gopark(0xc000096000?, 0x7ff7ed6782e8?, 0x1?, 0x0?, 0xc000002e00?) runtime/proc.go:435 +0xce fp=0xc00009df78 sp=0xc00009df58 pc=0x7ff7ebc7598e runtime.goparkunlock(...) runtime/proc.go:441 runtime.(*scavengerState).park(0x7ff7ee246c80) runtime/mgcscavenge.go:425 +0x49 fp=0xc00009dfa8 sp=0xc00009df78 pc=0x7ff7ebc2b909 runtime.bgscavenge(0xc000096000) runtime/mgcscavenge.go:653 +0x3c fp=0xc00009dfc8 sp=0xc00009dfa8 pc=0x7ff7ebc2be7c runtime.gcenable.gowrap2() runtime/mgc.go:205 +0x25 fp=0xc00009dfe0 sp=0xc00009dfc8 pc=0x7ff7ebc22225 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc00009dfe8 sp=0xc00009dfe0 pc=0x7ff7ebc7db21 created by runtime.gcenable in goroutine 1 runtime/mgc.go:205 +0xa5

goroutine 5 gp=0xc000003340 m=nil [finalizer wait]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:435 +0xce fp=0xc00009fe30 sp=0xc00009fe10 pc=0x7ff7ebc7598e runtime.runfinq() runtime/mfinal.go:196 +0x107 fp=0xc00009ffe0 sp=0xc00009fe30 pc=0x7ff7ebc21207 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc00009ffe8 sp=0xc00009ffe0 pc=0x7ff7ebc7db21 created by runtime.createfing in goroutine 1 runtime/mfinal.go:166 +0x3d rax 0x64 rbx 0x7ffba39d098c rcx 0x3f3bfeff72a30000 rdx 0x12ab1ee0000 rdi 0x12ab1840860 rsi 0x0 rbp 0x211e1ff249 rsp 0x211e1fece0 r8 0x7ffffffffffffffc r9 0x211e306000 r10 0x8101010101010100 r11 0x12ab20cbf90 r12 0xffffffffffffffff r13 0x5d r14 0x12ab2013188 r15 0x0 rip 0x7ffba390cb12 rflags 0x10206 cs 0x33 fs 0x53 gs 0x2b

Relevant log output

OS

No response

GPU

No response

CPU

No response

Ollama version

No response

extent analysis

TL;DR

The issue is likely due to a segmentation fault caused by a null pointer dereference in the mlx_random_key function, and a potential workaround is to check for null pointers before calling this function.

Guidance

  • Review the mlx_random_key function in mlx.go to ensure that it handles null pointers correctly.
  • Check the RandomKey function in mlx.go to see if it is passing null pointers to mlx_random_key.
  • Verify that the init function in mlx.go is not causing any issues with the initialization of the mlx package.
  • Consider adding error checking to handle cases where mlx_random_key returns an error.

Example

// In mlx.go
func RandomKey() {
    // Check for null pointers before calling mlx_random_key
    if key == nil {
        // Handle null pointer error
        return
    }
    mlx_random_key(key)
}

Notes

The provided log output suggests a segmentation fault, which is often caused by a null pointer dereference. However, without more information about the ollama version, OS, GPU, and CPU, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Check for null pointers before calling mlx_random_key to prevent segmentation faults. This is a temporary solution until the root cause of the issue can be determined and fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING