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

Crashes in RenderCommand during early initialization #574

Open
3x3y3z3t opened this issue Jul 26, 2022 · 0 comments · May be fixed by #575
Open

Crashes in RenderCommand during early initialization #574

3x3y3z3t opened this issue Jul 26, 2022 · 0 comments · May be fixed by #575

Comments

@3x3y3z3t
Copy link
Contributor

3x3y3z3t commented Jul 26, 2022

Describe the bug

RendererAPI creation in RenderCommand.cpp will crash if we try to log something in RendererAPI::Create() function.

To Reproduce

Steps to reproduce the behavior:

  1. Go to RendererAPI::Create() function in RendererAPI.cpp
  2. Add some log call in this function. For example,
Scope<RendererAPI> RendererAPI::Create()
{
    HZ_CORE_INFO("Crash on this line"); // <- add this line;
    switch (s_API)
    {
        // ...
    }
}
  1. "Let's hit F5 and see what happens" (I mean, the program will crash on that log call).

Expected behavior

The program should not crash.

Development environment

  • OS: Windows 10 Pro
  • Visual Studio: VS2019 (also tested on VS2017)

Additional context

This bug happens in initialization phase, when all statics is initialized. During this phase, Hazel::Log is not initialized yet (execution has not yet reach the main function). Despite that, a call to Hazel's other system (RendererAPI) was made.
This bug was invisible due to there is no log call made in that function. At one point in the future when we need to log something in that function, the bug will reveal itself.

@3x3y3z3t 3x3y3z3t linked a pull request Jul 26, 2022 that will close this issue
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 a pull request may close this issue.

1 participant