odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.1k stars 550 forks source link

Randomly getting "Access violation executing location 0x0000000000000000." #3802

Closed cmdl-dev closed 1 week ago

cmdl-dev commented 1 week ago

Context

Today I randomly got an error using the vendor library raylib. When I try to load the image using LoadTexture. I feel like there is an issue with my version of odin, not sure how to resolve it.

Repo: https://github.com/cmdl-dev/odin_raylib_issue ImageOfError

I have already:

Operating System & Odin Version:

Windows 11 Pro - Odin version dev-2024-06:8eafd9eb8

Please paste odin report output:

    Odin:    dev-2024-06:8eafd9eb8
    OS:      Windows 11 Professional (version: 23H2), build 22631.3737
    CPU:     AMD Ryzen 9 5950X 16-Core Processor
    RAM:     32653 MiB
    Backend: LLVM 17.0.1

Expected Behavior

The output should display "File is 32" 32 being the width of the image. Please describe the behavior you are expecting

Current Behavior

What is the current behavior? When running in debugger I am getting an excepting being throw with the text: Getting Unhandled exception at 0x0000000000000000 in test.exe: 0xC0000005: Access violation executing location 0x0000000000000000. In the console I am getting: INFO: FILEIO: [grass.png] File loaded successfully INFO: IMAGE: Data loaded successfully (32x32 | R8G8B8A8 | 1 mipmaps)

Kelimion commented 1 week ago

This isn't a bug in raylib or Odin.

You need to set up the Window to be able to upload a texture to the GPU, that's why it crashes after loading the image file. Raylib tries to upload it to GPU through OpenGL handles that haven't been set up yet.

Kelimion commented 1 week ago

No. This code didn't work last week or any other week. Don't insult our intelligence to get help by pretending it's an Odin issue that wasn't there last week, and giving us a dead link.

I already said what's wrong with the example code: You're not initializing the window. But because you chose to bullshit us instead of asking for help honestly, that's the last help you'll get.

Kelimion commented 1 week ago

image So, deleting this as well. Consider yourself banned.