ommon name (binutils-gdb
calls this AARCH64_DWARF_RA_SIGN_STATE, but only defines it in a
private header). Lets move this into cfi.c as private implementation
detail in the next patch.
Thanks,
Mark
RA_SIGN_STATE].value ^= 0x1;
> }
> else
> {
Looks good.
Lets also move the DW_AARCH64_RA_SIGN_STATE definition into cfi.h (from
libdw.h in the previous patch).
Thanks,
Mark
Hi German,
On Thu, May 19, 2022 at 02:30:23PM +0100, German Gomez via Elfutils-devel wrote:
> On 28/04/2022 20:56, Mark Wielaard wrote:
> > I haven't been able to look at the actual patches yet. And I am on
> > vacation this week. But I'll review next week after I am ba
N is an
extended wildcard pattern. May be given more than
once. Only non-allocated sections can be
removed.
Do you really need a new option? Or could you use an explicit
--keep-section=.ctf and/or --remove-section=.ctf ?
Thanks,
Mark
Hi,
On Wed, 2023-02-22 at 23:39 +0100, Mark Wielaard wrote:
> When there is an error in dwarf_getscopes after the initial scopes
> have been allocated, e.g. when looking for the inlined scopes, then
> the scopes would leak. Fix this by explicitly free the scopes on error.
&
Hi Guillermo,
CCed Nick to see if he knows why binutils strip does what it does.
On Fri, 2023-02-24 at 10:48 -0600, Guillermo E. Martinez wrote:
> On Fri, Feb 24, 2023 at 12:51:25PM +0100, Mark Wielaard wrote:
>
>
> > On Thu, Feb 23, 2023 at 12:42:37PM -0600, Guillermo
e
(defaulting to keeping).
I am mainly wondering why binutils strip already seems to keep ".ctf"
sections (even without -g).
Cheers,
Mark
m servers. Luckily, json-c is
> a small & self-contained library.
aha, I see, the metadata query is different from other queries. It
"merges" the replies from all servers instead of picking the first one
that gives an answer.
Does it really merge the results? It looks like it just adds all
elements to the array whether or not they are there.
Should the result also contain the server URL from which the entry
came?
Cheers,
Mark
Hi,
On Tue, 2023-02-21 at 14:33 +0100, Mark Wielaard wrote:
> We accumulated a lot of patches since 0.188 (59 commits by 13 authors)
> with some nice new features and some important bug fixes. So it would
> be good to push a new release out.
>
> I cleaned up the patchwork list a
ly. But ar.c also simply uses uid_t, gid_t
and mode_t. So those should then also be adjusted.
Can't we use some configure check instead?
I am somewhat hesitant to change this because it is in a public header.
Cheers,
Mark
both signed
and no wider than a long.
libdwelf.h is a public header. libebl.h isn't. But I am not sure these
are the right places to add these typedefs. pid_t and ssize_t are used
all over the place.
Cheers,
Mark
tem.c b/lib/system.c
> new file mode 100644
> index ..bd3831f5
> --- /dev/null
> +++ b/lib/system.c
> @@ -0,0 +1,48 @@
> +/* Definitions for system functions.
> + Copyright (C) 2006-2011 Red Hat, Inc.
> + Copyright (C) 2022 Mark J. Wielaard
> +
Hi Guillermo,
On Thu, 2023-03-02 at 20:40 -0600, Guillermo E. Martinez wrote:
> On Tue, Feb 28, 2023 at 03:27:13PM +0100, Mark Wielaard wrote:
> > There are some exceptions to the general rule in eu-strip of dropping
> > not referenced, non-allocated, SHT_PROGBIT sections. SH
it in the comparison.
Signed-off-by: Mark Wielaard
---
src/ChangeLog | 5 +
src/readelf.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index 699d98ee..c26dafdd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2023-03-03
Make sure that even if the system elf.h doesn't have ELF_COMPRESS_ZSTD
defined it can still be used as constant. Also update libelf.h
documentation and add new feature to NEWS.
Signed-off-by: Mark Wielaard
---
ChangeLog| 4
NEWS | 8 +++-
libelf/ChangeLog
Set version to 0.189
Update NEWS and elfutils.spec.in
Set copyright year in configure.ac and printversion.
Regenerate po/*.po files.
Signed-off-by: Mark Wielaard
---
NEWS|5 +
config/elfutils.spec.in | 13 +
configure.ac|4 +-
lib/printversion.c
infod-find executable itself in the testcase.
* src/Makefile.am (libelf): When BUILD_STATIC add $(zstd_LIBS)
* tests/Makefile.am (libelf): Likewise.
* tests/run-debuginfod-query-retry.sh: Use debuginfod-find instead
of libdebuginfod.so.1
Signed-off-by: Mark Wielaard
---
src/M
ry
printversion: Fix unused variable
backends: Support returning lvalue and rvalue references
configure: Add --enable-sanitize-memory
Mark Wielaard (35):
debuginfod: Mark extract_section function static
readelf: Check phdr != NULL or shdr != NULL in handle_dynamic.
libdw: Don't dereference
Some setups might have some frames for unknown (null) functions
in the thread backtrace. Skip these frames instead of failing
immediately.
* tests/backtrace.c (callback_verify): Check and skip nulls_seen.
https://sourceware.org/bugzilla/show_bug.cgi?id=29176
Signed-off-by: Mark Wielaard
Hi Nick, Hi Guillermo,
On Sat, 2023-03-04 at 08:00 -0600, Guillermo E. Martinez wrote:
> Hello,
>
> On Fri, Mar 03, 2023 at 12:24:19PM +, Nick Clifton wrote:
> > Hi Mark,
> >
> > > > > I am mainly wondering why binutils strip already seems to keep "
and
organisations for maintaining and/or providing hardware for
builder.sourceware.org Brno University, Dan Horák, Marist University,
Thomas Fitzsimmons, Mark Wielaard, Frank Eigler, IBM, Carl Love,
The Works on Arm initiative, Christophe Lyon, and Red Hat
it keeps such sections when -g isn't given.
> > So I am not sure we really need a --keep-ctf flag for eu-strip (unless
> > we also get it for binutils strip). My preference would be to just
> > recommend a user use --keep-section=.ctf or --remove-section=.ctf to
> > in
achine flags: 0x43
> $ echo $?
> 1
Thanks. I quickly peeked at the LoongArch ELF ABI specification and
this is precisely what needs to be checked.
Added a ChangeLog entry to the commit message, a reference to the
bug you filed and pushed.
Cheers,
Mark
rt of function.
Signed-off-by: Mark Wielaard
---
backends/libebl_CPU.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/backends/libebl_CPU.h b/backends/libebl_CPU.h
index 3b2cc3e4..d138f5f7 100644
--- a/backends/libebl_CPU.h
+++ b/backends/libebl_CPU.h
@@ -66,13 +
In some error cases we want to show the section name but cannot
because the section header is corrupt or NULL. Make sure the
section_name always returns "???" in that case.
* src/readelf.c (section_name): Check for shdr == NULL.
Signed-off-by: Mark Wielaard
---
src/readelf.c
downstream users of our code. Especially
if someone starts assigning CVEs to them. It would be good to
have some explicit text to point "security" bug reporters at
on how we will handle their bugs.
Cheers,
Mark
get CVEs assigned which cause lots of extra work
for some of our downstream users. I think we should be clear that we
want to fix all bugs and don't want to get dragged into embargoed
security theater.
https://daniel.haxx.se/blog/2023/03/29/pre-notification-dilemmas/
Cheers,
Mark
On Sat, Apr 01, 2023 at 02:43:43PM +0800, Youling Tang wrote:
> Adds R_LARCH_*.
Thanks, pushed.
On Sat, Apr 01, 2023 at 02:43:44PM +0800, Youling Tang wrote:
> Add new relocation type handling.
Thanks, looks good. Pushed.
Cheers,
Mark
tch .got.plt section address 0x68238
>
> After applying the patch:
> $ ./src/elflint --gnu-ld ./src/elflint
> No errors
Thanks, code looks correct. I agree that the other issue mentioned
(_DYNAMIC symbol size 0) is a separate issue.
Pushed,
Mark
nstance of 'sqlite_exception'
Which doesn't really make sense. Where is this sqlite_exception thrown that it
isn't caught?
Might this be a sparc specific bug?
Cheers,
Mark
Hi,
On Thu, 2023-04-06 at 17:04 +0200, Mark Wielaard wrote:
> In some error cases we want to show the section name but cannot
> because the section header is corrupt or NULL. Make sure the
> section_name always returns "???" in that case.
>
> * src/readelf.c (sect
Hi,
On Thu, 2023-04-06 at 17:04 +0200, Mark Wielaard wrote:
> Calling dwarf_peeled_die_type with a NULL results pointer is an error,
> check early that result is not NULL so dwarf_formref_die and
> dwarf_peel_type won't try to set the NULL Dwarf_Die.
>
> * b
-federation-sqlite.sh: Likewise.
Signed-off-by: Mark Wielaard
---
tests/run-debuginfod-federation-metrics.sh | 4 +++-
tests/run-debuginfod-federation-sqlite.sh | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/run-debuginfod-federation-metrics.sh
b/tests/run-debuginfod
On Fri, 2023-04-14 at 18:46 +0200, Mark Wielaard wrote:
> It seems doing 100 parallel requests can crash some versions of
> libmicrohttpd so limit the number a little to the number of processors
> times 4, with a max of 64.
>
> * tests/run-debuginfod-federation-metrics.sh: Us
; Build state: failed test (failure)
> Revision: ce2312975812a1719a2c322aa75e97f96c4f8ca7
> Worker: gentoo-sparc
> Build Reason: (unknown)
> Blamelist: Mark Wielaard
>
> Steps:
> [...]
>
> - 7: make check ( failure )
> Logs:
> - stdio:
> https:
at.
Cheers,
Markdiff --git a/ChangeLog b/ChangeLog
index ece07e97..6aed95b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
2023-03-27 Di Chen
* NEWS: Support readelf -Ds for using dynamic segment to
-print symbol table.
+ print symbol table.
2023-03-03 Mark Wielaar
ts" : "allocated"));
}
+ }
Signed-off-by: Mark Wielaard
---
src/elfcompress.c | 43 +++
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/src/elfcompress.c b/src/elfcompress.c
index 18ade66f..f771b92a 100644
Hi Florian,
On Sat, Apr 22, 2023 at 09:37:09PM +0200, Florian Weimer via Elfutils-devel
wrote:
> Include for the pause function, and add the return type
> of main. Avoids an implicit function declaration and implicit int.
Thanks, pushed.
Cheers,
Mark
buffer was always NULL.
Cheers,
Mark
Hi,
On Sat, 2023-04-22 at 01:45 +0200, Mark Wielaard wrote:
> Before commit a5b07cdf9 "support ZSTD compression algorithm"
> elfcompress would not try to compress a section if it already
> had the requested compression type (or was already uncompressed)
> unless the --fo
ate too
+ many times, there must be a loop in the pointers due to link_map
+ clobberation. */
+#define MAX_PT_LOAD 5
size_t iterations = 0;
- while (next != 0 && ++iterations < dwfl->lookup_elts)
+ while (next != 0 && ++iterations < dwfl->lookup_elts * MAX_PT_LOAD)
{
if (read_addrs (&memory_closure, elfclass, elfdata,
&buffer, &buffer_available, next, &read_vaddr,
Does that sound reasonable?
Thanks,
Mark
Hi,
On Mon, 2023-05-08 at 16:30 +, builder--- via Elfutils-devel wrote:
> A new failure has been detected on builder elfutils-opensusetw-x86_64
> while building elfutils.
>
> Full details are available at:
> https://builder.sourceware.org/buildbot/#builders/88/builds/157
>
> Build state: f
tml
Looks good. Thanks for the references.
Cheers,
Mark
comment says 64bits, but the mask is for 32bits.
I assume the comment is wrong and the masking is deliberate?
Cheers,
Mark
adding the reference). But the code looks plausible.
Thanks,
Mark
well known frame pointer locations in the stack snapshot and use them
> to bridge the frames without debug information.
Looks useful and correct.
Thanks,
Mark
t after a quick look at the kernel sources.
Thanks,
Mark
r[r] & 0x;
> -
> - if (! setfunc (32, 32, dwarf_fregs, arg))
> + /* $f0-$f31 */
> + if (! setfunc (32, 32, &fregs.fpr[0], arg))
>
> Do I need to send the v2 patchset again?
Please just sent this patch rebased against the current git branch. I
already pushed the other 4 patches since they looked good.
Thanks,
Mark
ole="scan"} keeps a queue of 5?
I have no idea how that can happen.
The next build does see this testcase PASS on sparc.
It was clearly not caused by this patch (backends: Add abi_cfi and
register_info callbacks for LoongArch).
Cheers,
Mark
Hi,
On Tue, 2023-05-09 at 19:20 +0800, Youling Tang wrote:
> This patch implements the set_initial_registers_tid hook for LoongArch.
Thanks for the update. Looks good.
Pushed,
Mark
m"} never gets to 1.
I don't really understand this. And again this cannot be caused by the
last commit (backends: Add set_initial_registers_tid callback for
LoongArch).
I will assume this is a flaky test (or maybe sparc is flaky?)
Cheers,
Mark
s. But I
would have expected a specific conversion function for MIPS for
ELF_T_REL and/or ELF_T_RELA (which are currently generic).
Cheers,
Mark
gt;elf, symshdr->sh_link, sym->st_name));
> + class == ELFCLASS32 ? 10 : 18, rel->r_offset,
> + likely (ebl_reloc_type_check (ebl,
> +
}
> if (sh_flags & SHF_MASKOS)
> - if (gnuld)
> - sh_flags &= ~(GElf_Xword) SHF_GNU_RETAIN;
> + {
> + if (gnuld)
> + sh_flags &= ~(GElf_Xword) SHF_GNU_RETAIN;
> + if (ehdr->e_machine == EM_MIPS)
> + {
> + if(sh_flags == SHF_MIPS_NOSTRIP || sh_flags == SHF_MIPS_LOCAL
> +|| sh_flags == SHF_MIPS_NAMES || sh_flags == SHF_MIPS_NODUPE)
> + sh_flags &= ~shdr->sh_flags;
> + }
> + }
> if (sh_flags != 0)
> ERROR (_("section [%2zu] '%s' contains unknown flag(s)"
> " %#" PRIx64 "\n"),
Can this be checked with the machine_section_flag_check hook?
Thanks,
Mark
read_t *readfunc, void *arg,
> + bool *signal_framep __attribute__ ((unused)))
> +{
> + Dwarf_Word fp, lr, sp;
> +
> + if (!getfunc(LR_REG, 1, &lr, arg))
> +return false;
> +
> + if (lr == 0 || !setfunc(-1, 1, &lr, arg))
> +return false;
> +
> + if (!getfunc(FP_REG, 1, &fp, arg))
> +fp = 0;
> +
> + if (!getfunc(SP_REG, 1, &sp, arg))
> +sp = 0;
> +
> + Dwarf_Word newLr, newFp, newSp;
> +
> + if (!readfunc(fp + LR_OFFSET, &newLr, arg))
> +newLr = 0;
> +
> + if (!readfunc(fp + FP_OFFSET, &newFp, arg))
> +newFp = 0;
> +
> + newSp = fp + SP_OFFSET;
> +
> + // These are not fatal if they don't work. They will just prevent
> unwinding at the next frame.
> + setfunc(LR_REG, 1, &newLr, arg);
> + setfunc(FP_REG, 1, &newFp, arg);
> + setfunc(SP_REG, 1, &newSp, arg);
> +
> + // If the fp is invalid, we might still have a valid lr.
> + // But if the fp is valid, then the stack should be moving in the right
> direction.
> + return fp == 0 || newSp > sp;
> +}
Looks good.
Thanks,
Mark
(dwarf_attr_integrate (typedie, DW_AT_encoding,
> + &attr_mem), &encoding) != 0)
> + return -1;
> +
> +#define ARCH_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc))
> +
> + if (encoding == DW_ATE_float)
> + {
> + *locp = ARCH_LOC(loc_fpreg, regsize);
> + if (size <= regsize)
> + return nloc_fpreg;
> +
> + if (size <= 2*regsize)
> + return nloc_fpregpair;
> +
> + if (size <= 4*regsize && arch == MIPS_ARCH_32)
> + return nloc_fpregquad;
> +
> + goto aggregate;
> + }
> + }
> + *locp = ARCH_LOC(loc_intreg, regsize);
> + if (size <= regsize)
> + return nloc_intreg;
> + if (size <= 2*regsize)
> + return nloc_intregpair;
> +
> + /* Else fall through. Shouldn't happen though (at least with gcc) */
> + }
> + FALLTHROUGH;
> +
> +case DW_TAG_structure_type:
> +case DW_TAG_class_type:
> +case DW_TAG_union_type:
> +case DW_TAG_array_type:
> +aggregate:
> + /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
> + if ((arch != MIPS_ARCH_32) && (arch != MIPS_ARCH_64))
> +return -2;
> +
> + *locp = loc_aggregate;
> + return nloc_aggregate;
> +}
> +
> + /* XXX We don't have a good way to return specific errors from ebl calls.
> + This value means we do not understand the type, but it is well-formed
> + DWARF and might be valid. */
> + return -2;
> +}
OK. This looks plausible. Would be good to have a reference to the
actual calling convention.
Thanks,
Mark
it has a limit on the number of link map entries it will
> look at, to avoid loops in corrupted core files.
Looks good. Pushed.
Thanks,
Mark
-elf-file.sh. That isn't caused by
the last commit. It is probably a hickup on the machine,
run-large-elf-file.sh generates a > 4GB ELF file and might cause some
swapping. All other buildbot builders passed.
Cheers,
Mark
#x27;s PLC includes
various volunteers, past and present, from the Sourceware community.
The founding PLC is: Frank Ch. Eigler, Christopher Faylor, Ian Kelling,
Ian Lance Taylor, Tom Tromey, Jon Turney, and Mark J. Wielaard.
Recent discussions have inspired the Sourceware volunteers to think
https://snapshots.sourceware.org/ now generates code coverage reports
for git commits (every 15 minutes if there are any changes).
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index b3b55403..d603021f 100644
--- a/index.html
+++ b/index
Hi Ying,
On Tue, May 16, 2023 at 02:38:45PM +0800, Ying Huang wrote:
> 在 2023/5/9 23:15, Mark Wielaard 写道:
> > On Tue, 2023-04-11 at 16:12 +0800, Ying Huang wrote:
> >> In mips64 little-endian, r_info consists of four byte fields(contains
> >> three reloc types) an
rry, the mailinglist seems to strip the image attachements.
> huangying@Sleepygon:~/elf/elfutils_4$ src/elflint src/nm.o
> Segmentation fault
> huangying@Sleepygon:~/elf/elfutils_4$ src/elflint src/strip.o
> Segmentation fault
When running under gdb, what is the backtrace of the crash?
Thanks,
Mark
he traditional lookup uses the (relative!)
path in the .gnu_debugaltlink section of the .debug file.
I wonder which parts of the "traditional" lookup are still
useful/relevant. Could we get away with pointing at a "traditional"
/usr/lib/debug/ like path that contains a .build-id and (optional) .dwz
subdir to make libdebuginfo that "uniform" debug file lookup library?
Cheers,
Mark
ster and rerun the elfutils buildbot.
Thanks for providing a testcase for valgrind on s390x :)
Cheers,
Mark
section data just one single zero byte.
* tests/addsections.c (add_sections): Don't strdup and free
the string ".extra", but just add the empty string.
* tests/run-copymany-sections.sh: Call addsections with
32768 instead of 65535.
Signed-off-by
With -N the test runs 4 times faster. And the address lookup is not
essential for the test.
* tests/run-strip-reloc.sh: Use readelf -N -w.
Signed-off-by: Mark Wielaard
---
tests/run-strip-reloc.sh | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/run
. Add
test-copymany-subr.sh, run-copymany-be32.sh,
run-copymany-le32.sh, run-copymany-be64.sh and
run-copymany-le64.sh.
Signed-off-by: Mark Wielaard
---
tests/Makefile.am| 8 ++--
tests/run-copymany-be32.sh
ts/run-copymany-le64.sh: Likewise.
Signed-off-by: Mark Wielaard
---
tests/run-copymany-be32.sh | 1 -
tests/run-copymany-be64.sh | 1 -
tests/run-copymany-le32.sh | 1 -
tests/run-copymany-le64.sh | 1 -
tests/test-copymany-subr.sh | 44 +++--
5 files c
ko.sh,
run-strip-reloc-self.sh and run-strip-reloc-ppc64.sh.
Signed-off-by: Mark Wielaard
---
tests/Makefile.am | 8 +-
tests/run-strip-reloc-ko.sh| 51 +++
tests/run-strip-reloc-ppc64.sh | 15
tests/run-strip-reloc-self.sh | 20 +
tests/run-strip-rel
The test doesn't really need to resolve all addresses
and -N is really slow.
* tests/run-readelf-self.sh: Add -N.
Signed-off-by: Mark Wielaard
---
tests/run-readelf-self.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/run-readelf-self.sh b/tests/run-re
:)
So that leaves the wrinkle of finding the .dwz files. And how to
connect the debuginfo to the debugsources. When pointing to a
"traditional" build-id based directory like /usr/lib/debug/ and
/usr/src/debug/
Cheers,
Mark
etting the build-ids with $ eu-unstrip --core=./the-core -n
So providing some other "static data" might be possible with a simpler
interface.
Thanks for this extensive bug report and reproducer. I play some more
with it to hopefully get you some real answers/fixes.
Cheers,
Mark
er,
and so on) and not in the namespaces of the crashing process.
One can utilize specifiers such as %P to find the right
/proc/[pid] directory and probe/enter the crashing process's
namespaces if needed.
https://man7.org/linux/man-pages/man5/core.5.html
Cheers,
Mark
is not the ideal datastructure here.
But I don't think it is causing the really long delay. That clearly
comes from the (negative) inode/dentry file search cache. But we could
look at this after we solve the other issues and we maybe want to speed
things up a bit more.
>
Cheers,
Mark
Hi,
On Mon, Jun 19, 2023 at 05:08:50PM +0200, Mark Wielaard wrote:
> Just to let you know I am looking at this. But haven't made much
> progress in understanding it yet. Thanks so much for the reproducer. I
> have been able to see the (very slow) parsing of the core file with i
eeing those performance results I understand why you were suspecting
the linked list data structure used in elf_getdata_rawchunk.
Would you be able to test a rebuild libelf with the attached patch,
which replaces that datastructure with a binary search tree?
It didn't really show much speedup
Hi Romain,
On Wed, Jun 21, 2023 at 06:14:27PM +, Romain GEISSLER wrote:
> > Le 21 juin 2023 à 18:24, Mark Wielaard a écrit :
> >
> > Seeing those performance results I understand why you were suspecting
> > the linked list data structure used in elf_getdata_rawchun
the full ELF file.
Maybe another solution might be an "get me everything for this Dwfl,
all symbol tables, all elf files, all separate Dwarf debug files, etc."
function so an application can "pay upfront" for not having to fetch
each item lazily? Such a function could then do a "parallel/batched
fetch" through debuginfod.
Cheers,
Mark
the testing of the individual fixes.
> Mark, do you think it's worth backporting this in CentOS Steam 9/RHEL 9 on
> elfutils side ? If you need a ticket, we have Red Hat case 03536980 which
> lead to RHBZ 2215412.
Yes, I'll look into it. The systemd fix seems most important si
The formatting of debuginfod_config_cache in debuginfod-client.c was
slightly off making it hard to see the program logic. Make sure lines
are < 76 chars, and if { } else { } indentation follows GNU style.
Signed-off-by: Mark Wielaard
---
debuginfod/debuginfod-client.c |
On Mon, 2023-06-26 at 16:30 +0200, Andreas Schwab via Elfutils-devel
wrote:
> Adds new RISC-V relocations.
>
> * elf.h: Update from glibc.
Thanks, looks good.
Pushed,
Mark
Hi Andreas,
On Mon, 2023-06-26 at 16:32 +0200, Andreas Schwab via Elfutils-devel
wrote:
> * backends/riscv_reloc.def: Add IRELATIVE, PLT32, SET_ULEB128,
> SUB_ULEB128.
Thanks, looks good.
Pushed,
Mark
Hi,
On Wed, 2023-06-21 at 18:24 +0200, Mark Wielaard wrote:
> libelf: Replace list of elf_getdata_rawchunk results with a
> tree
>
> elf_getdata_rawchunks did a linear search to see if a chunk was
> already fetched. Replace this list with a binary search tree to make
> lookup
'unstrip'?
Yes, that how it works, it merges the sections from the main executable
and the separate debug file into one as it was before separating them.
> Will it occur to some kind of precision error 3.
> How fast is it for like 10 million tiny binaries?
I think you will have to measure that yourself.
Cheers,
Mark
On Fri, Jun 30, 2023 at 04:09:37PM +, Romain GEISSLER wrote:
> > Le 27 juin 2023 à 16:09, Mark Wielaard a écrit :
> > On Wed, 2023-06-21 at 18:24 +0200, Mark Wielaard wrote:
> >
> > I pushed this now. It is also in Fedora Rawhide:
> > https://bodhi.fedorap
> % debuginfod-find metadata file /bin/ls
> % debuginfod-find metadata glob "/usr/local/bin/c*"
Would be nice to have some example output here. If only to explain what
the used can expect. It gives the following for me:
/home/mark/.cache/debuginfod_client/metadata/key=file&
nup while at it.
> + */
> + for (int i = 0; i < num_urls; i++)
> + {
> +curl_multi_remove_handle(curlm, data[i].handle); /* ok to repeat */
> +curl_easy_cleanup (data[i].handle);
> +free (data[i].response_data);
> +
> +if (NULL == data[i].metadata)
> +{
> + if (vfd >= 0)
> +dprintf (vfd, "Query to %s failed with error message:\n\t\"%s\"\n",
> + data[i].url, data[i].errbuf);
> + continue;
> +}
> +
> +json_object *upstream_metadata = json_tokener_parse(data[i].metadata);
> +if(NULL == upstream_metadata) continue;
> +// Combine the upstream metadata into the json array
> +for (int j = 0, n = json_object_array_length(upstream_metadata); j < n;
> j++) {
> +json_object *entry = json_object_array_get_idx(upstream_metadata, j);
> +json_object_get(entry); // increment reference count
> +json_object_array_add(json_metadata, entry);
> +}
> +json_object_put(upstream_metadata);
> +
> +free (data[i].metadata);
> + }
Do we really need libjson-c functions to combine the results? Can't
we simply return multiple json arrays/objects if we get results from
multiple servers?
> + /* Because of race with cache cleanup / rmdir, try to mkdir/mkstemp up to
> twice. */
> + for (int i=0; i<2; i++) {
> +/* (re)create target directory in cache */
> +(void) mkdir(target_cache_dir, 0700); /* files will be 0400 later */
> +
> +/* NB: write to a temporary file first, to avoid race condition of
> + multiple clients checking the cache, while a partially-written or
> empty
> + file is in there, being written from libcurl. */
> +fd = mkstemp (target_cache_tmppath);
> +if (fd >= 0) break;
> + }
> + if (fd < 0) /* Still failed after two iterations. */
> +{
> + rc = -errno;
> + goto out1;
> +}
> +
> +
> + /* Plop the complete json_metadata object into the cache. */
> + const char* json_string = json_object_to_json_string_ext(json_metadata,
> JSON_C_TO_STRING_PRETTY);
> + if (json_string == NULL)
> +{
> + rc = -ENOMEM;
> + goto out1;
> +}
> + ssize_t res = write_retry (fd, json_string, strlen(json_string));
> + (void) lseek(fd, 0, SEEK_SET); // rewind file so client can read it from
> the top
> +
> + /* NB: json_string is auto deleted when json_metadata object is nuked */
> + if (res < 0 || (size_t) res != strlen(json_string))
> +{
> + rc = -EIO;
> + goto out1;
> +}
> + /* PR27571: make cache files casually unwriteable; dirs are already 0700 */
> + (void) fchmod(fd, 0400);
> +
> + /* rename tmp->real */
> + rc = rename (target_cache_tmppath, target_cache_path);
> + if (rc < 0)
> +{
> + rc = -errno;
> + goto out1;
> + /* Perhaps we need not give up right away; could retry or something
> ... */
> +}
> +
> + /* don't close fd - we're returning it */
> + /* don't unlink the tmppath; it's already been renamed. */
> + if (path != NULL)
> + *path = strdup(target_cache_path);
> +
> + rc = fd;
> + goto out1;
> +
> +/* error exits */
> +out2:
> + /* remove all handles from multi */
> + for (int i = 0; i < num_urls; i++)
> + {
> +if (data[i].handle != NULL)
> +{
> + curl_multi_remove_handle(curlm, data[i].handle); /* ok to repeat */
> + curl_easy_cleanup (data[i].handle);
> + free (data[i].response_data);
> + free (data[i].metadata);
> +}
> + }
> +
> +out1:
> + free(data);
> +
> + for (int i = 0; i < num_urls; ++i)
> +free(server_url_list[i]);
> + free(server_url_list);
> +
> +out:
> + free (server_urls);
> + json_object_put(json_metadata);
> + /* Reset sent headers */
> + curl_slist_free_all (client->headers);
> + client->headers = NULL;
> + client->user_agent_set_p = 0;
> +
> + free (target_cache_dir);
> + free (target_cache_path);
> + free (target_cache_tmppath);
> + free (key_and_value);
> + free (cache_path);
> +
> + return rc;
> +
> +#else /* ! HAVE_JSON_C */
> + return -ENOSYS;
> +#endif
> +}
OK. That is it for debuginfod-client.c.
Will go over the rest tomorrow.
Cheers,
Mark
; +#endif
Why the HAVE_JSON_C guard? debuginfod_find_metadata will return -ENOSYS
if there is no support doesn't it?
>else
> {
>argp_help (&argp, stderr, ARGP_HELP_USAGE, argv[0]);
> @@ -240,8 +267,6 @@ main(int argc, char** argv)
>debuginfod_end (clie
ler
>
> +
> + PR29472: debuginfod metadata query
> + * debuginfod-find.1: Document metadata query.
> + * debuginfod-client-config.7: Document metadata cache control setting.
> + * debuginfod.8: Document new option and webapi.
> +
> 2023-02-14 Mark Wielaar
cxx
> index 5ef6cc32189b..000820fec5ea 100644
> --- a/debuginfod/debuginfod.cxx
> +++ b/debuginfod/debuginfod.cxx
> @@ -1,5 +1,5 @@
> /* Debuginfo-over-http server.
> - Copyright (C) 2019-2021 Red Hat, Inc.
> + Copyright (C) 2019-2023 Red Hat, Inc.
> Copyright (C) 2021
hive: "" } ]
Or return an error as:
{
"error": "Server unreachable code: 554"
}
- I don't really know how to reason properly about the merging done for
results from multiple federated servers. But it seems to make it
impossible to distinguish between no results or an error fetching
results. Maybe creating one big results array as is done is the most
sane way. Have you though of other ways to represent "merged" results?
Cheers,
Mark
or near /
> FAIL run-lfs-symbols.sh (exit status: 2)
> ```
>
> * tests/run-lfs-symbols.sh: Call 'gawk' instead of 'awk'.
Thanks. We already require gawk for known-dwarf.awk, check for it in
configure and use it for the coverage generation.
Pushed,
Mark
> https://builder.sourceware.org/buildbot/#builders/225/builds/84/steps/2/logs/err_text
> - err.html:
> https://builder.sourceware.org/buildbot/#builders/225/builds/84/steps/2/logs/err_html
>
This is your buildbot builder. Please kick it! :)
Cheers,
Mark
l table section 3 is and what 742th symbol in
that table is? And does libtarget_1.so actually contain a .rustc
section?
Thanks,
Mark
google or github account to login).
Thanks,
Mark
On Thu, Jul 27, 2023 at 01:44:24PM -0700, ClusterFuzz-External via monorail via
Elfutils-devel wrote:
> Status: New
> Owner:
> CC: elfut...@sourceware.org, da...@adalogics.com, evv...@gmail.com,
> izz...@google.com
> Labe
4328c88fd610decaf311020ffc7073aec1db252/projects/elfutils/fuzz-libelf.c#L27C6-L27C20
Thanks, I can replicate it with that and valgrind. The issue is when
elf_strptr has (partially) uncompressed the section data (to read the
uncompressed string), the program never requests the (uncompressed)
section data, but does (re)compress it.
Working on a fix.
Cheers,
Mark
wdata): Free zdata_base if it isn't
(going to be) used for rawdata_base. Explicitly clear
rawdata_base and zdata_base after free.
* libelf/elf_end.c (elf_end): Clear zdata_base after free.
Signed-off-by: Mark Wielaard
---
libelf/elf_compress.c | 14 +-
libelf
=
> make[1]: Nothing to be done for 'check-am'.
>
> Is that right result?
That looks correct yes.
Cheers,
Mark
er this error infor:
> https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=7bf4b63a4980788e6c1969cae02f0483e79c069f;hp=4f7b5ba9624489b5a2f714569c29ef865d4dcd6f
> Is this error info an expected behavior?
Yes. It is an expected warning.
Cheers,
Mark
201 - 300 of 3433 matches
Mail list logo