Error : Trying to access a pointer that points to an invalid memory address

Hi,

I have a subclass of TGMainFrame and I try to connect the CloseWindow() to a method and I get a crash :

#11 0x00007f75d0fb687b in cling::IncrementalExecutor::runStaticInitializersOnce(cling::Transaction const&) () from /afs/cern.ch/user/b/bvonhall/dev/alice/sw/slc7_x86-64/ROOT/v6-14-00+git_77868d9d46-1/lib/libCling.so
#12 0x00007f75d0f56c0b in cling::Interpreter::executeTransaction(cling::Transaction&) () from /afs/cern.ch/user/b/bvonhall/dev/alice/sw/slc7_x86-64/ROOT/v6-14-00+git_77868d9d46-1/lib/libCling.so
#13 0x00007f75d0fc5fa3 in cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraits<cling::Transaction*>, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraits<cling::Transaction*> > >&, bool) () from /afs/cern.ch/user/b/bvonhall/dev/alice/sw/slc7_x86-64/ROOT/v6-14-00+git_77868d9d46-1/lib/libCling.so
#14 0x00007f75d0fc604b in cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) () from /afs/cern.ch/user/b/bvonhall/dev/alice/sw/slc7_x86-64/ROOT/v6-14-00+git_77868d9d46-1/lib/libCling.so
#15 0x00007f75d0f54b21 in cling::Interpreter::DeclareInternal(std::string const&, cling::CompilationOptions const&, cling::Transaction**) const () from /afs/cern.ch/user/b/bvonhall/dev/alice/sw/slc7_x86-64/ROOT/v6-14-00+git_77868d9d46-1/lib/libCling.so
#16 0x00007f75d0f54bf3 in cling::Interpreter::parseForModule(std::string const&) () from /afs/cern.ch/user/b/bvonhall/dev/alice/sw/slc7_x86-64/ROOT/v6-14-00+git_77868d9d46-1/lib/libCling.so
#17 0x00007f75d0ec5cea in ExecAutoParse (what=<optimized out>, header=header
entry=false, interpreter=0xf16e10) at /home/local/alice/sw/SOURCES/ROOT/v6-14-00+git_77868d9d46/77868d9d46aefa79abbe34776c3617c80c48374b/core/metacling/src/TCling.cxx:5649
#18 0x00007f75d0ec6385 in TCling::AutoParseImplRecurse (this=this
entry=0xf15ec0, cls=<optimized out>, cls
entry=0x23875e0 "o2::quality_control::gui::SpyMainFrame", topLevel=topLevel
entry=true) at /home/local/alice/sw/SOURCES/ROOT/v6-14-00+git_77868d9d46/77868d9d46aefa79abbe34776c3617c80c48374b/core/metacling/src/TCling.cxx:5754
#19 0x00007f75d0ec69b1 in TCling::AutoParse (this=0xf15ec0, cls=0x23875e0 "o2::quality_control::gui::SpyMainFrame") at /home/local/alice/sw/SOURCES/ROOT/v6-14-00+git_77868d9d46/77868d9d46aefa79abbe34776c3617c80c48374b/core/metacling/src/TCling.cxx:5836
#20 0x00007f75e6d2ecee in TClass::LoadClassInfo (this=0x2387b30) at /home/local/alice/sw/SOURCES/ROOT/v6-14-00+git_77868d9d46/77868d9d46aefa79abbe34776c3617c80c48374b/core/meta/src/TClass.cxx:5557
#21 0x00007f75e6d2fa95 in TClass::GetMethodWithPrototype (this=this
entry=0x2387b30, method=method
entry=0x23fcfa0 "CloseWindow", proto=proto
entry=0x23fcfac "", objectIsConst=objectIsConst
entry=false, mode=mode
entry=ROOT::kConversionMatch) at /home/local/alice/sw/SOURCES/ROOT/v6-14-00+git_77868d9d46/77868d9d46aefa79abbe34776c3617c80c48374b/core/meta/src/TClass.cxx:4272
#22 0x00007f75e6c934f1 in (anonymous namespace)::GetMethodWithPrototype (nargs=<synthetic pointer>: <optimized out>, proto=0x23fcfac "", method=0x23fcfa0 "CloseWindow", cl=0x2387b30) at /home/local/alice/sw/SOURCES/ROOT/v6-14-00+git_77868d9d46/77868d9d46aefa79abbe34776c3617c80c48374b/core/base/src/TQObject.cxx:160
#23 TQObject::CheckConnectArgs (sender=sender
entry=0x23853a0, sender_class=0x2387b30, signal=signal
entry=0x7fffeae839a9 "CloseWindow()", receiver_class=receiver_class
entry=0x2387b30, slot=slot
entry=0x7fffeae839c9 "close()") at /home/local/alice/sw/SOURCES/ROOT/v6-14-00+git_77868d9d46/77868d9d46aefa79abbe34776c3617c80c48374b/core/base/src/TQObject.cxx:216
#24 0x00007f75e6c958e0 in TQObject::Connect (this=this
entry=0x23853a0, signal=signal
entry=0x7f75e17d10e3 "CloseWindow()", receiver_class=receiver_class
entry=0x7f75e17d1180 "o2::quality_control::gui::SpyMainFrame", receiver=receiver
entry=0x2385350, slot=slot
entry=0x7f75e17d10db "close()") at /home/local/alice/sw/SOURCES/ROOT/v6-14-00+git_77868d9d46/77868d9d46aefa79abbe34776c3617c80c48374b/core/base/src/TQObject.cxx:881
#25 0x00007f75e179bc20 in o2::quality_control::gui::SpyMainFrame::SpyMainFrame (this=0x2385350, spyDevice=<optimized out>, configurationSource=...) at /home/local/alice/sw/SOURCES/QualityControl/master/0/Framework/src/SpyMainFrame.cxx:66
#26 0x0000000000403041 in main (argc=<optimized out>, argv=<optimized out>) at /home/local/alice/sw/SOURCES/QualityControl/master/0/Framework/src/qcSpy.cxx:38
terminate called after throwing an instance of 'cling::InvalidDerefException'
  what():  Trying to access a pointer that points to an invalid memory address.
Aborted

It used to work , not sure when it stopped to be honest.

The line that crashes :

Connect("CloseWindow()", "o2::quality_control::gui::SpyMainFrame", this, "close()");

And the definition of the close method :

class SpyMainFrame: public TGMainFrame
{
  public:
    void close();

I am not sure what this error means. Which pointer is it talking about ? this ?
Thank you in advance for your help
Barth


_ROOT Version: v6-14-00-53-g77868d9
_Platform: CC7
_Compiler: GCC 7.3.1


Hi Barth,

This may happen if the SpyMainFrame has been deleted in the meanwhile. Do you have a running piece of code reproducing the crash?

Cheers, Bertrand.

Hi Bertrand,
The Connect is called within the constructor so the object should be alive (there are no extra threads running).
I do not have a running piece of code but will try to produce one.
Thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.