thunder: Engine: BSD: Address SIGSEGV error on Loading / Creating a Project

valgrind-log.zip

Description

The editor partially loads the project and then crashes after a few seconds. It immediately crashes after project creation.

Prerequisites

Was on the project selection screen waiting to open a project.

Steps to Reproduce

  1. Build latest source code with CMake.
  2. Install to the SDK build directory using gmake install
  3. Run WorldEditor from inside of install-root/sdk/2024.2/freebsd/x86/bin/ directory
  4. Load up or create new project.

Expected behavior:

Full editor loads.

Actual behavior:

Crashes while loading editor and engine.

Reproducibility:

Consistently.

Versions

Version

Additional Information

I decided to run both gdb and Valgrind to get to the bottom of this. Attached is the Valgrind log.

Note the Invalid write of size 8 on line 400 and then the Address 0x70 is not stack'd on line 413. There’s other errors but MaterialInstance::setTransform is the crashing function in both debugger applications.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 88 (54 by maintainers)

Commits related to this issue

Most upvoted comments

I guess this issue can be closed. For shader compilation errors I’m suggesting to create a new one.

I don’t think the build dir will be useful for me. could you just zip an install dir?

I love how you have your directories structured. Having editor, components, resources, etc where needed in the modules helps quite a bit with readability. Everything with the editor subdirectory relies on Qt in some form.

QLibrary just using syscalls to load library dynamically. If library can’t be loaded (because of dependencies) it just returns nullptr handler. At least texturetools plugins is loading normally. In your case only 3 plugins is failed to load. All 3 has dependency graph-editor. It provides the editor of graphs. grapth-editor uses uikit to visualize this graphs. So I bet the issue is in paths to search this dependencies. probably you can check this two libs and it’s rpaths

I would like to remove Qt completely one day. But unfortunately it’s too far from this.

Logs says clearly: [PluginManager] Can't load plugin: This means code bellow failed: QLibrary *lib = new QLibrary(path); if(lib->load()) {

Based on my experience with QT it happens when lib dependencies was not fully resolved. I think the issue is in RPATH for some of sub-dependecies. Do u have lddtree ?

I don’t know how useful this is but all of the plugins that won’t load (minus UIKit) have errors where the module name and information is in the compiled library. These are specific dumps from those. With how modules are loaded, I noticed that you seem to look for just the basic information and then load from there. I could be misreading, but your code flows well. dump.txt These only seem to exist for these plugins but I haven’t dove too far into all of them. These also don’t exist in the Linux or Windows counterparts from the Github runner builds.

I have it in a separate branch, but upgrading glslang from 11.8.0 to 11.13.0 didn’t solve the shadertools plugin not loading issue. I’ve gotten some feedback from the BSD porting community on the dumps and outside of the iterator warning, they’re probably not related to the core cause. Main piece of feedback that stood out to me:

What I'm saying is valid syntax in one version of the SPIR-V compiler might not be valid in another. That does not necessarily mean you have to upgrade anything, but that might explain the observed difference between platforms.

Getting this solved would still possibly need some shader tweaks to get fully working.

You are not getting even close to shader compilation yet. If plugin “shadertools” will not loaded, it will not start to convert shaders. The update of GLSL version wiil not solve this problem. We need to understand what wrong with load.

graph-editor depending on uikit and qt.

I would like to improve CMake with your help if u don’t mind. It’s a good feedback from you! Thank you!

I think you should check dependencies for this plugins using ldd or analog on BSD platform. They all uses grapheditor module

Just got home from work. Here’s the BSD libraries, plugins and executables ldd logs. There’s nothing that’s linked wrong as far as I can see. ldd-logs.zip

ldd-exe.log

Ok seems like all dependencies were resolved. Then it’s missilery why it don’t loading =/

Yes it’s bit addictive =)

I can assume pipeline was not fully loaded. Could you check if pipeline tools plugin loaded? Pipeline is a special game resource which describes the order to render image and tasks were needed to render it.

.embedded doesn’t exist on disk. It’s just alias which points to files in “resources” directory. I have added it to separate game project resources from basic ones.

it’s not related Qt. Please check resources dir in SDK

Have added a checker. But I assume some standard resources was not installed properly because of CMake build

Seems like the issue in Renderable::setMaterialsList some materials was nullptr and have not created an instance for it. Which leads to nullptr exception