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

Divisions by zero and other FPE #6344

Closed
andriish opened this issue Sep 12, 2020 · 62 comments
Closed

Divisions by zero and other FPE #6344

andriish opened this issue Sep 12, 2020 · 62 comments
Assignees

Comments

@andriish
Copy link
Contributor

Hi all,

recently I've tried to recompile an older code with ROOT GUI and to debug some crashes.
I've found that in many places the crashes occurred not in the code, but in the ROOT.
More specifically in the GUI library graf2d.
The backtrace looks typically like this

#5  0x00007fc5a101e282 in TPad::ExecuteEvent(int, int, int) (this=0x5960390, event=21, px=1031, py=120) at /usr/src/debug/root-6.22.02/graf2d/gpad/src/TPad.cxx:2149
#6  0x00007fc5a100442d in TCanvas::HandleInput(EEventType, int, int) (this=0x3566d70, event=kButton1Motion, px=637, py=120) at /usr/src/debug/root-6.22.02/graf2d/gpad/src/TCanvas.cxx:1291
#7  0x00007fc5a156c04b in TRootEmbeddedCanvas::HandleContainerMotion(Event_t*) (this=0x3565110, event=0x7ffe06062550) at /usr/src/debug/root-6.22.02/gui/gui/src/TRootEmbeddedCanvas.cxx:387
#8  0x00007fc5a14a19f1 in TGFrame::HandleEvent(Event_t*) (this=0x35665d0, event=0x7ffe06062550) at /usr/src/debug/root-6.22.02/gui/gui/src/TGFrame.cxx:531
#9  0x00007fc5a1458a48 in TGClient::HandleEvent(Event_t*) (this=0x2e17e80, event=0x7ffe06062550) at /usr/src/debug/root-6.22.02/gui/gui/src/TGClient.cxx:843
#10 0x00007fc5a1458f85 in TGClient::ProcessOneEvent() (this=this

I was able to trace the problem to the math operations performed in the TPad.cxx and TPavelabel.cxx and it looks in many cases there are simply divisions by zero.

e.g. in TPaveLabel.cxx instead of

   Double_t wh   = (Double_t)gPad->XtoPixel(gPad->GetX2());
   Double_t hh   = (Double_t)gPad->YtoPixel(gPad->GetY1());
   Double_t labelsize, textsize = GetTextSize();
   Int_t automat = 0;
   if (GetTextFont()%10 > 2) {  // fixed size font specified in pixels
      labelsize = GetTextSize();
   } else {
      if (TMath::Abs(textsize -0.99) < 0.001) automat = 1;
      if (textsize == 0)   { textsize = 0.99; automat = 1;}
      Int_t ypixel      = TMath::Abs(gPad->YtoPixel(y1) - gPad->YtoPixel(y2));
      labelsize = textsize*ypixel/hh;
      if (wh < hh) labelsize *= hh/wh;
   }

One can have

   Double_t wh   = gPad->XtoPixel(gPad->GetX2())==0?1.0:(Double_t)gPad->XtoPixel(gPad->GetX2());
   Double_t hh   = gPad->YtoPixel(gPad->GetY1())==0?1.0:(Double_t)gPad->YtoPixel(gPad->GetY1());
....

In the TPad.cxx there are many unsafe operations in the TPad::ExecuteEvent and TPad::Resize, e.g.

            // Compute new pad positions in the NDC space of parent
            fXlowNDC = Double_t(apx1 - parentpx1)/Double_t(parentpx2 - parentpx1);
            fYlowNDC = Double_t(apy1 - parentpy1)/Double_t(parentpy2 - parentpy1);
            fWNDC    = Double_t(apx2 - apx1)/Double_t(parentpx2 - parentpx1);
            fHNDC    = Double_t(apy2 - apy1)/Double_t(parentpy2 - parentpy1);

Would someone from developers be interested to look there ?

Best regards,

Andrii

@couet
Copy link
Member

couet commented Sep 14, 2020

Your comment is very valid. In the particular case you mentioned that would mean your TPaveLabel has wh ot ww = 0 ? so it won't be really useful. But I agree It should not crash. By chance do you have a simple reproducer ?

@andriish
Copy link
Contributor Author

Hi @couet ,

so it won't be really useful.

Yes. But the size is set during the execution of GUI.

By chance do you have a simple reproducer ?

Simple -- no. But in a scope of elimination of this issue I can provide an access to a private github repository with these codes.
The application itself is not large. Would that work for you?

Best regards,

Andrii

@couet
Copy link
Member

couet commented Sep 14, 2020

Well, I guess I can create a TPaveLabel with X2 = Y1 = 0;
Thanks.

@andriish
Copy link
Contributor Author

Hi @couet ,

OK.

In TPad the problem is a bit more elaborated.
At first the calculations of the new sizes are done and only after that the results are checked.
Here is a simple solution that I've tried.
https://github.com/root-project/root/compare/master...andriish:for_zevis?expand=1

Best regards,

Andrii

@couet
Copy link
Member

couet commented Sep 14, 2020

Ok, cannot reproduce it with a simple TPaveLabel:

root [0] auto p = new TPaveLabel(10.,0.,0.,10.,"test")
(TPaveLabel *) @0x7ffee68e8608
root [1] p->Draw()
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [2] 

@couet
Copy link
Member

couet commented Sep 14, 2020

Yes a reproducer with TPad would help me.

@andriish
Copy link
Contributor Author

The way to run:

cmake CMakeLists.txt -DCMAKE_INSTALL_PREFIX=where/to/install
make
make install
where/to/install/bin/zevis

Then just move some of the internal pads.

Best regards,

Andrii

@couet
Copy link
Member

couet commented Sep 15, 2020

Sorry, but where is the source code ?

@andriish
Copy link
Contributor Author

Hi @couet ,

I've send an invitation to you yesterday. But it is in pending state now. "Awaiting couet’s response ".
Do you see it?

Andrii

@couet
Copy link
Member

couet commented Sep 15, 2020

ok done ... thanks

@couet
Copy link
Member

couet commented Sep 15, 2020

git clone ssh://github.com/andriish/zevis.git
cd zevis
cmake .
make

gives me:

85 warnings and 1 error generated.

So it does not build.

@andriish
Copy link
Contributor Author

Hi @couet ,

what is the error? What is the build system ? There is CI with CentOS7 and CentOS8 and these work fine.
Could it be that the ROOT installation was not found by cmake?

Best regards,
Andrii

@couet
Copy link
Member

couet commented Sep 15, 2020

/Users/couet/git/zevis/ZevLib/src/ZCanvas.cxx:361:17: error: member access into incomplete type 'TCanvasImp'
      fCanvasImp->GetWindowGeometry(fWindowTopX, fWindowTopY,

I am on MacOS.

cmake gives me:

% cmake ../zevis
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- The C compiler identification is AppleClang 11.0.3.11030032
-- The Fortran compiler identification is GNU 8.2.0
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Check for working Fortran compiler: /usr/local/bin/gfortran
-- Check for working Fortran compiler: /usr/local/bin/gfortran  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/local/bin/gfortran supports Fortran 90
-- Checking whether /usr/local/bin/gfortran supports Fortran 90 -- yes
-- Performing Test COMPILER_SUPPORTS_-O1
-- Performing Test COMPILER_SUPPORTS_-O1 - Success
-- Performing Test COMPILER_SUPPORTS_-pipe
-- Performing Test COMPILER_SUPPORTS_-pipe - Success
-- Performing Test COMPILER_SUPPORTS_-g
-- Performing Test COMPILER_SUPPORTS_-g - Success
-- Performing Test COMPILER_SUPPORTS_-Wall
-- Performing Test COMPILER_SUPPORTS_-Wall - Success
-- ROOT_FOUND:     1
-- ROOT_USE_FILE /Users/couet/git/roottrunk-bin/ROOTUseFile.cmake
-- ROOT includes:  /Users/couet/git/roottrunk-bin/include
-- ROOT libraries: /Users/couet/git/roottrunk-bin/lib/libCore.so;/Users/couet/git/roottrunk-bin/lib/libImt.so;/Users/couet/git/roottrunk-bin/lib/libRIO.so;/Users/couet/git/roottrunk-bin/lib/libNet.so;/Users/couet/git/roottrunk-bin/lib/libHist.so;/Users/couet/git/roottrunk-bin/lib/libGraf.so;/Users/couet/git/roottrunk-bin/lib/libGraf3d.so;/Users/couet/git/roottrunk-bin/lib/libGpad.so;/Users/couet/git/roottrunk-bin/lib/libROOTDataFrame.so;/Users/couet/git/roottrunk-bin/lib/libTree.so;/Users/couet/git/roottrunk-bin/lib/libTreePlayer.so;/Users/couet/git/roottrunk-bin/lib/libRint.so;/Users/couet/git/roottrunk-bin/lib/libPostscript.so;/Users/couet/git/roottrunk-bin/lib/libMatrix.so;/Users/couet/git/roottrunk-bin/lib/libPhysics.so;/Users/couet/git/roottrunk-bin/lib/libMathCore.so;/Users/couet/git/roottrunk-bin/lib/libThread.so;/Users/couet/git/roottrunk-bin/lib/libMultiProc.so;/Users/couet/git/roottrunk-bin/lib/libGui.so;/Users/couet/git/roottrunk-bin/lib/libEG.so
-- ROOT definitions: 
-- Configuring done
CMake Warning (dev):
  Policy CMP0068 is not set: RPATH settings on macOS do not affect
  install_name.  Run "cmake --help-policy CMP0068" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility with older versions of CMake, the install_name fields for
  the following targets are still affected by RPATH settings:

   ZevLib

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/couet/git/zevis-build

@andriish
Copy link
Contributor Author

Hi @couet ,

zevis was never even compiled on mac.
Mac os support would be just a next step in my list. However I can try to do it immediately and put in CI.
Hopefully that will not take more than couple hours.

Best regards,

Andrii

@couet
Copy link
Member

couet commented Sep 15, 2020

No problem. We can continue to work on this issue once it will compile on Mac.

@andriish
Copy link
Contributor Author

Hi @couet ,

OK. that took a bit more than couple hours.

  • Now the code compiles on Mac
  • It does not require Fortran (So far on Mac, but one can use C++ only on Linux as well).
  • However, the code for the FPE handling on Mac is external.
  • On Mac the window crashes in the very beginning.
    It seems the reason is the same, but Mac graphics is is slightly different ( you know that much better tha me, of course).

Best regards,
Andrii

@couet
Copy link
Member

couet commented Sep 16, 2020

I just did a git pull to get the latest version.
Now I get:

$ make
/Applications/CMake.app/Contents/bin/cmake -S/Users/couet/git/zevis -B/Users/couet/git/zevis-build --check-build-system CMakeFiles/Makefile.cmake 0
/Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start /Users/couet/git/zevis-build/CMakeFiles /Users/couet/git/zevis-build/CMakeFiles/progress.marks
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/ZevLib.dir/build.make CMakeFiles/ZevLib.dir/depend
[  1%] Generating G__ZevLib.cxx, libZevLib_rdict.pcm, libZevLib.rootmap
/Applications/CMake.app/Contents/bin/cmake -E env LD_LIBRARY_PATH=/Users/couet/git/couet-root-bin/lib:/Users/couet/git/couet-root-bin/lib /Users/couet/git/couet-root-bin/bin/rootcling -v2 -f G__ZevLib.cxx -s /Users/couet/git/zevis-build/libZevLib.dylib -rml libZevLib.dylib -rmf /Users/couet/git/zevis-build/libZevLib.rootmap -inlineInputHeader -IZevLib/inc -I/Users/couet/git/couet-root-bin/include -I/Users/couet/git/zevis ZevLib/dict/ZevLib_Classes.hh /Users/couet/git/zevis/ZevLib/dict/LinkDef.hh
input_line_12:3:10: fatal error: 'ZFTD.h' file not found
#include "ZFTD.h"
         ^~~~~~~~
Error: /Users/couet/git/couet-root-bin/bin/rootcling: compilation failure (/Users/couet/git/zevis-build/libZevLib99e3c8e971_dictUmbrella.h)
make[2]: *** [G__ZevLib.cxx] Error 1
make[1]: *** [CMakeFiles/ZevLib.dir/all] Error 2
make: *** [all] Error 2

@andriish
Copy link
Contributor Author

Hi @couet ,

That is very strange, as the file clealy exists in the include directory in the repository. The CI on mac also compiles the code.
Could it be that the file was deleted localy?

Best regards,

Andrii

@couet
Copy link
Member

couet commented Sep 16, 2020

I did a fresh git clone:

% git clone ssh://github.com/andriish/zevis.git

Cloning into 'zevis'...
remote: Enumerating objects: 880, done.
remote: Counting objects: 100% (880/880), done.
remote: Compressing objects: 100% (529/529), done.
remote: Total 880 (delta 344), reused 839 (delta 311), pack-reused 0
Receiving objects: 100% (880/880), 5.36 MiB | 8.56 MiB/s, done.
Resolving deltas: 100% (344/344), done.

% mkdir zevis-build
% cd zevis-build
 
% cmake ../zevis
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- The C compiler identification is AppleClang 11.0.3.11030032
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test COMPILER_SUPPORTS_-O1
-- Performing Test COMPILER_SUPPORTS_-O1 - Success
-- Performing Test COMPILER_SUPPORTS_-pipe
-- Performing Test COMPILER_SUPPORTS_-pipe - Success
-- Performing Test COMPILER_SUPPORTS_-g
-- Performing Test COMPILER_SUPPORTS_-g - Success
-- Performing Test COMPILER_SUPPORTS_-Wall
-- Performing Test COMPILER_SUPPORTS_-Wall - Success
-- ROOT_FOUND:     1
-- ROOT_USE_FILE /Users/couet/git/couet-root-bin/ROOTUseFile.cmake
-- ROOT includes:  /Users/couet/git/couet-root-bin/include
-- ROOT libraries: /Users/couet/git/couet-root-bin/lib/libCore.so;/Users/couet/git/couet-root-bin/lib/libImt.so;/Users/couet/git/couet-root-bin/lib/libRIO.so;/Users/couet/git/couet-root-bin/lib/libNet.so;/Users/couet/git/couet-root-bin/lib/libHist.so;/Users/couet/git/couet-root-bin/lib/libGraf.so;/Users/couet/git/couet-root-bin/lib/libGraf3d.so;/Users/couet/git/couet-root-bin/lib/libGpad.so;/Users/couet/git/couet-root-bin/lib/libROOTDataFrame.so;/Users/couet/git/couet-root-bin/lib/libTree.so;/Users/couet/git/couet-root-bin/lib/libTreePlayer.so;/Users/couet/git/couet-root-bin/lib/libRint.so;/Users/couet/git/couet-root-bin/lib/libPostscript.so;/Users/couet/git/couet-root-bin/lib/libMatrix.so;/Users/couet/git/couet-root-bin/lib/libPhysics.so;/Users/couet/git/couet-root-bin/lib/libMathCore.so;/Users/couet/git/couet-root-bin/lib/libThread.so;/Users/couet/git/couet-root-bin/lib/libMultiProc.so;/Users/couet/git/couet-root-bin/lib/libGui.so;/Users/couet/git/couet-root-bin/lib/libEG.so
-- ROOT definitions: 
-- ROOT_LIBRARIES_LOCATION: /Users/couet/git/couet-root-bin/lib
-- Configuring done
CMake Warning (dev):
  Policy CMP0068 is not set: RPATH settings on macOS do not affect
  install_name.  Run "cmake --help-policy CMP0068" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility with older versions of CMake, the install_name fields for
  the following targets are still affected by RPATH settings:

   ZevLib

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/couet/git/zevis-build

 % make
/Applications/CMake.app/Contents/bin/cmake -S/Users/couet/git/zevis -B/Users/couet/git/zevis-build --check-build-system CMakeFiles/Makefile.cmake 0
/Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start /Users/couet/git/zevis-build/CMakeFiles /Users/couet/git/zevis-build/CMakeFiles/progress.marks
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/ZevLib.dir/build.make CMakeFiles/ZevLib.dir/depend
[  1%] Generating G__ZevLib.cxx, libZevLib_rdict.pcm, libZevLib.rootmap
/Applications/CMake.app/Contents/bin/cmake -E env LD_LIBRARY_PATH=/Users/couet/git/couet-root-bin/lib:/Users/couet/git/couet-root-bin/lib /Users/couet/git/couet-root-bin/bin/rootcling -v2 -f G__ZevLib.cxx -s /Users/couet/git/zevis-build/libZevLib.dylib -rml libZevLib.dylib -rmf /Users/couet/git/zevis-build/libZevLib.rootmap -inlineInputHeader -IZevLib/inc -I/Users/couet/git/couet-root-bin/include -I/Users/couet/git/zevis ZevLib/dict/ZevLib_Classes.hh /Users/couet/git/zevis/ZevLib/dict/LinkDef.hh
input_line_12:3:10: fatal error: 'ZFTD.h' file not found
#include "ZFTD.h"
         ^~~~~~~~
Error: /Users/couet/git/couet-root-bin/bin/rootcling: compilation failure (/Users/couet/git/zevis-build/libZevLib560a827c25_dictUmbrella.h)
make[2]: *** [G__ZevLib.cxx] Error 1
make[1]: *** [CMakeFiles/ZevLib.dir/all] Error 2
make: *** [all] Error 2


@andriish
Copy link
Contributor Author

OK, I see. The current CMakeLists.txt works only with in source builds.

In source build should work. Will fix it meanwhile.

@andriish
Copy link
Contributor Author

Out of source build is in master and CI.

@couet
Copy link
Member

couet commented Sep 16, 2020

I did an git pull. It seems to work better

@couet
Copy link
Member

couet commented Sep 16, 2020

I still get an error:

/Users/couet/git/zevis/ZevLib/src/ZCanvas.cxx:361:17: error: member access into incomplete type 'TCanvasImp'
      fCanvasImp->GetWindowGeometry(fWindowTopX, fWindowTopY,

@andriish
Copy link
Contributor Author

Hi @couet ,

I see.
The relevant include was removed from the TCanvas.h in the ROOT master, but it is present in 6.22, so CI works.
( It is quite unexpected, as TCanvasImp is used in the TCanvas class definitions, so one could expect the TCanvas.h includes TCanvasImp.h)

As a workaround I've put the TCanvasImp.h in the ZCanvas.cxx.

Best regards,

Andrii

@couet
Copy link
Member

couet commented Sep 16, 2020

It compiles now. But I get may warnings. Are you interested ?

@andriish
Copy link
Contributor Author

Are you interested ?

Yes, sure!
But here I have to apologize for these warnings. The code was designed many years ago for the root5+handwritten makefiles+old compilers and the first thing I did sometime ago after the migration to root6+cmake was to ensure it compiles on RedHat and debug crashes.... Most of the warnings can be fixed easily.

Best regards,
Andrii

@couet
Copy link
Member

couet commented Sep 16, 2020

warnings.log

@couet
Copy link
Member

couet commented Sep 17, 2020

I get something different now:

% ../zevis-build/bin/zevis
OSTYPE=darwin19
Variable ZARCH_TYPE is not set, looking for zevis.exe in the same directory

and it blocks at that point. Nothing happens ... It I need to hit CRTL-C

@andriish
Copy link
Contributor Author

Ok.

I have

OSTYPE=darwin17
Variable ZARCH_TYPE is not set, looking for zevis.exe in the same directory
Warning in <TInterpreter::ReadRootmapFile>: class  ZWebInfo found in libZevLib.dylib  is already in libZCNClient.dylib 
Warning in <TClassTable::Add>: class ZWebInfo already in TClassTable

 *** Break *** floating point exception
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -[NSPlaceholderNumber initWithDouble:] (no debug info)
[/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore] +[CALayer defaultValueForKey:] (no debug info)
[/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore] classDescription_locked(objc_class*) (no debug info)
[/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore] classDescription_locked(objc_class*) (no debug info)
[/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore] classDescription_locked(objc_class*) (no debug info)
[/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore] classDescription(objc_class*) (no debug info)
[/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore] CA::Layer::class_state(objc_class*) (no debug info)
[/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore] -[CALayer init] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[_NSBackingLayer init] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[NSView makeBackingLayer] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[NSView(NSInternal) _createLayerAndInitialize] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[NSView _updateLayerBackedness] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[NSView didChangeValueForKey:] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] __49-[NSThemeFrame _floatTitlebarAndToolbarFromInit:]_block_invoke (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] +[NSAnimationContext runAnimationGroup:] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[NSThemeFrame _floatTitlebarAndToolbarFromInit:] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[NSThemeFrame initWithFrame:styleMask:owner:] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[NSWindow _commonInitFrame:styleMask:backing:defer:] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[NSWindow _initContent:styleMask:backing:defer:contentView:] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[NSWindow initWithContentRect:styleMask:backing:defer:] (no debug info)
[/Users/andriish/Projects/zevis/root/lib/libGCocoa.6.22.02.so] -[QuartzWindow initWithContentRect:styleMask:backing:defer:windowAttributes:] (no debug info)
[/Users/andriish/Projects/zevis/root/lib/libGCocoa.6.22.02.so] ROOT::MacOSX::X11::CreateTopLevelWindow(int, int, unsigned int, unsigned int, unsigned int, int, unsigned int, void*, SetWindowAttributes_t*, unsigned int) (no debug info)
[/Users/andriish/Projects/zevis/root/lib/libGCocoa.6.22.02.so] TGCocoa::CreateWindow(unsigned long, int, int, unsigned int, unsigned int, unsigned int, int, unsigned int, void*, SetWindowAttributes_t*, unsigned int) (no debug info)
[/Users/andriish/Projects/zevis/root/lib/libGui.6.22.so] TGWindow::TGWindow(TGWindow const*, int, int, unsigned int, unsigned int, unsigned int, int, unsigned int, void*, SetWindowAttributes_t*, unsigned int) (no debug info)
[/Users/andriish/Projects/zevis/root/lib/libGui.6.22.so] TGFrame::TGFrame(TGWindow const*, unsigned int, unsigned int, unsigned int, unsigned long) (no debug info)
[/Users/andriish/Projects/zevis/root/lib/libGui.6.22.so] TGCompositeFrame::TGCompositeFrame(TGWindow const*, unsigned int, unsigned int, unsigned int, unsigned long) (no debug info)
[/Users/andriish/Projects/zevis/root/lib/libGui.6.22.so] TGMainFrame::TGMainFrame(TGWindow const*, unsigned int, unsigned int, unsigned int) (no debug info)
[/Users/andriish/Projects/zevis/some/install/dir/bin/zevis.exe] ZClient::ZClient(TGWindow const*, char const*, unsigned int, unsigned int, char const*, int, char**) /Users/andriish/Projects/zevis/ZCNClient/src/ZClient.cxx:340
[/Users/andriish/Projects/zevis/some/install/dir/bin/zevis.exe] main /Users/andriish/Projects/zevis/ZCNClient/src/main.cxx:225
[/usr/lib/system/libdyld.dylib] start (no debug info)

I will try to find darwin19 in house, but I'm not sure we have it.

Andrii

@andriish
Copy link
Contributor Author

Ok.

  • Hard to say why the executable is not running on your mac. Could you, prease, also remove from the home folder files like .zevis-bla-bla-root ? Maybe that is the reason.
  • Menawhile I've added to CI a test that runs the executable in batch mode.
  • Works fine for CentOS7 and CentOS8. But not for Newest mac on CI. And not on my old mac.
    In both cases there are FPEs:
+ export CNDATAPREFIX=/Users/runner/work/zevis/zevis/build/../ZCNClient/eventlist_rootfiles/
+ CNDATAPREFIX=/Users/runner/work/zevis/zevis/build/../ZCNClient/eventlist_rootfiles/
++ pwd
++ pwd
+ /Users/runner/work/zevis/zevis/build/../some/install/dir/bin/zevis -b /Users/runner/work/zevis/zevis/build/../ZCNClient/eventlist_examples/45783_10.txt someout png
OSTYPE=darwin19
Variable ZARCH_TYPE is not set, looking for zevis.exe in the same directory
Warning in <TInterpreter::ReadRootmapFile>: class  ZWebInfo found in libZevLib.dylib  is already in libZCNClient.dylib 
Warning in <TClassTable::Add>: class ZWebInfo already in TClassTable
Using ZEVISDIR=/Users/runner/work/zevis/zevis/some/install/dir/share/zevis
Using CNDATAPREFIX=/Users/runner/work/zevis/zevis/build/../ZCNClient/eventlist_rootfiles/
Warning: fgets returned 0
Event list prepared, it is OK and contains 1 entries
Opening /Users/runner/work/zevis/zevis/build/../ZCNClient/eventlist_rootfiles/z/ntup/03/v08b/data/root/data_03_45783_45790_01.root
Error in <TStreamerInfo::Build>: TPolyLine3D, discarding: float* fP, illegal [3*fN] Array of 3-D coordinates  (x,y,z)

Error in <TStreamerInfo::Build>: ZPolygon2D, discarding: float* fP, illegal [3*fN] Points in world coordinates


 *** Break *** floating point exception
Opening /Users/runner/work/zevis/zevis/build/../ZCNClient/eventlist_rootfiles/z/ntup/03/v08b/data/root/data_03_45783_45790_01.root
Entry 1: runnr=45783, eventnr=10, inputtree=orange, cnversion=v08b, scan=1 took 0.48 seconds ......... OK
It took 0 seconds, average time per event 0.48
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/Users/runner/work/zevis/zevis/root/lib/libCore.6.22.02.so] TColor::SetRGB(float, float, float) (no debug info)
[/Users/runner/work/zevis/zevis/some/install/dir/lib/libZevLib.dylib] ZStyle::rootColorFromRGB(int, int, int) /Users/runner/work/zevis/zevis/ZevLib/src/ZStyle.cxx:110
[/Users/runner/work/zevis/zevis/some/install/dir/lib/libZevLib.dylib] ZStyleScheme::ZStyleScheme(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /Users/runner/work/zevis/zevis/ZevLib/src/ZStyleScheme.cxx:0
[/Users/runner/work/zevis/zevis/some/install/dir/lib/libZevLib.dylib] ZCanvas::DefineColors() /Users/runner/work/zevis/zevis/ZevLib/src/ZCanvas.cxx:0
[/Users/runner/work/zevis/zevis/some/install/dir/lib/libZevLib.dylib] ZCanvas::ZCanvas(char const*) /Users/runner/work/zevis/zevis/ZevLib/src/ZCanvas.cxx:279
[/Users/runner/work/zevis/zevis/some/install/dir/bin/zevis.exe] RunBatchMode(TApplication*) /Users/runner/work/zevis/zevis/ZCNClient/src/main.cxx:313
[/Users/runner/work/zevis/zevis/some/install/dir/bin/zevis.exe] main /Users/runner/work/zevis/zevis/ZCNClient/src/main.cxx:216
[/usr/lib/system/libdyld.dylib] start (no debug info)
[<unknown binary>] (no debug info)
##[error]Process completed with exit code 140.

@andriish
Copy link
Contributor Author

That looks like there are divisions by zero in the TColor class. But I'm not sure why these are not present on Linux.

@couet
Copy link
Member

couet commented Sep 17, 2020

What is the "home folder" ? can you be more precise ? it do not see such files in the top of the the GitHub repo nor in the build folder.

@andriish
Copy link
Contributor Author

"home folder" -- $HOME. /Users/couet , I suspect.

@andriish
Copy link
Contributor Author

The files could be created during the execution of zevis.

@andriish
Copy link
Contributor Author

Hi @couet ,

I can reproduce the FPE in a standalone short code. Just send the code to you by mail.

Best regards,
Andrii

@couet
Copy link
Member

couet commented Sep 17, 2020

I do not have such files in $HOME

@couet
Copy link
Member

couet commented Sep 17, 2020

I got you file colour.cxx... How to use it ?

@andriish
Copy link
Contributor Author

On Mac

clang++ color.cxx $(root-config --glibs --cflags --libs) -o color
./color

on Linux with gcc

g++ color.cxx $(root-config --glibs --cflags --libs) -o color
./color

@couet
Copy link
Member

couet commented Sep 17, 2020

I see the crash. I investigate.

@couet
Copy link
Member

couet commented Sep 17, 2020

Actually not ... I had a mismatch with the new Xcode. I have reinstalled ROOT. And now your program does not crash.

@andriish
Copy link
Contributor Author

There is no Xcode12 binaries here https://root.cern.ch/releases/release-62202/ so I cannot test that quick.
CI with root by Xcode11 has this crash in zevis. Versions match there.
I see this crash locally with Xcode10. Again, no mismatch.
That makes sense to open a separate issue on this.

Meanwhile, is that is not possible run zevis on specific mac, maybe you have linux around?

Best regards,
Andrii

@couet
Copy link
Member

couet commented Sep 17, 2020

I can try a linux machine........ It would be easier for me to be able to run it on my Mac though ...

@andriish
Copy link
Contributor Author

It would be easier for me to be able to run it on my Mac though ...

That is my final goal as well. But it looks it makes sense to chop this issue into smaller pieces which can be reproduced easier.
In a minute I will put the TPad issue.

Best regards,
Andrii

@andriish
Copy link
Contributor Author

Hi @couet ,

In the end the crashes observed in three classes, so the relevant issues are

#6373
#6374
#6375

Hopefully this will make it easier to deal with them.

Why these cannot be reproduced on Mac might be a bug on its own.
What configuration do you use to compile root on mac?

Best regards,

Andrii

@couet
Copy link
Member

couet commented Sep 17, 2020

I am now installing root on ubuntu to try your codes.

@andriish
Copy link
Contributor Author

Which ubuntu version do you plan to use?
I will try to the same to be in sync.

Andrii

@couet
Copy link
Member

couet commented Sep 17, 2020

$ uname -a
Linux root-ubuntu-2004-2 5.4.0-33-generic #37-Ubuntu SMP Thu May 21 12:53:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

@andriish
Copy link
Contributor Author

Hi @couet ,

are there chances to have some fixes for #6373 #6374 #6375 #6379 in the next (patch) releases?

  • If that helps: here are some things that I've tried in the past:
    master...andriish:for_zevis

  • Unfortunately, for me it is hard to develop for me on Mac. The hadrware with Mac I have is not a match to the hardware with Linux. I can try to improve the situation, but well, the FPEs have the same origin on all platforms...

  • Meanwhile, if you check these issues on Linux, is there a way to help you?

Best regards,

Andrii

@couet
Copy link
Member

couet commented Sep 21, 2020

I hope so. Sorry but I was busy with an other issue (axis labels on TH3) which I guess i fixed now.

@andriish
Copy link
Contributor Author

Hi @couet ,

I'm closing this issue as it has been split into smaller issues and many of these are already solved.

Best regards and many thanks,

Andrii

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants