Skip to content

Possible Valgrind issue in dt_write #90

Description

@thesamesam
$ test/unittest/dtrace-util/tst.ELFGenerationOut.sh /tmp/runtest.10198/bin/dtrace
--149025-- WARNING: unhandled eBPF command 23
==149025== Syscall param write(buf) points to uninitialised byte(s)
==149025==    at 0x4AF38D0: write (write.c:26)
==149025==    by 0x491460B: dt_write (dt_subr.c:497)
==149025==    by 0x48E2286: dump_elf64 (dt_link.c:725)
==149025==    by 0x48E2286: dtrace_program_link (dt_link.c:1615)
==149025==    by 0x10A0E7: link_prog (dtrace.c:408)
==149025==    by 0x10A0E7: main (dtrace.c:1419)
==149025==  Address 0x9390b34 is 260 bytes inside a block of size 683 alloc'd
==149025==    at 0x485032F: calloc (vg_replace_malloc.c:1675)
==149025==    by 0x4914C34: dt_zalloc (dt_subr.c:685)
==149025==    by 0x48AB05C: dt_buf_create (dt_buf.c:30)
==149025==    by 0x48D4245: dtrace_dof_create (dt_dof.c:824)
==149025==    by 0x48DF919: dtrace_program_link (dt_link.c:1570)
==149025==    by 0x10A0E7: link_prog (dtrace.c:408)
==149025==    by 0x10A0E7: main (dtrace.c:1419)
==149025==

Activity

  1. nickalcock commented on Aug 28, 2024

    @nickalcock
    Contributor

    Ew! I wonder how this has never showed up for us (we valgrind dtrace routinely). Anything special in your setup?

    This strongly suggests that one of the things that get assigned to elf_file in dump_elf64 (and probably the nearly-dead dump_elf32 as well) is itself uninitialized, since the variable itself is memset to 0 so it must be being de-initialized in part to trigger this. The offset should tell us what...

  2. ezannoni commented on Oct 11, 2024

    @ezannoni
    Member

    Sam, do you have a way to reproduce this?

  3. thesamesam commented on Oct 11, 2024

    @thesamesam
    ContributorAuthor

    @ezannoni I don't but Kris managed to hit the same error as I did (he mentioned it the other day on IRC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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