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

Unhandled exception thrown: read access violation. **viewportContextManager** was nullptr. #18459

Open
AlsonEntuna opened this issue Nov 11, 2024 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio.

Comments

@AlsonEntuna
Copy link

AlsonEntuna commented Nov 11, 2024

Describe the bug
Can't run o3de editor

Assets required
nothing, it crashes on startup

Steps to reproduce
Steps to reproduce the behavior:

  1. Clone from github
  2. Compile using vs2022 (win11)
  3. Create a project
  4. set the Editor as startup project, then in the commands enter the --project-path <path> args
  5. See error

Expected behavior
Able to run the editor

Actual behavior
Exception

Found in Branch
main

Call stack

>	EditorLib.dll!EditorViewportWidget::SetAsActiveViewport() Line 2121	C++
 	EditorLib.dll!EditorViewportWidget::EditorViewportWidget(const QString & name, QWidget * parent) Line 237	C++
 	[Inline Frame] EditorCore.dll!AZStd::function_intermediate<QWidget *,QWidget *>::operator()(QWidget * &&) Line 604	C++
 	[Inline Frame] EditorCore.dll!AZStd::function<QWidget * __cdecl(QWidget *)>::operator()(QWidget * <args_0>) Line 684	C++
 	EditorCore.dll!QtViewPane::CreateWidget() Line 189	C++
 	EditorCore.dll!QtViewPaneManager::CreateWidget(const QString & paneName) Line 962	C++
 	[Inline Frame] EditorLib.dll!CLayoutViewPane::SetViewClass(const QString &) Line 542	C++
 	EditorLib.dll!CLayoutWnd::BindViewport(CLayoutViewPane * vp, const QString & viewClassName, QWidget * pViewport) Line 164	C++
 	EditorLib.dll!CLayoutWnd::MaximizeViewport(int paneId) Line 206	C++
 	EditorLib.dll!CLayoutWnd::CreateLayout(EViewLayout layout, bool bBindViewports, EViewportType defaultView) Line 295	C++
 	EditorLib.dll!MainWindow::InitCentralWidget() Line 426	C++
 	EditorLib.dll!MainWindow::Initialize() Line 439	C++
 	EditorLib.dll!CCryEditApp::InitInstance() Line 1646	C++
 	EditorLib.dll!CryEditMain(int argc, char * * argv) Line 3488	C++
 	[Inline Frame] Editor.exe!AZStd::Internal::INVOKE(int(*)(int, char * *) &) Line 208	C++
 	[Inline Frame] Editor.exe!AZStd::invoke(int(*)(int, char * *) &) Line 54	C++
 	Editor.exe!main(int argc, char * * argv) Line 31	C++
 	Editor.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 97	C++
 	[External Code]	
@AlsonEntuna AlsonEntuna added kind/bug Categorizes issue or PR as related to a bug. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 11, 2024
@byrcolin byrcolin added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/content Categorizes an issue or PR as relevant to SIG Content. sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 13, 2024
@moudgils moudgils removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/content Categorizes an issue or PR as relevant to SIG Content. labels Nov 13, 2024
@moudgils
Copy link
Contributor

Are you able to attach logs to indicate where the issue is? Thanks.

@AlsonEntuna
Copy link
Author

AlsonEntuna commented Nov 16, 2024

@moudgils , here are files that can help you with my issue.
assert.zip

<09:03:15> [Plugin Manager] Successfully loaded plugin 'QtAssetImporter', version '1' (GUID: {0abf28f2-ef56-4ac9-a459-175abb40d649})
Exception thrown: read access violation.
**viewportContextManager** was nullptr.

Do we require a certain version of msvc compiler? I just need to understand if we are just restricted to a certain version because I am using vs2022 right now and this is the msvc version I have

The C compiler identification is MSVC 19.41.34123.0
The CXX compiler identification is MSVC 19.41.34123.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped

@AlsonEntuna
Copy link
Author

AlsonEntuna commented Nov 17, 2024

I tried recompiling the engine again, still having the same results.
Happens here, void EditorViewportWidget::SetAsActiveViewport()

where viewportContextManager is nullptr

I am currently using my fork with an up-to-date main branch.

@AlsonEntuna
Copy link
Author

Hey, I tried compiling using vs2019 and is still not working I'm currently using the main branch

@guillaume-haerinck
Copy link
Contributor

Hey ! Seing this line in your log ================================================================== Module Manager: Trace::Error D:/Projects/o3de-dev/o3de/Code/Framework/AzCore/AzCore/Module/ModuleManager.cpp(621): 'void __cdecl AZ::ModuleManager::HandleDependencySortError(const class AZ::Outcome<void,struct AZ::Entity::FailedSortDetails> &)' Module Manager: Modules Entities cannot be activated.

To me it seems that some dependent .dll were not built. As you are building from source, what I usually do in cmake is set the LY_PROJECTS to the path of the project that I want to work on. This should generate your visual studio solution with the project, and build the required gems

@guillaume-haerinck
Copy link
Contributor

guillaume-haerinck commented Dec 11, 2024

So in your case, I think you built o3de editor target from source with no project. Then created a project, and launched your o3de build on said project. But even the most simple project needs some gems which are not required by the editor target (to be clear, you should always only build the editor target else build time are way too long, and with the LY_PROJECTS set in cmake, this will build your project dependent gems as well).

I think that the doc could be improved and made way clearer, as there are multiple ways to build the engine (project centric, engine centric etc). We should also think of better failsafe when trying to launch a project to check that required gems are available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio.
Projects
None yet
Development

No branches or pull requests

4 participants