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

clock_gettime segfaults on windows #22958

Open
KoT3isGood opened this issue Feb 20, 2025 · 3 comments
Open

clock_gettime segfaults on windows #22958

KoT3isGood opened this issue Feb 20, 2025 · 3 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@KoT3isGood
Copy link

Zig Version

0.14.0-dev.3267+59dc15fa0

Steps to Reproduce and Observed Behavior

Compiled using zig build -Dtarget=x86_64-windows
Unhandled exception: page fault on execute access to 0x0000000000000000 in 64-bit code (0000000000000000).

struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);

Expected Behavior

Complete execution successfuly

@KoT3isGood KoT3isGood added the bug Observed behavior contradicts documented or intended behavior label Feb 20, 2025
@alexrp
Copy link
Member

alexrp commented Feb 20, 2025

Don't have time to boot into Windows right now, but:

❯ cat test.c
#include <time.h>
int main()
{
    struct timespec ts;
    clock_gettime(CLOCK_REALTIME, &ts);
}
❯ zig4 cc test.c -target x86_64-windows
❯ WINEDEBUG=-all wine ./a.exe
❯ echo $status
0

Can you give a more complete reproduction?

@KoT3isGood
Copy link
Author

I’m running on wine 10.1-1. For some reason pdb files are corrupted aswell, so no debug information is available. I’ll reinstall zig tomorrow morning, roughly in 10 hours and try to compile the thing once again.

@alichraghi
Copy link
Contributor

works fine on windows 11 btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

3 participants