Skip to content

Conversation

SHsari
Copy link

@SHsari SHsari commented Jul 28, 2025

main.cpp fix

Initialize GGML timer before first use to prevent divide‑by‑zero crash on Windows

ggml_time_us() divides by timer_freq, which is set in ggml_time_init().
When main() called ggml_time_us() before that initialization, timer_freq == 0, causing a STATUS_INTEGER_DIVIDE_BY_ZERO (0xC0000094) crash on Windows/MinGW.

at the very top of main().
The first line safely sets timer_freq; the second keeps behaviour identical by recording the start timestamp.

Result

ViT CLI no longer crashes with exit code –1073741676.

--help, inference, and verbose timing output all work as expected on Windows/MinGW, Linux, and macOS.

No other code paths are affected.

Copy link
Owner

@staghado staghado left a comment

Choose a reason for hiding this comment

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

thanks for testing on Windows and for the fix!

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.

3 participants