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

Editor crashes upon start #133

Open
keviny1981 opened this issue Oct 16, 2022 · 3 comments
Open

Editor crashes upon start #133

keviny1981 opened this issue Oct 16, 2022 · 3 comments

Comments

@keviny1981
Copy link

keviny1981 commented Oct 16, 2022

Describe the bug
Attempt to run Debug build after compilation completion of libraries editor gets crashed

To Reproduce
As soon as debug build has triggered, Editor gets crashed caused by access violation

Expected behaviour
Editor should be up and running without a problem

Screenshots
image

Hardware:

  • Device: AMD Ryzen 7 2700X / Geforce 1050Ti
  • OS: Windows 10

Additional context

  • Version: 0.14.3
  • Git: 2ff8ade on master
  • IDE: Visual Studio 2019 / 2022 Community
@kyriewxcode
Copy link

我也遇到一样的问题

@linuxing3
Copy link

Can't start in Linux
swappy-20230821_185628

@CheapMeow
Copy link

CheapMeow commented Sep 20, 2023

Bug of window signal connection is because there is no glfw window in Windows instance.
Windows class use AddWindow() to create glfw window, this function should be called externally form Windows class, but the situation is that Editor project don't have the call. So when code run into signal connection, it get an empty pointer and call OnKey() at empty pointer.
To solve it, I hack AddWindow() in Windows class ctor at first. It may disobey the author's design.

After this hack, I continue geting bug of pointer of renderpass is empty. It should be created in RenderStage::Rebuild(), but the function never be called till renderpass is used. After debug, I realize that reanderpass is created in ResetRenderStages(), but my swapchains 's size = 0, so in ResetRenderStages() it doesn't call RenderStage::Rebuild(). Finally I found surface creation is connected to onAddWindow singal, but the connection happen in Graphics class ctor, and I call AddWindow() before the connection, so the onAddWindow invoke nothing.

It means the calling time of AddWindow() should be considered carefully. The calling time should be behind of Windows module creation, behind of modules that connect to onAddWindow, ahead of modules that need glfw window.

So I make the hack in GetWindow()

Sources\Devices\Windows.cpp

Window *Windows::GetWindow(WindowId id) {
	// hack
	if (windows.size() == 0 && id == 0)
		AddWindow();

	if (id >= windows.size())
		return nullptr;
	return windows.at(id).get();
}

Then editor project should run.

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

No branches or pull requests

4 participants