Skip to content

Crash in TROOT::EndOfProcessCleanups if created a classic TRootBrowser in python session through c++ #21912

@will-cern

Description

@will-cern

Check duplicate issues.

  • Checked for duplicates

Description

This a minimal reproducer (I think) of an issue I have been seeing with the xRooBrowser, which uses the classic TRootBrowser for its interface still. This reproducer uses just ROOT classes though, so I dont think its an xRooFit issue at its heart.
The issue seems to be that when the ListOfBrowsers is deleted, the TCanvasImp from the canvas in the browser gets deleted, but the pointer held by the TCanvas object doesn't get zeroed. Strangely, if one Deletes the Browsers list from the python prompt, the imp is zeroed (see reproducer below)
I am trying to figure out the best solution to this problem here, but thought I'd post the problem in case someone else can figure out the right solution.

Reproducer

import ROOT
ROOT.gInterpreter.ProcessLine("gEnv->SetValue(\"Browser.Name\", \"TRootBrowser\"); auto b = new TBrowser")
exit()

crashes inside TROOT::EndOfProcessCleanups() at the stage where it deletes the Canvases

But the following will work fine:

import ROOT
ROOT.gInterpreter.ProcessLine("gEnv->SetValue(\"Browser.Name\", \"TRootBrowser\"); auto b = new TBrowser")
ROOT.gROOT.GetListOfBrowsers().Delete()
exit()

ROOT version

master

Installation method

build from source

Operating system

MacOS (at least)

Additional context

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions