Skip to content

Misc. bug: test-model-resolution crashes on Windows MSYS2 UCRT64 #26552

Closed

Description

@rillomas

Name and Version

$ build_vk_shared/bin/Debug/llama-cli.exe --version
version: 10257 (22dc605)
built with GNU 16.1.0 for Windows AMD64

Operating systems

Windows

Which llama.cpp modules do you know to be affected?

Unit test

Command line

test-model-resolution.exe

Problem description & steps to reproduce

I'm seeing following crash. CI is also failing. VisualStudio build works so seems like a MSYS2 environment issue.

# build_vk_shared/bin/test-model-resolution.exe
test-model-resolution: plan resolution on 14 cases
  flat exact tag
  flat default
  unsloth fallback
  flat hf_file
  (null)
Segmentation fault         build_vk_shared/bin/test-model-resolution.exe

When I look at gdb debug build output the array content of plan_cases[4] is broken.

(gdb) bt
#0  0x00007ff661cbfb90 in std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::size (this=0x0)
    at C:/msys64/ucrt64/include/c++/16.1.0/bits/stl_vector.h:1109
#1  0x00007ff661ca4776 in test_plan_resolution ()
    at C:/Users/devcloud/Documents/llama.cpp/tests/test-model-resolution.cpp:325
#2  0x00007ff661ca89cc in main ()
    at C:/Users/devcloud/Documents/llama.cpp/tests/test-model-resolution.cpp:497
(gdb) p plan_cases[4]
$16 = {name = 0x0, files = <error reading variable: Cannot access memory at address 0x8>,
  hf_repo = 0x0, hf_file = 0x0, sidecars = false, order_dependent = false, primary = 0x0,
  model_files = std::vector of length 0, capacity 0, mmproj = 0x0, mtp = 0x0, dflash = 0x0,
  eagle3 = 0x0, dspark = 0x0}

First Bad Commit

ee0445c (#26172)

Relevant log output

Logs

Activity

  1. rillomas commented on Aug 4, 2026

    @rillomas
    ContributorAuthor

    Following diff fixes the crash. VS2026 works with the original code so seems like a compiler/runtime issue or something. Possibly undefined behavior since we're initializing &files (reference to a vector) with a temporary vector where its lifetime is not guaranteed?

    diff --git a/tests/test-model-resolution.cpp b/tests/test-model-resolution.cpp
    index a96e40bb2..2437eeec6 100644
    --- a/tests/test-model-resolution.cpp
    +++ b/tests/test-model-resolution.cpp
    @@ -195,7 +195,7 @@ static const std::vector<std::string> dspark_dflash = {
    
     struct plan_case {
         const char * name;
    -    const std::vector<std::string> & files;
    +    const std::vector<std::string> files;
         const char * hf_repo;
         const char * hf_file;
         bool sidecars;        // request mmproj + mtp + dflash + eagle3 + dspark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions