предупреждение: неверный указатель памяти передан вызываемому: что это значит и как исправить - PullRequest
0 голосов
/ 03 февраля 2020

Я пытаюсь проанализировать некоторые данные. Для одного набора моих данных написанный мной код работает хорошо, то есть ошибок нет, результаты ожидаемые. Однако, если я использую тот же код на другом наборе похожих данных, я получаю эту ошибку:

 Generating stack trace...
 0x00007f46964680a0 in cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const + 0x380 from /home/cucip/builddir/lib/libCling.so
 0x00007f46963fae77 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) + 0xa7 from /home/cucip/builddir/lib/libCling.so
 0x00007f46963fc4df in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) + 0x1df from /home/cucip/builddir/lib/libCling.so
 0x00007f46964c61f1 in cling::MetaSema::actOnxCommand(llvm::StringRef, llvm::StringRef, cling::Value*) + 0x591 from /home/cucip/builddir/lib/libCling.so
 0x00007f46964d6084 in cling::MetaParser::isXCommand(cling::MetaSema::ActionResult&, cling::Value*) + 0x194 from /home/cucip/builddir/lib/libCling.so
 0x00007f46964d7476 in cling::MetaParser::isCommand(cling::MetaSema::ActionResult&, cling::Value*) + 0xa6 from /home/cucip/builddir/lib/libCling.so
 0x00007f46964bf64b in cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) + 0x10b from /home/cucip/builddir/lib/libCling.so
 0x00007f469637b68e in <unknown> from /home/cucip/builddir/lib/libCling.so
 0x00007f469638fe72 in <unknown> from /home/cucip/builddir/lib/libCling.so
 0x00007f4696384537 in <unknown> from /home/cucip/builddir/lib/libCling.so
 0x00007f469bb12908 in TApplication::ExecuteFile(char const*, int*, bool) at /home/cucip/root-6.18.04/core/base/src/TApplication.cxx:1156 from /home/cucip/builddir/lib/libCore.so
 0x00007f469bb120ac in TApplication::ProcessLine(char const*, bool, int*) at /home/cucip/root-6.18.04/core/base/src/TApplication.cxx:1007 from /home/cucip/builddir/lib/libCore.so
 0x00007f469bfe18e2 in TRint::ProcessLineNr(char const*, char const*, int*) at /home/cucip/root-6.18.04/core/rint/src/TRint.cxx:762 from /home/cucip/builddir/lib/libRint.so
 0x00007f469bfe1cd4 in TRint::HandleTermInput() at /home/cucip/root-6.18.04/core/rint/src/TRint.cxx:613 from /home/cucip/builddir/lib/libRint.so
 0x00007f469bc66600 in TUnixSystem::CheckDescriptors() at /home/cucip/root-6.18.04/core/unix/src/TUnixSystem.cxx:1309 from /home/cucip/builddir/lib/libCore.so
 0x00007f469bc67f98 in TUnixSystem::DispatchOneEvent(bool) at /home/cucip/root-6.18.04/core/unix/src/TUnixSystem.cxx:1065 from /home/cucip/builddir/lib/libCore.so
 0x00007f469bb7cd81 in TSystem::Run() at /home/cucip/root-6.18.04/core/base/src/TSystem.cxx:412 from /home/cucip/builddir/lib/libCore.so
 0x00007f469bb0fc7f in TApplication::Run(bool) at /home/cucip/root-6.18.04/core/base/src/TApplication.cxx:1179 from /home/cucip/builddir/lib/libCore.so
 0x00007f469bfe32d1 in TRint::Run(bool) at /home/cucip/root-6.18.04/core/rint/src/TRint.cxx:463 from /home/cucip/builddir/lib/libRint.so
 0x00007f469c800a0c in <unknown> from /home/cucip/builddir/bin/root.exe
 0x00007f469af71b97 in __libc_start_main + 0xe7 from /lib/x86_64-linux-gnu/libc.so.6
 0x00007f469c800a6a in _start + 0x2a from /home/cucip/builddir/bin/root.exe
Error in <HandleInterpreterException>: Trying to access a pointer that points to an invalid memory address..
Execution of your code was aborted.
In file included from input_line_776:1:
/mnt/c/1/MG5_aMC_v2_6_6/Delphes/examples/HZZXT.C:167:5: warning: invalid memory pointer passed to a callee:
 if(muon1->PT < 20 | muon2->PT < 20 | abs(muon1->Eta) > 2.5 | abs(muon2->Eta) > 2.5) continue;

Что означает эта ошибка? И как я могу это исправить? Пожалуйста, дайте мне знать, если вам нужна дополнительная информация или код.

...