Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants