lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>  If you are using Linux, could you run the app under valgrind?  It will take longer, but it should reveal some issues.

Running on Ubuntu using g++ 9.3.0 it is still crashing. Here is the output of valgrind. It definitely detected an error - the issue for me is that's the error is deep inside of Lua and I'm not sure how my code could have caused this. This is using Lua 5.3 from apt-get so it doesn't contain any modifications.

valgrind ./a.out
==2119== Memcheck, a memory error detector
==2119== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2119== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==2119== Command: ./a.out
==2119==
running good code
init good
timer_call_after
init good
trigger
tick
running bad code
timer_call_after
init good
trigger
==2119== Conditional jump or move depends on uninitialised value(s)
==2119==    at 0x11200D: resume (in /home/johnd/luatest/a.out)
==2119==    by 0x111536: luaD_rawrunprotected (in /home/johnd/luatest/a.out)
==2119==    by 0x112208: lua_resume (in /home/johnd/luatest/a.out)
==2119==    by 0x1265E7: auxresume (in /home/johnd/luatest/a.out)
==2119==    by 0x126968: luaB_coresume (in /home/johnd/luatest/a.out)
==2119==    by 0x111E96: luaD_precall (in /home/johnd/luatest/a.out)
==2119==    by 0x11D554: luaV_execute (in /home/johnd/luatest/a.out)
==2119==    by 0x1120E7: luaD_call (in /home/johnd/luatest/a.out)
==2119==    by 0x112114: luaD_callnoyield (in /home/johnd/luatest/a.out)
==2119==    by 0x111536: luaD_rawrunprotected (in /home/johnd/luatest/a.out)
==2119==    by 0x11246E: luaD_pcall (in /home/johnd/luatest/a.out)
==2119==    by 0x10F86D: lua_pcallk (in /home/johnd/luatest/a.out)
==2119==
==2119== Jump to the invalid address stated on the next line
==2119==    at 0x0: ???
==2119==    by 0x111B02: finishCcall (in /home/johnd/luatest/a.out)
==2119==    by 0x111B7C: unroll (in /home/johnd/luatest/a.out)
==2119==    by 0x111536: luaD_rawrunprotected (in /home/johnd/luatest/a.out)
==2119==    by 0x112208: lua_resume (in /home/johnd/luatest/a.out)
==2119==    by 0x1265E7: auxresume (in /home/johnd/luatest/a.out)
==2119==    by 0x126968: luaB_coresume (in /home/johnd/luatest/a.out)
==2119==    by 0x111E96: luaD_precall (in /home/johnd/luatest/a.out)
==2119==    by 0x11D554: luaV_execute (in /home/johnd/luatest/a.out)
==2119==    by 0x1120E7: luaD_call (in /home/johnd/luatest/a.out)
==2119==    by 0x112114: luaD_callnoyield (in /home/johnd/luatest/a.out)
==2119==    by 0x111536: luaD_rawrunprotected (in /home/johnd/luatest/a.out)
==2119==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==2119==
==2119==
==2119== Process terminating with default action of signal 11 (SIGSEGV)
==2119==  Bad permissions for mapped region at address 0x0
==2119==    at 0x0: ???
==2119==    by 0x111B02: finishCcall (in /home/johnd/luatest/a.out)
==2119==    by 0x111B7C: unroll (in /home/johnd/luatest/a.out)
==2119==    by 0x111536: luaD_rawrunprotected (in /home/johnd/luatest/a.out)
==2119==    by 0x112208: lua_resume (in /home/johnd/luatest/a.out)
==2119==    by 0x1265E7: auxresume (in /home/johnd/luatest/a.out)
==2119==    by 0x126968: luaB_coresume (in /home/johnd/luatest/a.out)
==2119==    by 0x111E96: luaD_precall (in /home/johnd/luatest/a.out)
==2119==    by 0x11D554: luaV_execute (in /home/johnd/luatest/a.out)
==2119==    by 0x1120E7: luaD_call (in /home/johnd/luatest/a.out)
==2119==    by 0x112114: luaD_callnoyield (in /home/johnd/luatest/a.out)
==2119==    by 0x111536: luaD_rawrunprotected (in /home/johnd/luatest/a.out)
==2119==
==2119== HEAP SUMMARY:
==2119==     in use at exit: 50,313 bytes in 618 blocks
==2119==   total heap usage: 728 allocs, 110 frees, 137,657 bytes allocated
==2119==
==2119== LEAK SUMMARY:
==2119==    definitely lost: 1,552 bytes in 1 blocks
==2119==    indirectly lost: 22,140 bytes in 295 blocks
==2119==      possibly lost: 5,264 bytes in 9 blocks
==2119==    still reachable: 21,357 bytes in 313 blocks
==2119==         suppressed: 0 bytes in 0 blocks
==2119== Rerun with --leak-check=full to see details of leaked memory
==2119==
==2119== Use --track-origins=yes to see where uninitialised values come from
==2119== For lists of detected and suppressed errors, rerun with: -s
==2119== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Segmentation fault