Skip to content

Valgrind reports uninitialised access #67

@mingodad

Description

@mingodad

I've just downloaded https://pike.lysator.liu.se/pub/pike/latest-stable/Pike-v8.0.1956.tar.gz and after build and install on linux and then testing with small recursive program I'm getting this output:

$>valgrind pike fibo.pyke 
==5996== Memcheck, a memory error detector
==5996== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==5996== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==5996== Command: pike fibo.pyke
==5996== 
==5996== Conditional jump or move depends on uninitialised value(s)
==5996==    at 0x80B94FD: ???
==5996==    by 0x139FE7: eval_instruction (interpret.c:1816)
==5996==    by 0x139FE7: mega_apply_low (interpret.c:2828)
==5996==    by 0x1CBD8B: call_pike_initializers (object.c:338)
==5996==    by 0x1CBD8B: get_master (object.c:702)
==5996==    by 0x1CC0B8: debug_master (object.c:720)
==5996==    by 0x1AE7B6: load_pike_master (pike_embed.c:397)
==5996==    by 0x120509: main (main.c:676)
==5996== 
==5996== Conditional jump or move depends on uninitialised value(s)
==5996==    at 0x80DA2D8: ???
==5996==    by 0x139FE7: eval_instruction (interpret.c:1816)
==5996==    by 0x139FE7: mega_apply_low (interpret.c:2828)
==5996==    by 0x1CBD29: call_pike_initializers (object.c:345)
==5996==    by 0x1CBD29: get_master (object.c:702)
==5996==    by 0x1CC0B8: debug_master (object.c:720)
==5996==    by 0x1AE7B6: load_pike_master (pike_embed.c:397)
==5996==    by 0x120509: main (main.c:676)
==5996== 
==5996== Conditional jump or move depends on uninitialised value(s)
==5996==    at 0x4208D41: ???
==5996==    by 0x139FE7: eval_instruction (interpret.c:1816)
==5996==    by 0x139FE7: mega_apply_low (interpret.c:2828)
==5996==    by 0x1C8D99: call_pike_initializers (object.c:345)
==5996==    by 0x1C9084: parent_clone_object (object.c:447)
==5996==    by 0x137449: low_mega_apply (apply_low.h:234)
==5996==    by 0x137A8D: jump_opcode_F_CALL_FUNCTION (interpret_functions.h:2452)
==5996==    by 0x420FD25: ???
==5996==    by 0x139FE7: eval_instruction (interpret.c:1816)
==5996==    by 0x139FE7: mega_apply_low (interpret.c:2828)
==5996==    by 0x1CBD29: call_pike_initializers (object.c:345)
==5996==    by 0x1CBD29: get_master (object.c:702)
==5996==    by 0x1CC0B8: debug_master (object.c:720)
==5996==    by 0x1AE7B6: load_pike_master (pike_embed.c:397)
==5996==    by 0x120509: main (main.c:676)
==5996== 
==5996== Conditional jump or move depends on uninitialised value(s)
==5996==    at 0x4210EE3: ???
==5996==    by 0x139FE7: eval_instruction (interpret.c:1816)
==5996==    by 0x139FE7: mega_apply_low (interpret.c:2828)
==5996==    by 0x1CB755: object_index_no_free (object.c:1534)
==5996==    by 0x133E84: opcode_F_LOCAL_INDEX (interpret_functions.h:2078)
==5996==    by 0x80BB17B: ???
==5996==    by 0x139FE7: eval_instruction (interpret.c:1816)
==5996==    by 0x139FE7: mega_apply_low (interpret.c:2828)
==5996==    by 0x120537: main (main.c:681)
==5996== 
==5996== Conditional jump or move depends on uninitialised value(s)
==5996==    at 0x80BCBFD: ???
==5996==    by 0x139FE7: eval_instruction (interpret.c:1816)
==5996==    by 0x139FE7: mega_apply_low (interpret.c:2828)
==5996==    by 0x120537: main (main.c:681)
==5996== 
==5996== Conditional jump or move depends on uninitialised value(s)
==5996==    at 0x80D2F4E: ???
==5996==    by 0x139FE7: eval_instruction (interpret.c:1816)
==5996==    by 0x139FE7: mega_apply_low (interpret.c:2828)
==5996==    by 0x1D4965: o_cast (operators.c:700)
==5996==    by 0x1D5D2B: f_cast (operators.c:946)
==5996==    by 0x80E7EDD: ???
==5996==    by 0x139FE7: eval_instruction (interpret.c:1816)
==5996==    by 0x139FE7: mega_apply_low (interpret.c:2828)
==5996==    by 0x120537: main (main.c:681)
==5996== 
==5996== Conditional jump or move depends on uninitialised value(s)
==5996==    at 0x80BCBFD: ???
==5996==    by 0x139FE7: eval_instruction (interpret.c:1816)
==5996==    by 0x139FE7: mega_apply_low (interpret.c:2828)
==5996==    by 0x137E71: lower_mega_apply (interpret.c:2279)
==5996==    by 0x139FCD: mega_apply_low (interpret.c:2826)
==5996==    by 0x13C369: apply_external (interpret.c:3308)
==5996==    by 0x137E71: lower_mega_apply (interpret.c:2279)
==5996==    by 0x139FCD: mega_apply_low (interpret.c:2826)
==5996==    by 0x13B2E0: safe_apply_low2 (interpret.c:3076)
==5996==    by 0x1F7B27: run_init2 (program.c:9024)
==5996==    by 0x1F8077: run_pass1 (program.c:9137)
==5996==    by 0x1F8077: f_compilation_compile (program.c:9723)
==5996==    by 0x137E71: lower_mega_apply (interpret.c:2279)
==5996==    by 0x139FCD: mega_apply_low (interpret.c:2826)
==5996== 
Result of 32 = 3524578
==5996== 
==5996== HEAP SUMMARY:
==5996==     in use at exit: 1,410,599 bytes in 806 blocks
==5996==   total heap usage: 28,336 allocs, 27,530 frees, 41,877,281 bytes allocated
==5996== 
==5996== LEAK SUMMARY:
==5996==    definitely lost: 0 bytes in 0 blocks
==5996==    indirectly lost: 0 bytes in 0 blocks
==5996==      possibly lost: 0 bytes in 0 blocks
==5996==    still reachable: 1,410,599 bytes in 806 blocks
==5996==         suppressed: 0 bytes in 0 blocks
==5996== Rerun with --leak-check=full to see details of leaked memory
==5996== 
==5996== Use --track-origins=yes to see where uninitialised values come from
==5996== For lists of detected and suppressed errors, rerun with: -s
==5996== ERROR SUMMARY: 175 errors from 7 contexts (suppressed: 0 from 0)

here is the fibo.pyke :

int fib(int n)
{
    if (n < 2) return 1;
    return fib(n-2) + fib(n-1);
}

int main(int argc, array argv)
{
    int xt = 32;
    int result = fib(xt);
    write("Result of %d = %d\n", xt, result);
    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions