[GH-ISSUE #490] clip.load segmentation fault #417

Open
opened 2026-10-31 21:14:48 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @SylviaZiyuZhang on GitHub (Mar 13, 2025).
Original GitHub issue: https://github.com/openai/CLIP/issues/490

Code block

print(f"Prepare to load clip, {model}, {device}")
self.embedding_model, self.preprocessor = clip.load("ViT-L/14", "cpu")
print("Load clip")

Output

Prepare to load clip, ViT-L/14, cpu
zsh: segmentation fault  python evaluate.py

This only happens when clip is loaded in this OOP setting. This is the only ML model used in the software. Everything works normal in interactive shell.

Architecture and OS: macOS Sonoma (arm64)
Dependencies:
Python 3.11.8
Torch 2.6.0
Clip 1.0

lldb disassembly output:

Process 2008 stopped
* thread #4, stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
    frame #0: 0x0000000101919828 libomp.dylib`void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 44
libomp.dylib`__kmp_suspend_64<false, true>:
->  0x101919828 <+44>: ldr    x19, [x8, w0, sxtw #3]
    0x10191982c <+48>: mov    x0, x19
    0x101919830 <+52>: bl     0x101918dc8               ; __kmp_suspend_initialize_thread
    0x101919834 <+56>: add    x20, x19, #0x540
  thread #5, stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x0000000101919828 libomp.dylib`void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 44
libomp.dylib`__kmp_suspend_64<false, true>:
->  0x101919828 <+44>: ldr    x19, [x8, w0, sxtw #3]
    0x10191982c <+48>: mov    x0, x19
    0x101919830 <+52>: bl     0x101918dc8               ; __kmp_suspend_initialize_thread
    0x101919834 <+56>: add    x20, x19, #0x540
  thread #6, stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
    frame #0: 0x0000000101919828 libomp.dylib`void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 44
libomp.dylib`__kmp_suspend_64<false, true>:
->  0x101919828 <+44>: ldr    x19, [x8, w0, sxtw #3]
    0x10191982c <+48>: mov    x0, x19
    0x101919830 <+52>: bl     0x101918dc8               ; __kmp_suspend_initialize_thread
    0x101919834 <+56>: add    x20, x19, #0x540
Target 0: (python) stopped.
Originally created by @SylviaZiyuZhang on GitHub (Mar 13, 2025). Original GitHub issue: https://github.com/openai/CLIP/issues/490 Code block ``` print(f"Prepare to load clip, {model}, {device}") self.embedding_model, self.preprocessor = clip.load("ViT-L/14", "cpu") print("Load clip") ``` Output ``` Prepare to load clip, ViT-L/14, cpu zsh: segmentation fault python evaluate.py ``` This only happens when clip is loaded in this OOP setting. This is the only ML model used in the software. Everything works normal in interactive shell. Architecture and OS: macOS Sonoma (arm64) Dependencies: Python 3.11.8 Torch 2.6.0 Clip 1.0 `lldb` disassembly output: ``` Process 2008 stopped * thread #4, stop reason = EXC_BAD_ACCESS (code=1, address=0x8) frame #0: 0x0000000101919828 libomp.dylib`void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 44 libomp.dylib`__kmp_suspend_64<false, true>: -> 0x101919828 <+44>: ldr x19, [x8, w0, sxtw #3] 0x10191982c <+48>: mov x0, x19 0x101919830 <+52>: bl 0x101918dc8 ; __kmp_suspend_initialize_thread 0x101919834 <+56>: add x20, x19, #0x540 thread #5, stop reason = EXC_BAD_ACCESS (code=1, address=0x10) frame #0: 0x0000000101919828 libomp.dylib`void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 44 libomp.dylib`__kmp_suspend_64<false, true>: -> 0x101919828 <+44>: ldr x19, [x8, w0, sxtw #3] 0x10191982c <+48>: mov x0, x19 0x101919830 <+52>: bl 0x101918dc8 ; __kmp_suspend_initialize_thread 0x101919834 <+56>: add x20, x19, #0x540 thread #6, stop reason = EXC_BAD_ACCESS (code=1, address=0x18) frame #0: 0x0000000101919828 libomp.dylib`void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 44 libomp.dylib`__kmp_suspend_64<false, true>: -> 0x101919828 <+44>: ldr x19, [x8, w0, sxtw #3] 0x10191982c <+48>: mov x0, x19 0x101919830 <+52>: bl 0x101918dc8 ; __kmp_suspend_initialize_thread 0x101919834 <+56>: add x20, x19, #0x540 Target 0: (python) stopped. ```
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#417
No description provided.