public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "mark at klomp dot org" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug libelf/28685] UBSan: member access within misaligned address 0x7ff316818032 for type 'struct Elf32_Phdr'
Date: Tue, 21 Dec 2021 00:01:58 +0000	[thread overview]
Message-ID: <bug-28685-10460-l3exBNEdj8@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28685-10460@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28685

--- Comment #9 from Mark Wielaard <mark at klomp dot org> ---
(In reply to Evgeny Vereshchagin from comment #7)
> Created attachment 13869 [details]
> archive with a report and a file triggering a memory leak
> 
> Thanks! That branch helped me a lot. I rebased it on top of my "fuzz" branch
> and pushed it to trigger the tests. CFLite reported a memory leak:
> ```
> $ DEBUGINFOD_URLS= LD_LIBRARY_PATH="./libdw;./libelf" valgrind
> --leak-check=full ./src/stack --core
> ./MEMLEAK/address/leak-8cd1af3e2ba6f343794fbee7232b1531695d2ab1
> ==379530== Memcheck, a memory error detector
> ==379530== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==379530== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
> ==379530== Command: ./src/stack --core
> ./MEMLEAK/address/leak-8cd1af3e2ba6f343794fbee7232b1531695d2ab1
> ==379530==
> PID 1147239 - core
> TID 1147239:
> #0  0x000055dea11b3135
> ./src/stack: dwfl_thread_getframes tid 1147239 at 0x55dea11b3135 in
> <unknown>: invalid operation
> ==379530==
> ==379530== HEAP SUMMARY:
> ==379530==     in use at exit: 37,280 bytes in 97 blocks
> ==379530==   total heap usage: 4,597 allocs, 4,500 frees, 302,708 bytes
> allocated
> ==379530==
> ==379530== 20 bytes in 1 blocks are definitely lost in loss record 1 of 8
> ==379530==    at 0x484186F: malloc (vg_replace_malloc.c:381)
> ==379530==    by 0x48C4E15: dwfl_segment_report_module
> (dwfl_segment_report_module.c:632)
> ==379530==    by 0x48C8F3E: dwfl_core_file_report@@ELFUTILS_0.158
> (core-file.c:559)
> ==379530==    by 0x402EC6: parse_opt (stack.c:595)
> ==379530==    by 0x4C4E471: argp_parse (in /usr/lib64/libc.so.6)
> ==379530==    by 0x4024EA: main (stack.c:695)

Aha, we have more error paths now and not all cleaned up the buildid memory.
Proposed cleanup patch:
https://sourceware.org/pipermail/elfutils-devel/2021q4/004582.html
https://code.wildebeest.org/git/user/mjw/elfutils/commit/?h=fuzz

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-12-21  0:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-11 21:32 [Bug libelf/28685] New: " evvers at ya dot ru
2021-12-17  9:34 ` [Bug libelf/28685] " mark at klomp dot org
2021-12-17  9:54 ` evvers at ya dot ru
2021-12-19 23:57 ` mark at klomp dot org
2021-12-20 11:34 ` evvers at ya dot ru
2021-12-20 13:19 ` evvers at ya dot ru
2021-12-20 17:27 ` mark at klomp dot org
2021-12-20 19:01 ` evvers at ya dot ru
2021-12-20 22:34 ` evvers at ya dot ru
2021-12-21  0:01 ` mark at klomp dot org [this message]
2021-12-21  1:51 ` evvers at ya dot ru
2021-12-21 11:13 ` mark at klomp dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28685-10460-l3exBNEdj8@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).