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

Have Seg Fault in TestGuis and TestPhysics #12

Closed
Hideman85 opened this issue Aug 9, 2018 · 11 comments
Closed

Have Seg Fault in TestGuis and TestPhysics #12

Hideman85 opened this issue Aug 9, 2018 · 11 comments

Comments

@Hideman85
Copy link

Hello team,

First of all, I'm looking for c++ 3D Engine with Vulkan backend and I find your project really interesting.
I would like to compare performance and code abstraction between Banshee3D and your project to choose which engine I would use for my development.

So I already compile and try some samples with Banshee3D framework but I cannot launch your tests.

Platform: Linux Debian 9
Compilation command: mkdir build && cd build && cmake .. && make -j4
I also linked your resources in your Build/bin directory.
And when I run ./TestGuis or ./TestPhysics just get Seg Fault and nothing else.

I don't have any log so it's hard to find why.
So should I do other steps?

Regards.

@mattparks
Copy link
Member

Thank you for this issue, I believe a std::vector is used for its size and data for creating a Vulkan object. Oddly on Linux (GCC from my experience) it is destroyed before Vulkan finishes the command resulting in a segfault. I will resolve this issue as soon as I can.

@Hideman85
Copy link
Author

Thanks in advance for your time.

@mattparks
Copy link
Member

I believe that seg faults in Linux are fixed, some std::vectors were automatically deleted before Vulkan was finished using them. However, animations produce an assertion failure, and 50% of the time depth formats appear messed up (I will be fixing this soon).

@Hideman85
Copy link
Author

Hi,

Yes Segfault is solve, I'm really happy in test Physics I have 110FPS but no physics was demonstrated.
Gui has some bugs too, first nothing was displayed in the center area and some overlapping text in left bottom corner.

And when I closed the app (close button of the window) I have Segfault.

I took some screenshots for you:

image

image

Ho second run of physics I have the scene with objects:
image

@mattparks
Copy link
Member

Can you check if the latest commit fixes the display issue, also what kind of GPU does your computer have? Closing the display will still cause a seg fault, but rendering should be fixed.

@Hideman85
Copy link
Author

Hideman85 commented Aug 11, 2018

It's worse...

TestGuis -> First run does not response and even if I force kill (kill -9) it doesn't stop...
---> Second run direct Segfault, no display and nothing else.

TestPhysics -> Does not work (Segfault - no display) too but produce logs:

./TestPhysics 
INTEL-MESA: warning: Haswell Vulkan support is incomplete
Working Directory: PARENT_DIR/Acid/Build/bin
Failed to locate: 'Objects/Testing/Albedo.png'
File does not exist: ''
Failed to locate: 'Objects/Testing/Albedo.png'

Directory:

.
├── Brdf.png
├── Fonts
│   └── ProximaNova
│       ├── Bold.fnt
│       ├── Bold.otf
│       ├── Bold.png
│       ├── Light.fnt
│       ├── Light.otf
│       ├── Light.png
│       ├── Regular.fnt
│       ├── Regular.otf
│       ├── Regular.png
│       ├── Semibold.fnt
│       ├── Semibold.otf
│       ├── Semibold.png
│       ├── Thin.fnt
│       ├── Thin.otf
│       └── Thin.png
├── Guis
│   ├── Black.png
│   ├── Button.png
│   ├── Cursor.png
│   ├── Gradient.png
│   └── White.png
├── Logos
│   ├── Equilibrium-01.png
│   ├── Equilibrium-02.png
│   ├── Equilibrium-07.png
│   ├── Equilibrium-08.png
│   ├── Flask-02.png
│   ├── Flask.icns
│   ├── Flask.ico
│   ├── Flask.png
│   └── Flask.png.ico
├── Objects
│   ├── Animated
│   │   ├── Diffuse.png
│   │   ├── Model.blend
│   │   ├── Model.blend1
│   │   ├── Model.dae
│   │   └── Model_Test.dae
│   ├── Moon
│   │   └── Moon.xml
│   ├── Player
│   │   ├── Model.dae
│   │   └── Player.xml
│   ├── SkyboxChapel
│   │   ├── Back.png
│   │   ├── Bottom.png
│   │   ├── Front.png
│   │   ├── Left.png
│   │   ├── license.txt
│   │   ├── Right.png
│   │   ├── SkyboxChapel.json
│   │   └── Top.png
│   ├── SkyboxClouds
│   │   ├── Back.png
│   │   ├── Bottom.png
│   │   ├── Front.png
│   │   ├── Left.png
│   │   ├── Right.png
│   │   ├── SkyboxClouds.json
│   │   └── Top.png
│   ├── SkyboxSnowy
│   │   ├── Back.png
│   │   ├── Bottom.png
│   │   ├── Front.png
│   │   ├── Left.png
│   │   ├── license.txt
│   │   ├── Right.png
│   │   ├── SkyboxSnowy.json
│   │   └── Top.png
│   ├── Sun
│   │   └── Sun.xml
│   ├── Testing
│   │   ├── Diffuse.png
│   │   ├── Material.png
│   │   ├── Model_Dragon.obj
│   │   ├── Model_Meta.obj
│   │   ├── Model_Mitsuba.obj
│   │   ├── Model.obj
│   │   ├── Model_Tea.obj
│   │   ├── Normal.png
│   │   └── Testing.json
│   └── TreePine
│       ├── Diffuse.png
│       ├── Model.obj
│       ├── Sway.png
│       └── TreePine.json
├── Particles
│   └── Circular.png
├── Resources
│   ├── Fonts
│   │   └── ProximaNova
│   │       ├── Bold.fnt
│   │       ├── Bold.otf
│   │       ├── Bold.png
│   │       ├── Light.fnt
│   │       ├── Light.otf
│   │       ├── Light.png
│   │       ├── Regular.fnt
│   │       ├── Regular.otf
│   │       ├── Regular.png
│   │       ├── Semibold.fnt
│   │       ├── Semibold.otf
│   │       ├── Semibold.png
│   │       ├── Thin.fnt
│   │       ├── Thin.otf
│   │       └── Thin.png
│   ├── Guis
│   │   ├── Black.png
│   │   ├── Button.png
│   │   ├── Cursor.png
│   │   ├── Gradient.png
│   │   └── White.png
│   ├── Logos
│   │   ├── Equilibrium-01.png
│   │   ├── Equilibrium-02.png
│   │   ├── Equilibrium-07.png
│   │   ├── Equilibrium-08.png
│   │   ├── Flask-02.png
│   │   ├── Flask.icns
│   │   ├── Flask.ico
│   │   ├── Flask.png
│   │   └── Flask.png.ico
│   ├── Objects
│   │   ├── Animated
│   │   │   ├── Albedo.png
│   │   │   ├── Model.blend
│   │   │   ├── Model.blend1
│   │   │   ├── Model.dae
│   │   │   └── Model_Test.dae
│   │   ├── Moon
│   │   │   └── Moon.xml
│   │   ├── Player
│   │   │   ├── Model.dae
│   │   │   └── Player.xml
│   │   ├── SkyboxChapel
│   │   │   ├── Back.png
│   │   │   ├── Bottom.png
│   │   │   ├── Front.png
│   │   │   ├── Left.png
│   │   │   ├── license.txt
│   │   │   ├── Right.png
│   │   │   ├── SkyboxChapel.json
│   │   │   └── Top.png
│   │   ├── SkyboxClouds
│   │   │   ├── Back.png
│   │   │   ├── Bottom.png
│   │   │   ├── Front.png
│   │   │   ├── Left.png
│   │   │   ├── Right.png
│   │   │   ├── SkyboxClouds.json
│   │   │   └── Top.png
│   │   ├── SkyboxSnowy
│   │   │   ├── Back.png
│   │   │   ├── Bottom.png
│   │   │   ├── Front.png
│   │   │   ├── Left.png
│   │   │   ├── license.txt
│   │   │   ├── Right.png
│   │   │   ├── SkyboxSnowy.json
│   │   │   └── Top.png
│   │   ├── Sun
│   │   │   └── Sun.xml
│   │   ├── Testing
│   │   │   ├── Albedo.png
│   │   │   ├── Material.png
│   │   │   ├── Model_Dragon.obj
│   │   │   ├── Model_Meta.obj
│   │   │   ├── Model_Mitsuba.obj
│   │   │   ├── Model.obj
│   │   │   ├── Model_Tea.obj
│   │   │   ├── Normal.png
│   │   │   └── Testing.json
│   │   └── TreePine
│   │       ├── Albedo.png
│   │       ├── Model.obj
│   │       ├── Sway.png
│   │       └── TreePine.json
│   ├── Particles
│   │   └── Circular.png
│   ├── Shaders
│   │   ├── Brdf.comp
│   │   ├── Defaults
│   │   │   ├── Default.frag
│   │   │   └── Default.vert
│   │   ├── Deferred
│   │   │   ├── Deferred.frag
│   │   │   └── Deferred.vert
│   │   ├── Filters
│   │   │   ├── BlurHorizontal.frag
│   │   │   ├── BlurVertical.frag
│   │   │   ├── Crt.frag
│   │   │   ├── Darken.frag
│   │   │   ├── Default.frag
│   │   │   ├── Default.vert
│   │   │   ├── Emboss.frag
│   │   │   ├── Fxaa.frag
│   │   │   ├── Grain.frag
│   │   │   ├── Grey.frag
│   │   │   ├── Lensflare.frag
│   │   │   ├── Negative.frag
│   │   │   ├── Pixel.frag
│   │   │   ├── Sepia.frag
│   │   │   ├── Tiltshift.frag
│   │   │   ├── Tone.frag
│   │   │   └── Wobble.frag
│   │   ├── Fonts
│   │   │   ├── Font.frag
│   │   │   └── Font.vert
│   │   ├── Guis
│   │   │   ├── Gui.frag
│   │   │   └── Gui.vert
│   │   ├── Ibl.comp
│   │   ├── Lighting.glsl
│   │   ├── Noise.glsl
│   │   ├── Particles
│   │   │   ├── Particle.frag
│   │   │   └── Particle.vert
│   │   ├── Shadows
│   │   │   ├── Shadow.frag
│   │   │   └── Shadow.vert
│   │   └── Skyboxes
│   │       ├── Skybox.frag
│   │       └── Skybox.vert
│   ├── Sounds
│   │   ├── Button1.ogg
│   │   ├── Jump.ogg
│   │   ├── Music
│   │   │   ├── Hiitori-Bocchi.ogg
│   │   │   └── Outpost.ogg
│   │   └── Screenshot.ogg
│   ├── Undefined2.png
│   ├── Undefined.obj
│   └── Undefined.png
├── Shaders
│   ├── Brdf.comp
│   ├── Defaults
│   │   ├── Default.frag
│   │   └── Default.vert
│   ├── Deferred
│   │   ├── Deferred.frag
│   │   └── Deferred.vert
│   ├── Filters
│   │   ├── BlurHorizontal.frag
│   │   ├── BlurVertical.frag
│   │   ├── Crt.frag
│   │   ├── Darken.frag
│   │   ├── Default.frag
│   │   ├── Default.vert
│   │   ├── Emboss.frag
│   │   ├── Fxaa.frag
│   │   ├── Grain.frag
│   │   ├── Grey.frag
│   │   ├── Lensflare.frag
│   │   ├── Negative.frag
│   │   ├── Pixel.frag
│   │   ├── Sepia.frag
│   │   ├── Tiltshift.frag
│   │   ├── Tone.frag
│   │   └── Wobble.frag
│   ├── Fonts
│   │   ├── Font.frag
│   │   └── Font.vert
│   ├── Guis
│   │   ├── Gui.frag
│   │   └── Gui.vert
│   ├── Ibl.comp
│   ├── Lighting.glsl
│   ├── Noise.glsl
│   ├── Particles
│   │   ├── Particle.frag
│   │   └── Particle.vert
│   ├── Pipeline.glsl
│   ├── Shadows
│   │   ├── Shadow.frag
│   │   └── Shadow.vert
│   └── Skyboxes
│       ├── Skybox.frag
│       └── Skybox.vert
├── Sounds
│   ├── Button1.ogg
│   ├── Jump.ogg
│   ├── Music
│   │   ├── Hiitori-Bocchi.ogg
│   │   └── Outpost.ogg
│   └── Screenshot.ogg
├── TestGuis
├── TestMaths
├── TestPhysics
├── Undefined2.png
├── Undefined.obj
└── Undefined.png

Graphic cards:
Integrated Intel HD graphics
Amd Radeon HD8500M / M230

Currently use both.

@mattparks
Copy link
Member

In the readme contains a resources section that describes how to create symblinks for engine resources, resources are searched for in the binary location. If it is already linked the working directory found might be broken: https://github.com/Equilibrium-Games/Acid/blob/411d00ed36700933d9abd2b5783d0d809a7f2883/Sources/Helpers/FileSystem.cpp#L125. There are still depth buffer issues in Linux, and lighting is slightly broken in the engine.

@Hideman85
Copy link
Author

Your script is not update...

#!/usr/bin/env bash
cd ../

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
mkdir "${SCRIPTPATH}/Build/Debug/bin/Resources"
mkdir "${SCRIPTPATH}/Build/Release/bin/Resources"
ln -s "${SCRIPTPATH}/Resources" "${SCRIPTPATH}/Build/Debug/bin/Resources/Engine"
ln -s "${SCRIPTPATH}/Resources" "${SCRIPTPATH}/Build/Release/bin/Resources/Engine"
ln -s "${SCRIPTPATH}/Resources" "${SCRIPTPATH}/Build/RelWithDebInfo/bin/Resources/Engine"

I don't have Debug / Realease / RelWithDebInfo in Build dir, I just have bin and lib dirs.
So I just do:

mkdir Build/bin/Resources
cd Build/bin/Resources
ln -s ../../../Resources/ Engine

Test can be launch with no problem but I don't have the scene and nothing in the center white box in TestGuis

@Hideman85
Copy link
Author

Hideman85 commented Aug 15, 2018

I read CMakeLists.txt and find the way to active debug mode so I ran it on debug mode, there is logs:
https://pastebin.com/WSjBgPD0

Staktrace:
image

@mattparks
Copy link
Member

I think I may have this fixed now, it is strange that some object lifetimes in Vulkan last longer on Windows and shorter on Linux.

@Hideman85
Copy link
Author

Yes works, some strange light but scene was rendered fine.

image

I also note that my FPS was decrease but I think it's normal because I have some objects to render ;)

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

2 participants