Skip to content

ggml_used_mem can segfault if called before any objects are created. #1264

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 1, 2023

Conversation

KerfuffleV2
Copy link
Collaborator

@KerfuffleV2 KerfuffleV2 commented May 1, 2023

ggml_used_mem currently blindly dereferences ctx->objects_end, however that pointer is initially NULL and is only set when objects are created.

This tiny change just has it return 0 in that case (presumably if no objects were ever created, no memory is used).

@ggerganov ggerganov merged commit 2bdc096 into ggml-org:master May 1, 2023
@KerfuffleV2 KerfuffleV2 deleted the fix-used_mem_segfault branch May 28, 2023 08:45
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants