Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Valgrind issue in dt_write #90

Open
thesamesam opened this issue Aug 25, 2024 · 3 comments
Open

Possible Valgrind issue in dt_write #90

thesamesam opened this issue Aug 25, 2024 · 3 comments

Comments

@thesamesam
Copy link

$ 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==
@nickalcock
Copy link
Member

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...

@ezannoni
Copy link
Member

Sam, do you have a way to reproduce this?

@thesamesam
Copy link
Author

thesamesam commented Oct 11, 2024

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants