TCanvas fails in 6.36 with web-browser

I recently tried to upgrade to ROOT 6.36.000. It compiled fine. The cmake and make logs are in
root-6.36.00.cmake.txt (13.7 KB) and root-6.36.00.make.txt (555.6 KB)

After the successful build and install, I tried to open a TCanvas with the simple
root [0] TCanvas a
crashes. The complete error message is in myRoot.txt (5.9 KB). I have not been able to find much to go on here, except that
root [0] TBrowser a
works perfectly, and opens the TBrowser in a web browser window. I had presumed that the first thing TBrowser would do would be to open a TCanvas, but apparently there is more to it.

I’m running Mac OSX 15.5 and Xcode 16.4.

Thanks,

Paul

   ------------------------------------------------------------------
  | Welcome to ROOT 6.36.000                       https://root.cern |
  | (c) 1995-2025, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosxarm64 on Jun 18 2025, 22:42:11                   |
  | From tags/6-36-000@6-36-000                                      |
  | With Apple clang version 17.0.0 (clang-1700.0.13.5)              |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

ROOT Version: 6.36.000
Platform: macosxarm64
Compiler: Apple clang version 17.0.0 (clang-1700.0.13.5)

I guess @linev can help

Solution with a question:

Short answer:
Using the option --web solves the problem (see transcript below)

root --web            
   ------------------------------------------------------------------
  | Welcome to ROOT 6.36.000                       https://root.cern |
  | (c) 1995-2025, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosxarm64 on Jun 18 2025, 22:42:11                   |
  | From tags/6-36-000@6-36-000                                      |
  | With Apple clang version 17.0.0 (clang-1700.0.13.5)              |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

rootLogon
(int) 1
root [0] TCanvas c
Info in <THttpEngine::Create>: Starting HTTP server on port 127.0.0.1:9282
(TCanvas &) Name: c1 Title: c1
root [1] TH2D *my2d = new TH2D("my2d", "my2d", 100, 0, 1, 100, 0, 1)
(TH2D *) 0x12f00e800
root [2] my2d->Draw()
root [3] .q

Question: If --web is the default, as I can see by it opening TBrowser correctly, why do I need to specify that option on the command line if I open TCanvas? I am puzzled by the difference in behavior between TBrowser and TCanvas in terms of the simple opening of a canvas. Not a problem, since I will just redefine my root alias to include --web, but curious?

Long answer:
Following @couet’s reply, I looked at @linev’s post <TBrowser::TBrowser>: The ROOT browser cannot run in batch mode - #3 by linev. There I see that specifying a server and port with the --web=server:port option might be a useful idea. It worked somewhat, in that I had to open a browser (did not automatically appear) and go to the web site printed after the TCanvas call before the TCanvas call timed out. Then I could draw on that canvas.

root [0] TCanvas c
Info in <THttpEngine::Create>: Starting HTTP server on port 127.0.0.1:9898
New web window: http://localhost:9898/win1/?key=5a78e0ae-9c816620-0da8db97-4d460f9a-523e16fc-63f0b5ca-c252eac2-0249c657#52620503-0ac0503c-eb262a91-528834e2-4eb7f603-055ff6cf-f0aab3e3-3863227f
(TCanvas &) Name: c1 Title: c1

This prompted me to try it without specifying the server:port.

Paul

Hi Paul,

Grate that you found a solution which works for you.
But can we investigate a bit - why it does not work by default?
Can you start root and check if it automatically goes in batch mode?
Just start root without any arguments and type:

root [0] gROOT->IsBatch()

For me it returns false.
And for you?

Regards,
Sergey

IsBatch is false.

   ------------------------------------------------------------------
  | Welcome to ROOT 6.36.000                       https://root.cern |
  | (c) 1995-2025, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosxarm64 on Jun 18 2025, 22:42:11                   |
  | From tags/6-36-000@6-36-000                                      |
  | With Apple clang version 17.0.0 (clang-1700.0.13.5)              |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

rootLogon
(int) 1
root [0] gROOT->IsBatch()
(bool) false
root [1] 

Hi,

Then ROOT behaves as it supposed. By default it shows new web-based TBrowser,
but still classical TCanvas. And If I understand correctly - you have crash when running TCanvas.
Using root --web just switches you to newer web-based canvas.

From your myRoot.txt one can see that problem is in libpng.
There are several posts on the forum having similar problem on mac:

Maybe installation of libpng and re-build of ROOT will help you.

Regards,
Sergey