Thorsten wrote:
> This is not acceptable, it means that there is use of
> uninitialised memory somewhere. Unfortunately I think
> valgrind, which is the tool of choice for this, isn’t
> ported to m68k yet… I’ll try to find it nevertheless.
> 
> An strace is not useful for segfaults in user space
> applications, by the way – it only displays syscalls.

Is it good in this?

$ valgrind ./mksh -c 'echo $((++(VAR)))'
==3417== Memcheck, a memory error detector
==3417== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==3417== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==3417== Command: ./mksh -c echo\ $((++(VAR)))
==3417==
==3417== Use of uninitialised value of size 4
==3417==    at 0x11B565: assign_check.isra.0.3422 (expr.c:650)
==3417==    by 0x49C6EB6: ???
==3417==
==3417== Invalid read of size 1
==3417==    at 0x11B565: assign_check.isra.0.3422 (expr.c:650)
==3417==    by 0x49C6EB6: ???
==3417==  Address 0x1c is not stack'd, malloc'd or (recently) free'd
==3417==
==3417==
==3417== Process terminating with default action of signal 11 (SIGSEGV)
==3417==  Access not within mapped region at address 0x1C
==3417==    at 0x11B565: assign_check.isra.0.3422 (expr.c:650)
==3417==    by 0x49C6EB6: ???
==3417==  If you believe this happened as a result of a stack
==3417==  overflow in your program's main thread (unlikely but
==3417==  possible), you can try to increase the size of the
==3417==  main thread stack using the --main-stacksize= flag.
==3417==  The main thread stack size used in this run was 8388608.
==3417==
==3417== HEAP SUMMARY:
==3417==     in use at exit: 26,058 bytes in 330 blocks
==3417==   total heap usage: 456 allocs, 126 frees, 29,722 bytes allocated
==3417==
==3417== LEAK SUMMARY:
==3417==    definitely lost: 0 bytes in 0 blocks
==3417==    indirectly lost: 0 bytes in 0 blocks
==3417==      possibly lost: 0 bytes in 0 blocks
==3417==    still reachable: 26,058 bytes in 330 blocks
==3417==         suppressed: 0 bytes in 0 blocks
==3417== Rerun with --leak-check=full to see details of leaked memory
==3417==
==3417== For counts of detected and suppressed errors, rerun with: -v
==3417== Use --track-origins=yes to see where uninitialised values come from
==3417== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 15 from 8)


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to