View Issue Details

IDProjectCategoryView StatusLast Update
0002414NoesisGUIC++ SDKpublic2022-09-13 12:43
Reporterjack.barkov Assigned Tojsantos  
PrioritynormalSeveritycrash 
Status resolvedResolutionfixed 
Product Version3.1.5 
Fixed in Version3.1.6 
Summary0002414: Crash - NoesisApp::GLRenderDevice::DestroyBuffer
Description

I have a bug when I close an application using the OpenGL render.

The crash happens in Noesis::GUI::Shutdown() => GLRenderDevice::DestroyBuffer(DynamicBuffer& buffer);

I was able to reproduce the crash using:

  • Windows 7
  • Android (only tested on arm64)
  • iPhone 13 Pro Max

On my main machine, I use a Windows 11, where the crash does not happen.

I managed to generate a dump in vs2022 with the same error happening in your Samples.HelloWorld.

I also put the exes/pdbs so you can open the dmp and see exactly the error.

Link:
https://drive.google.com/file/d/1lmwTUw8KPbS4r3IbBldiqv9Ji0n8o5Vi/view?usp=sharing

Attached here is a print of a crash on windows (samples.helloworld) and one on android (my test application).

Thanks.

Steps To Reproduce

Open and close the Sample.HelloWorld using OpenGL renderer.

Attached Files
android.jpg (286,660 bytes)
win7.jpg (494,940 bytes)
PlatformAny

Activities

jsantos

jsantos

2022-09-09 15:25

manager   ~0008059

The attached minidump seems to be a different thing. And instead of a crash it is a debugger breakpoint


ntdll.dll!77eceabe() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!77ecf9f1() Unknown

Noesis.dll!Noesis::RenderDevice::OnDestroy() Line 267 C++
NoesisApp.dll!NoesisApp::Application::~Application() Line 53 C++
Samples.HelloWorld.exe!HelloWorld::App::~App() C++
Samples.HelloWorld.exe!HelloWorld::App::`scalar deleting destructor'(unsigned int) C++
Noesis.dll!Noesis::BaseRefCounted::OnDestroy() Line 57 C++
NoesisApp.dll!Noesis::Ptr<NoesisApp::Application>::Reset() Line 156 C++
NoesisApp.dll!NoesisApp::ApplicationLauncher::OnExit() Line 122 C++
NoesisApp.dll!NoesisApp::DisplayLauncher::Run() Line 49 C++
Samples.HelloWorld.exe!NsMain(int argc, char argv) Line 81 C++
Samples.HelloWorld.exe!WinMain(HINSTANCE * formal, HINSTANCE * formal, char * formal, int formal) Line 36 C++

jsantos

jsantos

2022-09-09 15:33

manager   ~0008060

But don't worry about it. I think I found something wrong. I will send you a patch soon.

jsantos

jsantos

2022-09-09 20:19

manager   ~0008062

Could you please try changing the implementation of GLRenderDevice::DestroyBuffer to


void GLRenderDevice::DestroyBuffer(DynamicBuffer& buffer) const
{
Dealloc(buffer.cpuMemory);

if (HaveBufferStorage())
{
    if (buffer.currentPage)
    {
        V(glDeleteBuffers(1, &buffer.currentPage->object));
        V(glDeleteSync(buffer.currentPage->sync));
        Dealloc(buffer.currentPage);
    }

    for (Page* page = buffer.pendingPages; page != nullptr;)
    {
        Page* next = page->next;
        V(glDeleteBuffers(1, &page->object));
        V(glDeleteSync(page->sync));
        Dealloc(page);
        page = next;
    }
}

for (Page* page = buffer.freePages; page != nullptr;)
{
    Page* next = page->next;
    V(glDeleteBuffers(1, &page->object));
    V(glDeleteSync(page->sync));
    Dealloc(page);
    page = next;
}

}

jack.barkov

jack.barkov

2022-09-10 00:37

reporter   ~0008063

This code snippet solved the problem.
I tested it on Android and Windows.

Thank you!

Issue History

Date Modified Username Field Change
2022-09-08 22:08 jack.barkov New Issue
2022-09-08 22:08 jack.barkov File Added: android.jpg
2022-09-08 22:08 jack.barkov File Added: win7.jpg
2022-09-09 15:06 jsantos Assigned To => jsantos
2022-09-09 15:06 jsantos Status new => assigned
2022-09-09 15:25 jsantos Note Added: 0008059
2022-09-09 15:33 jsantos Note Added: 0008060
2022-09-09 20:19 jsantos Note Added: 0008062
2022-09-09 20:20 jsantos Status assigned => feedback
2022-09-10 00:37 jack.barkov Note Added: 0008063
2022-09-10 00:37 jack.barkov Status feedback => assigned
2022-09-13 12:43 jsantos Status assigned => resolved
2022-09-13 12:43 jsantos Resolution open => fixed
2022-09-13 12:43 jsantos Fixed in Version => 3.1.6