Crash closing application with macos

Dear all,

I am developing a program based on a TApplication. I just switched to macos, and I get a crash when closing the main window. Actually, if I open only the main window, I can close it without error, but if I open the main window, then click on a button to open a second window, then close this second window and finally close the main window, ROOT crash with this error message:

2020-01-13 17:11:30.581285+0100 Cubix[63028:750117] Fatal error: requested non-existing drawable 1169

2020-01-13 17:11:30.581368+0100 Cubix[63028:750117] This window not found among allocated/deleted drawables

Using a debugger, I found that this is coming from the line:

NSView<X11Window> * const view = fPimpl->GetWindow(wid).fContentView;

in the file

Any idea ?

-ROOT Version:_ 6-18-04
Platform: macos
Compiler: Not Provided

From what I found on the web, it seems to be related to cocoa. I tried to install root using the option -Dx11=ON -Dcocoa=OFF, but I have the following error, that I did not succeed to correct:

In file included from /Users/dudouet/Softs/ROOT/root/graf3d/glew/src/glew.c:49:
include/GL/glxew.h:94:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>

After copying /opt/X11/include/X11/* include/X11/ of my build directory, the Xlib.h error is solved, but I now have the following error:

[140/2089] Linking C shared library lib/
FAILED: lib/ 
: && /Library/Developer/CommandLineTools/usr/bin/cc -m64 -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments -pthread -O2 -g -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -dynamiclib -Wl,-headerpad_max_install_names -m64 -single_module -Wl,-dead_strip_dylibs  -o lib/ -install_name @rpath/ graf3d/glew/CMakeFiles/GLEW.dir/src/glew.c.o  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/OpenGL.tbd  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/OpenGL.tbd  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/OpenGL.tbd && :
Undefined symbols for architecture x86_64:
  "_glXGetClientString", referenced from:
      _glxewGetExtension in glew.c.o
  "_glXQueryVersion", referenced from:
      _glxewContextInit in glew.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Let’s stay with Cocoa for the time being. We will need a reproducer to fix this - can you provide us with one?


So, by trying to create a piece of code that could reproduce the problem, I found a solution. The second window that I am opening contains an object of class CXCanvas, inherited from TCanvas. To use it I was doing:

    fRootCanvas = new TRootEmbeddedCanvas("NCCanvas", Main);
    Main->AddFrame(fRootCanvas, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 5, 5));
    Int_t canvasid = fRootCanvas->GetCanvasWindowId();
    fCanvas = new CXCanvas("NuclearChartCanvas", 10, 10,canvasid);

This is actually the part that made all crashed. To avoid the crash when exiting ROOT, I had to add:

delete fRootCanvas->GetCanvas();

before: Int_t canvasid = fRootCanvas->GetCanvasWindowId();

But I never had this error before, on linux computers.



This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.