Official / Bugs and Crash Reports / NRGEditor crashes on NPK file unpacking
<Back to Bugs and Crash Reports Total Post: 5     Register or Login to post.
Joined: Jul, 2023
Total Post: 2
mindbound
NRGEditor crashes on NPK file unpacking
Posted on: Jul. 09 2023 12:06 pm
On Arch Linux, NRGEditor crashes with a segmentation fault upon unpacking a project.

GDB backtrace:

(gdb) bt
#0  __pthread_clockjoin_ex (threadid=0, thread_return=0x0, clockid=0,
    abstime=0x0, block=true) at pthread_join_common.c:43
#1  0x0000000000f16e6a in ThreadStop ()
#2  0x0000000000f16e90 in ThreadDestroy ()
#3  0x00000000005ef6d6 in IdeShutdown ()
#4  0x000000000058310d in switchProfile ()
#5  0x0000000000583260 in drawFrame ()
#6  0x000000000058235b in EGLwindowRenderLoop ()
#7  0x000000000057ffce in main ()


LDD output:

linux-vdso.so.1 (0x00007f4709574000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f4709489000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f4709346000)
libOpenAL.so => ./libOpenAL.so (0x00007f4709282000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f4709000000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f4708f13000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f4708eee000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f4708d04000)
/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f4709576000)
libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007f4708c4c000)
libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007f4708c1a000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f4708bef000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f470927b000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f4708be5000)


This happens both with the official pre-built Linux version and with a fresh build off of the latest stable source. Please advise.


Re: NRGEditor crashes on NPK file unpacking
Posted on: Jul. 09 2023 12:16 pm
Can you give it a shot on ubuntu with in debug with GDB enabled... and tell me which line cause the crash specifically. Also I  would like to know which .npk you are trying to extract. Do not try to extract the publishing NPK, they are not NRG project files just source code and libraries used by the publishing phase to output a stand alone executable.
Joined: Jan, 2021
Total Post: 2
nrgmaster


Joined: Jul, 2023
Total Post: 2
mindbound
Re: NRGEditor crashes on NPK file unpacking
Posted on: Jul. 09 2023 12:20 pm
Turns out that it crashes on starting a new project as well.

I currently don't have Ubuntu on hand but I will try it later. The default build doesn't include debug symbols, what would be the correct way of enabling them in CMakeLists?

The SIGSEGV seems to get received on

__pthread_clockjoin_ex (threadid=0, thread_return=0x0, clockid=0, abstime=0x0, block=true) at pthread_join_common.c:43
Backtrace indicates that it occurs in IdeShutdown() call in switchProfile() call in drawFrame() in EGLwindowRenderLoop()


Re: NRGEditor crashes on NPK file unpacking
Posted on: Jul. 09 2023 12:28 pm
Ho! For that I would suggest you to use either Visual Studio Code or Code Blocks they would do all the work for you if you are not too familiar with using cmake directly. However what you can do it from the command line ie:


mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make


ps: Join us on discord if you need further help ;)
Joined: Jan, 2021
Total Post: 2
nrgmaster


Re: NRGEditor crashes on NPK file unpacking
Posted on: Jul. 09 2023 12:39 pm
Honestly the crash seems to happen in you pthread library... :(

Try to fence the call preventing handles of 0x0 (if any) to don't join:



void ThreadStop( Thread *thread )
{
    thread->next_state = kStop;

    if( thread->handle )
    {
        pthread_join(thread->handle,
                    NULL);
    }
   
    memset( &thread->handle,
            0,
            sizeof( pthread_t ) );
}
pthread should be standard, however it seems that from distro. to distro. it behaves slightly differently...
Joined: Jan, 2021
Total Post: 2
nrgmaster
<Back to Bugs and Crash Reports