Closed
Description
Steps to reproduce:
- Install latest w64devkit
- Build with
make LLAMA_DEBUG=1
- Simply run
./main
, regardless of whether you have a model in the default location (I don't)
50% of the time, it will fail. I cannot reproduce it if I build with MSYS2's mingw-w64 toolchain instead.
I bisected it to commit 0c44427, which adds -march=native to CXXFLAGS.
If cv2pdb is to be trusted (confirmed below), the crash happens here:
https://github.com/ggerganov/llama.cpp/blob/8afe2280009ecbfc9de2c93b8f41283dc810609a/common/common.cpp#L723
Something is going wrong before that function call:
llama_model * model = llama_load_model_from_file(params.model.c_str(), lparams);
00007FF7CBE59448 mov rax,qword ptr [params]
00007FF7CBE5944F add rax,0C8h
00007FF7CBE59455 mov rcx,rax
00007FF7CBE59458 call _M_range_check+0F70h (07FF7CBEA0340h)
00007FF7CBE5945D mov rcx,rax
00007FF7CBE59460 vmovdqu ymm0,ymmword ptr [lparams]
00007FF7CBE59465 vmovdqa ymmword ptr [rbp-60h],ymm0 <-- segfault is here
00007FF7CBE5946A vmovdqu ymm0,ymmword ptr [rbp+10h]
00007FF7CBE5946F vmovdqa ymmword ptr [rbp-40h],ymm0
00007FF7CBE59474 lea rax,[rbp-60h]
00007FF7CBE59478 mov rdx,rax
00007FF7CBE5947B call llama_load_model_from_file (07FF7CBE4B9D7h)
rbp is 0x0000007CA91FE0D0, so I'm not sure where 0xFFFFFFFFFFFFFFFF comes from. And it's a read violation, but that instruction is only reading from a register.