Warning: invalid memory pointer passed to a callee in c++ code

Please read tips for efficient and successful posting and posting code

ROOT Version: 6.18.00
Platform: UBUNTU 18.04.4
Compiler: Not Provided

Good Afternoon!

I’m proceed a code in c++ from a chain generated from a code named ExChain3.C to formed a MakeClass from this chain.

But when I run until 2500000 run normally, but when the entries is more than that give me this error:

error message

#0  0x00007f73d42576e7 in __GI___waitpid (pid=3983, stat_loc=stat_loc
entry=0x7ffe4ef93248, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007f73d41c2107 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2  0x00007f73d4e647c3 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x55c4df5d9b80) at /home/gamos/gamos/external/root/6.18.00/root/core/unix/src/TUnixSystem.cxx:2106
#3  TUnixSystem::StackTrace (this=0x55c4df5d9b80) at /home/gamos/gamos/external/root/6.18.00/root/core/unix/src/TUnixSystem.cxx:2400
#4  0x00007f73cf43ae45 in cling::MultiplexInterpreterCallbacks::PrintStackTrace() () from /home/gamos/gamos/external/root/6.18.00/root/rootbuild/lib/libCling.so
#5  0x00007f73cf43a89d in cling_runtime_internal_throwIfInvalidPointer () from /home/gamos/gamos/external/root/6.18.00/root/rootbuild/lib/libCling.so
#6  0x00007f73c19126bf in ?? ()
#7  0x0000000000000000 in ?? ()
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_8:1:
/home/gamos/brachy_VMBox/Etapas/teste/sample/gamma_test/dose3.C:142:27: warning: invalid memory pointer passed to a callee:

The codes was attached and the root files is in the link bellow from google drive
c++ file:
dose3.C (23.2 KB) dose3.h (14.9 KB) ExChain3.C (3.9 KB)

google drive file: (I will reply this as soon as the file was upload in the drive)

Could anyone help me?


Thanks for all.
I already see the problem. Actually, it didn’t the variable Step_AccumulatedEnergyDeposited like showed, it is the size of array dist[] that is initialized in the .h file with a number because I resized the number of entries so the value of size of this array change too.

Anyway thanks for all.

David M Fernandes

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