Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8406

TGHSlider crash when start=end

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: 6.06/08
    • Fix Version/s: 6.10/00
    • Component/s: GUI
    • Labels:
      None
    • Environment:

      Linux Ubuntu 16.04

      Description

      When the user sets wrong start-end range position of a TGHSlider, a crash occurs. I suggest adding some input safety checks or managed exception throw in the function SetRange, or when actually Drawing.

      Another thing is that SetPosition(10) does not complain if the range is eg between 0 and 5. (At least it does not crash). Maybe some error output is needed there also? I guess similar things happen with TGNumberEntry etc.

      //Within a TGMainFrame derived class
      	TGHSlider* temp = new TGHSlider(this,100,kDoubleScaleBoth,0,kHorizontalFrame,fSettingsFrame->GetBackground());
      	temp->SetRange(0,0);
      	AddFrame(temp, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 1, 1));
       
      	MapSubwindows();
      	Resize(GetDefaultSize());
      	MapWindow();	
       

      Here the stack trace (which is regenerated once per second or so, when trying to redraw)

       *** Break *** floating point exception
       
       
       
      ===========================================================
      There was a crash.
      This is the entire stack trace of all threads:
      ===========================================================
      #0  0x00007fcadb66864a in waitpid () from /lib/x86_64-linux-gnu/libc.so.6
      #1  0x00007fcadb5e1fab in ?? () from /lib/x86_64-linux-gnu/libc.so.6
      #2  0x00007fcadc1d4b54 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x16f24f0) at /opt/rootb/root6_src/core/unix/src/TUnixSystem.cxx:2116
      #3  TUnixSystem::StackTrace (this=0x16f24f0) at /opt/rootb/root6_src/core/unix/src/TUnixSystem.cxx:2403
      #4  0x00007fcadc1d74cc in TUnixSystem::DispatchSignals (this=0x16f24f0, sig=kSigFloatingException) at /opt/rootb/root6_src/core/unix/src/TUnixSystem.cxx:3661
      #5  <signal handler called>
      #6  0x00007fcac774b1dd in TGHSlider::DoRedraw (this=0x318dbc0) at /opt/rootb/root6_src/gui/gui/src/TGSlider.cxx:390
      #7  0x00007fcac7730c80 in TGClient::DoRedraw (this=0x2f2dce0) at /opt/rootb/root6_src/gui/gui/src/TGClient.cxx:801
      #8  0x00007fcac77312a8 in TGClient::ProcessOneEvent (this=0x2f2dce0) at /opt/rootb/root6_src/gui/gui/src/TGClient.cxx:666
      #9  0x00007fcac773132d in TGClient::HandleInput (this=0x2f2dce0) at /opt/rootb/root6_src/gui/gui/src/TGClient.cxx:698
      #10 0x00007fcadc1d7d68 in TUnixSystem::DispatchOneEvent (this=0x16f24f0, pendingOnly=<optimized out>) at /opt/rootb/root6_src/core/unix/src/TUnixSystem.cxx:1066
      #11 0x00007fcadc0c9034 in TSystem::InnerLoop (this=0x16f24f0) at /opt/rootb/root6_src/core/base/src/TSystem.cxx:408
      #12 0x00007fcadc0c7b6f in TSystem::Run (this=0x16f24f0) at /opt/rootb/root6_src/core/base/src/TSystem.cxx:358
      #13 0x00007fcadc0e05df in TApplication::Run (this=this
      entry=0x173daf0, retrn=retrn
      entry=false) at /opt/rootb/root6_src/core/base/src/TApplication.cxx:1153
      #14 0x00007fcadc51e317 in TRint::Run (this=this
      entry=0x173daf0, retrn=retrn
      entry=false) at /opt/rootb/root6_src/core/rint/src/TRint.cxx:463
      #15 0x000000000040106c in main (argc=1, argv=0x7ffe2821d088) at /opt/rootb/root6_src/main/src/rmain.cxx:30
      ===========================================================
       
       
      The lines below might hint at the cause of the crash.
      You may get help by asking at the ROOT forum http://root.cern.ch/forum.
      Only if you are really convinced it is a bug in ROOT then please submit a
      report at http://root.cern.ch/bugs. Please post the ENTIRE stack trace
      from above as an attachment in addition to anything else
      that might help us fixing this issue.
      ===========================================================
      #6  0x00007fcac774b1dd in TGHSlider::DoRedraw (this=0x318dbc0) at /opt/rootb/root6_src/gui/gui/src/TGSlider.cxx:390
      #7  0x00007fcac7730c80 in TGClient::DoRedraw (this=0x2f2dce0) at /opt/rootb/root6_src/gui/gui/src/TGClient.cxx:801
      #8  0x00007fcac77312a8 in TGClient::ProcessOneEvent (this=0x2f2dce0) at /opt/rootb/root6_src/gui/gui/src/TGClient.cxx:666
      #9  0x00007fcac773132d in TGClient::HandleInput (this=0x2f2dce0) at /opt/rootb/root6_src/gui/gui/src/TGClient.cxx:698
      #10 0x00007fcadc1d7d68 in TUnixSystem::DispatchOneEvent (this=0x16f24f0, pendingOnly=<optimized out>) at /opt/rootb/root6_src/core/unix/src/TUnixSystem.cxx:1066
      #11 0x00007fcadc0c9034 in TSystem::InnerLoop (this=0x16f24f0) at /opt/rootb/root6_src/core/base/src/TSystem.cxx:408
      #12 0x00007fcadc0c7b6f in TSystem::Run (this=0x16f24f0) at /opt/rootb/root6_src/core/base/src/TSystem.cxx:358
      #13 0x00007fcadc0e05df in TApplication::Run (this=this
      entry=0x173daf0, retrn=retrn
      entry=false) at /opt/rootb/root6_src/core/base/src/TApplication.cxx:1153
      #14 0x00007fcadc51e317 in TRint::Run (this=this
      entry=0x173daf0, retrn=retrn
      entry=false) at /opt/rootb/root6_src/core/rint/src/TRint.cxx:463
      #15 0x000000000040106c in main (argc=1, argv=0x7ffe2821d088) at /opt/rootb/root6_src/main/src/rmain.cxx:30
      ===========================================================

        Attachments

          Activity

            People

            Assignee:
            bellenot Bertrand Bellenot
            Reporter:
            2e7f1fb192878048ddc9 Fernando Hueso González
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Actual End: