Any way to enable extra assertions in cling?

Hello, I’ve been running cling with mixed success on some of the C++ scripts I have. One particular script runs, exits and then cling jumps on the invalid location (see the stack trace), segfaulting in the end. Is there any way I can build with extra assertions (I did CMAKE_BUILD_TYPE=Debug) and get more insight in why this is failing. Note that the script I’m using works well when compiled and loaded as the shared library. Seeing free() in the most bottom stack I wonder if it’s being run as part of some destructor/object cleanup, but I’m unsure why it wouldn’t return, and why it trashes the stack.

#5  <signal handler called>
#6  0x00007ff4f764463c in free () from /lib64/libc.so.6
#7  0x00000000150fc6a5 in free ()
#8  0x00007ff3c14ce633 in ?? ()
#9  0x00000000000000cc in ?? ()
#10 0x00000000221b32f0 in ?? ()
#11 0x000000000000007c in ?? ()
#12 0x00007fff7e57cdd8 in ?? ()
#13 0x00007fff7e57ce00 in ?? ()
#14 0x00007ff4f797f760 in ?? () from /lib64/libc.so.6
#15 0x00007ff3f03929d8 in ?? ()
#16 0x00007fff7e57ccd8 in ?? ()
#17 0x00007ff3f03929a8 in ?? ()
#18 0x0000000019617eb0 in ?? ()
#19 0x00007fff7e57cbf0 in ?? ()
#20 0x000000000015fd10 in ?? ()
#21 0x00000000000000cc in ?? ()
#22 0x00000000221b32f0 in ?? ()
#23 0x0000000000000003 in ?? ()
#24 0x00007ff4f7644e3a in calloc () from /lib64/libc.so.6
#25 0x00007fff7e57cd30 in ?? ()
#26 0x0000000021d7ed40 in ?? ()
#27 0x0000000021a887a0 in ?? ()
#28 0x0000000000003000 in ?? ()
#29 0x00000000150fc6a5 in free ()

****************************************
          Process Map
****************************************

We’ll add debug info to cling this year. Until then you’ll generally have to resort to printf-debugging or divide-and-conquer, I’m afraid :-/

This specific case looks like a memory issue; so ACLIiC-ing your code (.L code.C+ - with the + at the end) and running valgrind on it will certainly help!

Thank you so much, this is very promising, and I’m looking forward to it. Yes, I went to printf debugging and bisection route and found the issue, and I’ll check ACLIiC-ing approach.

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