Skip to content

Misc. bug: [Server] Crashes with a coredump during termination #12180

Closed
@qnixsynapse

Description

@qnixsynapse

Name and Version

version: 4807 (72fc3916)
built with Intel(R) oneAPI DPC++/C++ Compiler 2025.0.4 (2025.0.4.20241205) for x86_64-unknown-linux-gnu

Operating systems

Linux

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

llama-server

Command line

Any command line will work as long as it has loaded a model and is running.

Problem description & steps to reproduce

  1. Run llama-server on a model
  2. terminate/shut down the server

First Bad Commit

Not sure, but it is related to here:

if (!ctx_server.load_model(params)) {
clean_up();
// t.join(); // FIXME: see below
LOG_ERR("%s: exiting due to model loading error\n", __func__);
return 1;
}

and

clean_up();
// t.join(); // FIXME: http thread may stuck if there is an on-going request. we don't need to care about this for now as the HTTP connection will already be closed at this point, but it's better to fix this

It seems the server thread t is being destructed while still joinable at the time of termination.
This issue can be fixable by uncommenting the t.join(); statements in both places. Opened an issue instead because of the comment.

Relevant log output

srv  update_slots: all slots are idle
srv  log_server_r: request: POST /v1/chat/completions 127.0.0.1 200
^Csrv    operator(): operator(): cleaning up before exit...
terminate called without an active exception
Aborted (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions