View Issue Details

IDProjectCategoryView StatusLast Update
0002487NoesisGUIC++ SDKpublic2023-03-27 12:14
ReporterLogris Assigned Tojsantos  
PrioritynormalSeverityblock 
Status assignedResolutionopen 
Product Version3.2.0 
Target Version3.2 
Summary0002487: (3.20b1) Noesis::Shutdown() crashes
Description

https://www.noesisengine.com/forums/viewtopic.php?t=2837&sid=c0a18aa6c93c94b8f8cb1d651bbd14e1

minidump
https://drive.google.com/file/d/1IqJidZX5cA75qySJGuZzP0fiOuzeg985/view?usp=share_link

PlatformWindows

Relationships

related to 0002483 assignedjsantos Memory leak removing Font provider 

Activities

jsantos

jsantos

2023-01-10 13:31

manager   ~0008196

Thanks for the report.

  1. Are you able to reproduce this in one of our examples?

  2. Could you please double check this is not happening with 3.1.6 ?

Logris

Logris

2023-01-10 17:40

reporter   ~0008199

  1. It is difficult
  2. Crashes after migration to version 3.2.0b1. The Application code has not changed.

You can provide a debug version Noesis_d.dll + Noesis_d.lib + Noesis_d.pdb?

sfernandez

sfernandez

2023-01-11 13:21

manager   ~0008201

Hi, would it be possible to get your application built, so we can execute it ourselves? That way we can use a debug version of Noesis and make changes to narrow the problem.

Logris

Logris

2023-01-11 14:28

reporter   ~0008203

The debug version will be enough app.exe + MinimumContent?

sfernandez

sfernandez

2023-01-11 16:12

manager   ~0008204

Yes, whatever minimum files that are needed to launch your application, and that crash on shutdown, would be enough, thanks.

Logris

Logris

2023-01-15 13:36

reporter   ~0008209

https://drive.google.com/file/d/1oU1W5K0-dCxV059D6-B5ZuK5MbKI7iUj/view?usp=sharing

Run app - start.bat

We have implemented a multi-window interface with WindowEx class.
For these purposes, we have slightly changed the code NoesisApp::D3D11RenderContext::Init()
Each window has its own NoesisApp::D3D11RenderContext but all NoesisApp::D3D11RenderContext use one Noesis::RenderDevice (singleton).
Perhaps because of this crash.

in Noesis 2 - 3.1.6 it works fine

sfernandez

sfernandez

2023-01-16 18:38

manager   ~0008211

I was able to fix the crash inside Shutdown and generated a new patched library: https://drive.google.com/file/d/1OakiKAz5w8IOMfyHR3meWPnWeKg6SbHk/view?usp=share_link

Anyway, before Shutdown was called I hit an assert while debugging caused by releasing a BaseRefCounted object that was already deleted. Adding some logs it looks it was the RenderDevice. You should verify that you are not deleting the RenderDevice object while there are Ptr still holding a reference.
And also, after Noesis Shutdown finished, some code in your Engine.dll was trying to get the name of a type (Type::GetName()) when all types were already deleted, so it was also crashing.
Let me know if you can fix those issues and then everything closes as expected.

jsantos

jsantos

2023-01-17 18:24

manager   ~0008219

Last edited: 2023-01-17 18:24

Just a clarification, if you store the renderer in a Ptr<> it will be automatically destroyed. It is dangerous to invoke manual deletes on BaseComponent instances.

If you want to make sure the instance is being destroyed you can do something like:


int32_t refs = obj->Release();
assert(refs == 0);

Logris

Logris

2023-01-18 17:16

reporter   ~0008222

Hello
Patched the build completes successfully.

The negative number of refs was due to
//mRenderer.Reset();
mRenderer->Release();
in D3D11RenderContext::Shutdown()
I did not hesitate to change Reset to Release, but I had to remove this line.

There was another problem. Leaks.
NOESIS[W]: Memory leaks detected: 4112 bytes.

The error appeared in this build.

jsantos

jsantos

2023-01-19 14:15

manager   ~0008226

I can't repro this in our examples. Could you isolate this because I would say, the leaks are real.

Logris

Logris

2023-01-19 20:22

reporter   ~0008231

Noesis::GUI::SetFontDefaultProperties(11.f, FontWeight_Light,
FontStretch::FontStretch_Normal, FontStyle::FontStyle_Normal);

Noesis::Init();

Noesis::Shutdown();
"NOESIS[I]: Noesis Shutdown.
NOESIS[W]: Memory leaks detected: 4112 bytes."

Noesis::Init();
Noesis::GUI::SetFontDefaultProperties(11.f, FontWeight_Light,
FontStretch::FontStretch_Normal, FontStyle::FontStyle_Normal);
Noesis::Shutdown();
Refs = 0!!!! OK

sfernandez

sfernandez

2023-01-20 11:41

manager   ~0008234

The leak comes from creating symbols before the call to Noesis::Init.
We'll analyze how to improve this.

jsantos

jsantos

2023-01-20 11:54

manager   ~0008236

The temp workaround is calling Noesis::GUI::SetFontDefaultProperties after Noesis::GUI::Init

Logris

Logris

2023-01-20 13:07

reporter   ~0008237

Ok, thanks.

Issue History

Date Modified Username Field Change
2023-01-10 09:40 Logris New Issue
2023-01-10 09:40 Logris Tag Attached: C++
2023-01-10 09:40 Logris Tag Attached: crash
2023-01-10 09:40 Logris Tag Attached: Directx11
2023-01-10 13:31 jsantos Assigned To => sfernandez
2023-01-10 13:31 jsantos Status new => assigned
2023-01-10 13:31 jsantos Target Version => 3.2.0
2023-01-10 13:31 jsantos Note Added: 0008196
2023-01-10 13:31 jsantos Status assigned => feedback
2023-01-10 17:40 Logris Note Added: 0008199
2023-01-10 17:40 Logris Status feedback => assigned
2023-01-11 13:21 sfernandez Status assigned => feedback
2023-01-11 13:21 sfernandez Note Added: 0008201
2023-01-11 14:28 Logris Note Added: 0008203
2023-01-11 14:28 Logris Status feedback => assigned
2023-01-11 16:12 sfernandez Note Added: 0008204
2023-01-11 16:12 sfernandez Status assigned => feedback
2023-01-15 13:36 Logris Note Added: 0008209
2023-01-15 13:36 Logris Status feedback => assigned
2023-01-16 18:38 sfernandez Status assigned => feedback
2023-01-16 18:38 sfernandez Note Added: 0008211
2023-01-17 18:24 jsantos Note Added: 0008219
2023-01-17 18:24 jsantos Note Edited: 0008219
2023-01-18 17:16 Logris Note Added: 0008222
2023-01-18 17:16 Logris Status feedback => assigned
2023-01-19 14:15 jsantos Note Added: 0008226
2023-01-19 20:22 Logris Note Added: 0008231
2023-01-20 11:04 sfernandez Relationship added related to 0002483
2023-01-20 11:40 sfernandez Assigned To sfernandez => jsantos
2023-01-20 11:41 sfernandez Note Added: 0008234
2023-01-20 11:54 jsantos Note Added: 0008236
2023-01-20 13:07 Logris Note Added: 0008237
2023-03-27 12:14 jsantos Target Version 3.2.0 => 3.2