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

NULL assert error in MNIST example for current version on Mac #927

Merged
merged 2 commits into from
Aug 24, 2024

Conversation

Ucag
Copy link
Contributor

@Ucag Ucag commented Aug 22, 2024

I met this error on Mac when running mnist example on Mac M2. The program failed on ggml.c check of line 19771 and 19772. Those two checks are:

    assert(*ctx_data == NULL);
    assert(*ctx_eval == NULL);

These two pointers passed through the caller function in examples/mnist/mnist-common.cpp, which are initialized as below:

    struct ggml_context * ctx_data;
    struct ggml_context * ctx_eval;

The error is obvious. It seems that not all compiler will make uninitialized pointer to NULL.

… compiler does not set uninitialized pointer to NULL for mnist example
Copy link
Collaborator

@JohannesGaessler JohannesGaessler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

examples/mnist/mnist-common.cpp Outdated Show resolved Hide resolved
@JohannesGaessler JohannesGaessler merged commit b482acd into ggerganov:master Aug 24, 2024
4 checks passed
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.

2 participants