You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#8 0x00007fd6cf22b8c2 in TGCompositeFrame::TGCompositeFrame (this=0x56036dc34a10, p=0x0, w=10, h=10, options=3, back=0) at ../../../root_dbg/gui/gui/src/TGFrame.cxx:853
#9 0x00007fd6cf22d4cc in TGMainFrame::TGMainFrame (this=0x56036dc34a10, p=0x0, w=10, h=10, options=2) at ../../../root_dbg/gui/gui/src/TGFrame.cxx:1430
#10 0x00007fd6d64b9a6c in TTreeViewer::TTreeViewer (this=0x56036dc34a10, tree=0x56036d05df80) at ../../../root_dbg/tree/treeviewer/src/TTreeViewer.cxx:349
#11 0x00007fd6d809e059 in ?? ()
#12 0x000056036c1be340 in ?? ()
#13 0x000056036c1be340 in ?? ()
#14 0x000056036dc34a10 in ?? ()
#15 0x000056036dc34a10 in ?? ()
#16 0x00007fff775fd220 in ?? ()
#17 0x00007fff775fd3d8 in ?? ()
#18 0x00007fff775fdc20 in ?? ()
#19 0x00007fff775fd3f8 in ?? ()
#20 0x00000001775fd3e0 in ?? ()
#21 0x0000000000000000 in ?? ()
Expected behavior
The crash is due to a nullptr dereference in TGCompositeFrame::TGCompositeFrame (fParent is null), which in turn is caused by a failed check in TGWindow::TGWindow at TGWindow.cxx:54:
if (!p && gClient) {
p = gClient->GetRoot();
}
In the condition above, if the user created no TApplication, gClient is false-y.
Rather than crash and burning, we could detect the situation and produce a helpful error message.
Additional context
At least one user could have used a better error message 😄
The text was updated successfully, but these errors were encountered:
Should fix ROOT crashes with no helpful error messages if a TApplication is not present and tree->StartViewer() is called. Now it prints the following warning:
```
Warning in <TTreePlayer::StartViewer>: The tree viewer cannot run in batch mode
```
…e->StartViewer() is called (#6752)
* Fix Github issue #6743
Should fix ROOT crashes with no helpful error messages if a TApplication is not present and tree->StartViewer() is called. Now it prints the following warning:
```
Warning in <TTreePlayer::StartViewer>: The tree viewer cannot run in batch mode
```
* Use `gSystem->Exit()` instead of `std::exit()` as suggested by Philippe
…sent and tree->StartViewer() is called (root-project#6752)
* Fix Github issue root-project#6743
Should fix ROOT crashes with no helpful error messages if a TApplication is not present and tree->StartViewer() is called. Now it prints the following warning:
```
Warning in <TTreePlayer::StartViewer>: The tree viewer cannot run in batch mode
```
* Use `gSystem->Exit()` instead of `std::exit()` as suggested by Philippe
Describe the bug
The following reproducer crashes with the stacktrace below (with a debug build of ROOT -- just a segfault for non-debug builds):
Expected behavior
The crash is due to a nullptr dereference in
TGCompositeFrame::TGCompositeFrame
(fParent
is null), which in turn is caused by a failed check inTGWindow::TGWindow
atTGWindow.cxx:54
:In the condition above, if the user created no
TApplication
,gClient
is false-y.Rather than crash and burning, we could detect the situation and produce a helpful error message.
Additional context
At least one user could have used a better error message 😄
The text was updated successfully, but these errors were encountered: