[Bug libdw/30047] libdw unable to handle DW_TAG_unspecified_type

2023-02-14 Thread mliska at suse dot cz via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=30047

--- Comment #7 from Martin Liska  ---
Thank you, Mark. Can you please commit the patch so that very can cherry-pick
it?

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

Re: (subset) [PATCH v3 1/4] tests: Ignore dwfl-report-offline-memory

2023-02-14 Thread Mark Wielaard
On Mon, 13 Feb 2023 17:45:48 +0100, Ilya Leoshkevich wrote:
> It's showing up in git status when configuring in the source directory.
> 
> 

Applied, thanks!

[1/4] tests: Ignore dwfl-report-offline-memory
  commit: 8ececddf9de612bc556b16df234254291196a65d

Best regards,
-- 
Mark Wielaard 


Re: (subset) [PATCH v3 2/4] printversion: Fix unused variable

2023-02-14 Thread Mark Wielaard
On Mon, 13 Feb 2023 17:45:49 +0100, Ilya Leoshkevich wrote:
> clang complains:
> 
> debuginfod.cxx:354:1: error: unused variable 'apba__' 
> [-Werror,-Wunused-const-variable]
> ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
> ^
> ../lib/printversion.h:47:21: note: expanded from macro 
> 'ARGP_PROGRAM_BUG_ADDRESS_DEF'
>   const char *const apba__ __asm ("argp_program_bug_address")
> ^
> 
> [...]

Applied, thanks!

[2/4] printversion: Fix unused variable
  commit: 47297d8bf2f516b66b6d45934849137ab7658a99

Best regards,
-- 
Mark Wielaard 


Re: [PATCH v3 3/4] backends: Support returning lvalue and rvalue references

2023-02-14 Thread Mark Wielaard
Hi Ilya,

On Mon, 2023-02-13 at 17:45 +0100, Ilya Leoshkevich wrote:
> On the low level, they are the same as pointers. The change needs to be
> done for all backends, so define a function and a macro to avoid
> repetition. Also add a native test, which has to be implemented in C++.
> Add the configure check for it.

I love everything about this patch (except for missing a ChangeLog
entry, but lets ignore that). The way you abstracted the pointer type
for the backends, the new test and the configure addition are all very
nice.

There is one small issue with the test. In case there is a C++11
compiler available run-funcretval++11.sh is added to TESTS twice, and
it is never added to EXTRA_DIST. So I pushed it with this small change:

diff --git a/tests/Makefile.am b/tests/Makefile.am
index bfc03061..efbb4e63 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -203,7 +203,7 @@ TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile 
test-nlist \
$(asm_TESTS) run-disasm-bpf.sh run-low_high_pc-dw-form-indirect.sh \
run-nvidia-extended-linemap-libdw.sh 
run-nvidia-extended-linemap-readelf.sh \
run-readelf-dw-form-indirect.sh run-strip-largealign.sh \
-   run-readelf-Dd.sh run-funcretval++11.sh
+   run-readelf-Dd.sh
 
 if !BIARCH
 export ELFUTILS_DISABLE_BIARCH = 1
@@ -610,7 +610,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
 run-readelf-dw-form-indirect.sh testfile-dw-form-indirect.bz2 \
 run-nvidia-extended-linemap-libdw.sh 
run-nvidia-extended-linemap-readelf.sh \
 testfile_nvidia_linemap.bz2 \
-testfile-largealign.o.bz2 run-strip-largealign.sh
+testfile-largealign.o.bz2 run-strip-largealign.sh \
+run-funcretval++11.sh
 
 
 if USE_VALGRIND

Thanks,

Mark


Re: [PATCH v3 4/4] configure: Add --enable-sanitize-memory

2023-02-14 Thread Mark Wielaard
Hi Ilya,

On Mon, 2023-02-13 at 17:45 +0100, Ilya Leoshkevich wrote:
> Add support for clang Memory Sanitizer [1], which detects the usage of
> uninitialized values. While elfutils itself is already checked with
> valgrind, checking code that depends on elfutils requires elfutils to
> be built with MSan.
> 
> MSan is not linked into shared libraries, and is linked into
> executables statically. Therefore, unlike the other sanitizers, MSan
> needs to be configured fairly early, since we need to drop
> -D_FORTIFY_SOURCE [2], -Wl,-z,defs and --no-undefined.
> 
> Disable a few tests that run for more than 5 minutes due to test files
> being statically linked with MSan.

Although I wasn't able to test this locally it looks all good. I did
check the _FORTIFY_SOURCE and like flags are still normal and no tests
are skipped without --enable-sanitize-memory.

Pushed.

Thanks,

Mark


[Bug libdw/30047] libdw unable to handle DW_TAG_unspecified_type

2023-02-14 Thread mark at klomp dot org via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=30047

Mark Wielaard  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #8 from Mark Wielaard  ---
commit f2c522567ad63ac293535fba9704895e685ab5bc
Author: Mark Wielaard 
Date:   Thu Jan 26 18:19:15 2023 +0100

backends: Handle DW_TAG_unspecified_type in dwarf_peeled_die_type

binutils 2.40 introduces DW_TAG_unspecified_type for assembly
functions with an unknown return type. This breaks the
run-funcretval.sh testcase because dwfl_module_return_value_location
returns an error for such functions because it cannot determine the
return value location. Fix that by treating DW_TAG_unspecified_type
as if the DIE doesn't have a DW_AT_type.

Also update the testcase to explicitly checking for
DW_TAG_unspecified_type and printing "returns unspecified type".

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

Signed-off-by: Mark Wielaard 

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

Re: [PATCH v2] libdw: check memory access in get_(u|s)leb128

2023-02-14 Thread Mark Wielaard
Hi Aleksei,

On Mon, 2023-02-13 at 20:10 +, Aleksei Vetrov via Elfutils-devel
wrote:
> __libdw_get_uleb128 and __libdw_get_sleb128 should check if addrp has
> already reached the end before unrolling the first step. It is done by
> moving __libdw_max_len to the beginning of the function, which can
> notice, that addrp is beyond the end. Then we just check the result of
> this function.

This looks good. And I couldn't measure any meaningful performance
difference. Pushed.

Even though this now catches all calls that have start >= end, I'll
also push my other patch to add extra guards in the callers of
get_(u|s)leb128, because that does provide us with better error
messages.

Thanks,

Mark


☠ Buildbot (Sourceware): elfutils - failed test (failure) (master)

2023-02-14 Thread builder--- via Elfutils-devel
A new failure has been detected on builder elfutils-debian-ppc64 while building 
elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/63/builds/145

Build state: failed test (failure)
Revision: 8ececddf9de612bc556b16df234254291196a65d
Worker: debian-ppc64
Build Reason: (unknown)
Blamelist: Ilya Leoshkevich 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/6/logs/warnings__3_

- 7: make check ( failure )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/7/logs/test-suite_log

- 8: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/8/logs/stdio

- 9: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/9/logs/stdio

- 10: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/10/logs/stdio

- 11: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/11/logs/stdio

- 12: pass .bunsen.source.gitname ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/12/logs/stdio

- 13: pass .bunsen.source.gitdescribe ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/13/logs/stdio

- 14: pass .bunsen.source.gitbranch ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/14/logs/stdio

- 15: pass .bunsen.source.gitrepo ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/15/logs/stdio

- 16: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/16/logs/stdio

- 17: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/17/logs/stdio

- 18: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/145/steps/18/logs/stdio

A restored build 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/112

Build state: build successful
Revision: 8ececddf9de612bc556b16df234254291196a65d
Worker: bb1-2
Build Reason: (unknown)
Blamelist: Ilya Leoshkevich 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/88/builds/112/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/88/builds/112/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/88/builds/112/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/88/builds/112/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/88/builds/112/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/88/builds/112/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/88/builds/112/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/88/builds/112/steps/6/logs/warnings__3_

- 7: make check ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/88/builds/112/s

Re: [PATCH] libdw: Handle DW_OP_GNU_uninit in dwarf_getlocation

2023-02-14 Thread Mark Wielaard
Hi,

On Fri, 2023-02-10 at 14:01 +0100, Mark Wielaard wrote:
> dwarf_getlocation would return an error when it saw a
> DW_OP_GNU_uninit. Handle it by simply recognizing as a no argument
> operation.
> 
> DW_OP_GNU_uninit is emitted by GCC as a marker to flag the location
> expression as referring to an uninitialized value.

I pushed this.

Cheers,

Mark


Re: ☠ Buildbot (Sourceware): elfutils - failed test (failure) (master)

2023-02-14 Thread Mark Wielaard
Hi,

On Tue, 2023-02-14 at 16:14 +, builder--- via Elfutils-devel wrote:
> A new failure has been detected on builder elfutils-debian-ppc64 while 
> building elfutils.
> 
> Full details are available at:
> https://builder.sourceware.org/buildbot/#builders/63/builds/145
> 
> Build state: failed test (failure)
> Revision: 8ececddf9de612bc556b16df234254291196a65d
> Worker: debian-ppc64
> Build Reason: (unknown)
> Blamelist: Ilya Leoshkevich 

FAIL: run-native-test.sh

/var/lib/buildbot/workers/wildebeest/elfutils-debian-
ppc64/build/tests/funcretval: dwfl_module_return_value_location: cannot
handle DWARF type description
FAIL run-native-test.sh (exit status: 1)

This isn't caused by this commit.

The machine just got upgrade.
I suspect it is:
https://sourceware.org/bugzilla/show_bug.cgi?id=30047

For which a fix was just pushed.
So hopefully we'll see this turn green soon.

Cheers,

Mark


☺ Buildbot (Sourceware): elfutils - build successful (master)

2023-02-14 Thread builder--- via Elfutils-devel
A restored build has been detected on builder elfutils-debian-ppc64 while 
building elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/63/builds/149

Build state: build successful
Revision: f2c522567ad63ac293535fba9704895e685ab5bc
Worker: debian-ppc64
Build Reason: (unknown)
Blamelist: Ilya Leoshkevich , Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/6/logs/warnings__3_

- 7: make check ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/7/logs/test-suite_log

- 8: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/8/logs/stdio

- 9: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/9/logs/stdio

- 10: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/10/logs/stdio

- 11: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/11/logs/stdio

- 12: pass .bunsen.source.gitname ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/12/logs/stdio

- 13: pass .bunsen.source.gitdescribe ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/13/logs/stdio

- 14: pass .bunsen.source.gitbranch ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/14/logs/stdio

- 15: pass .bunsen.source.gitrepo ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/15/logs/stdio

- 16: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/16/logs/stdio

- 17: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/17/logs/stdio

- 18: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/149/steps/18/logs/stdio



☠ Buildbot (Sourceware): elfutils - failed test (failure) (master)

2023-02-14 Thread builder--- via Elfutils-devel
A new failure has been detected on builder elfutils-opensuseleap-x86_64 while 
building elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/90/builds/119

Build state: failed test (failure)
Revision: e444d60a341b7b9bc3ae763a843d3e7190234ca9
Worker: bb2-2
Build Reason: (unknown)
Blamelist: Aleksei Vetrov 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/6/logs/stdio
- warnings (2): 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/6/logs/warnings__2_

- 7: make check ( failure )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/7/logs/test-suite_log

- 8: make distcheck ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/8/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/8/logs/test-suite_log
- warnings (5): 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/8/logs/warnings__5_

- 9: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/9/logs/stdio

- 10: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/10/logs/stdio

- 11: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/11/logs/stdio

- 12: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/12/logs/stdio

- 13: pass .bunsen.source.gitname ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/13/logs/stdio

- 14: pass .bunsen.source.gitdescribe ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/14/logs/stdio

- 15: pass .bunsen.source.gitbranch ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/15/logs/stdio

- 16: pass .bunsen.source.gitrepo ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/16/logs/stdio

- 17: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/17/logs/stdio

- 18: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/18/logs/stdio

- 19: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/90/builds/119/steps/19/logs/stdio



☠ Buildbot (Sourceware): elfutils - failed test (failure) (master)

2023-02-14 Thread builder--- via Elfutils-devel
A new failure has been detected on builder elfutils-debian-armhf while building 
elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/6/builds/143

Build state: failed test (failure)
Revision: 922068cebba6ed0dfc2da0a9e40e3e1b63e0aca9
Worker: debian-armhf
Build Reason: (unknown)
Blamelist: Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/6/logs/warnings__3_

- 7: make check ( failure )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/7/logs/test-suite_log

- 8: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/8/logs/stdio

- 9: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/9/logs/stdio

- 10: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/10/logs/stdio

- 11: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/11/logs/stdio

- 12: pass .bunsen.source.gitname ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/12/logs/stdio

- 13: pass .bunsen.source.gitdescribe ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/13/logs/stdio

- 14: pass .bunsen.source.gitbranch ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/14/logs/stdio

- 15: pass .bunsen.source.gitrepo ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/15/logs/stdio

- 16: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/16/logs/stdio

- 17: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/17/logs/stdio

- 18: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/143/steps/18/logs/stdio

A new failure has been detected on builder elfutils-debian-i386 while building 
elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/17/builds/147

Build state: failed test (failure)
Revision: 922068cebba6ed0dfc2da0a9e40e3e1b63e0aca9
Worker: debian-i386
Build Reason: (unknown)
Blamelist: Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/147/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/147/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/147/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/17/builds/147/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/147/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/17/builds/147/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/147/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/17/builds/147/steps/6/logs/warnings__3_

- 7: make check ( failure )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/147/steps/7/logs/stdio

Re: ☠ Buildbot (Sourceware): elfutils - failed test (failure) (master)

2023-02-14 Thread Mark Wielaard
On Tue, Feb 14, 2023 at 04:56:39PM +, builder--- via Elfutils-devel wrote:
> A new failure has been detected on builder elfutils-opensuseleap-x86_64 while 
> building elfutils.
> 
> Full details are available at:
> https://builder.sourceware.org/buildbot/#builders/90/builds/119
> 
> Build state: failed test (failure)
> Revision: e444d60a341b7b9bc3ae763a843d3e7190234ca9
> Worker: bb2-2
> Build Reason: (unknown)
> Blamelist: Aleksei Vetrov 

FAIL: run-debuginfod-federation-metrics.sh

This isn't caused by this patch.  It is a suprious failure in
libmicrohttpd which occassionally pops up :{



Re: ☠ Buildbot (Sourceware): elfutils - failed test (failure) (master)

2023-02-14 Thread Mark Wielaard
On Tue, Feb 14, 2023 at 05:02:06PM +, builder--- via Elfutils-devel wrote:
> A new failure has been detected on builder elfutils-debian-armhf while 
> building elfutils.
> 
> Full details are available at:
> https://builder.sourceware.org/buildbot/#builders/6/builds/143
> 
> Build state: failed test (failure)
> Revision: 922068cebba6ed0dfc2da0a9e40e3e1b63e0aca9
> Worker: debian-armhf
> Build Reason: (unknown)
> Blamelist: Mark Wielaard 

[...]
 
> A new failure has been detected on builder elfutils-debian-i386 while 
> building elfutils.
> 
> Full details are available at:
> https://builder.sourceware.org/buildbot/#builders/17/builds/147
> 
> Build state: failed test (failure)
> Revision: 922068cebba6ed0dfc2da0a9e40e3e1b63e0aca9
> Worker: debian-i386
> Build Reason: (unknown)
> Blamelist: Mark Wielaard 

These seem really to be caused by my commit adding the extra guard
checks for leb128. Somewhat suspecious they happen on 32bit arches.
I'll investigate.

Cheers,

Mark


[COMMITTED] libdw: Correct data end checkfor deref_type operand in dwarf_getlocation

2023-02-14 Thread Mark Wielaard
In __libdw_intern_expression we checked for one byte too many.
We only need one byte for the size and (at least one) for the uleb128
DIE reference.

Signed-off-by: Mark Wielaard 
---

This wrong check caused the recent buildbot failure on some arches.

 libdw/ChangeLog   | 5 +
 libdw/dwarf_getlocation.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index ddf14e55..e0cd8f21 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,8 @@
+2023-02-14  Mark Wielaard  
+
+   * dwarf_getlocation.c (__libdw_intern_expression): Correct check
+   for deref_type.
+
 2023-02-10  Mark Wielaard  
 
* dwarf_getlocation.c (__libdw_intern_expression): Handle
diff --git a/libdw/dwarf_getlocation.c b/libdw/dwarf_getlocation.c
index 66eab3e9..553fdc98 100644
--- a/libdw/dwarf_getlocation.c
+++ b/libdw/dwarf_getlocation.c
@@ -546,7 +546,7 @@ __libdw_intern_expression (Dwarf *dbg, bool 
other_byte_order,
case DW_OP_deref_type:
case DW_OP_GNU_deref_type:
case DW_OP_xderef_type:
- if (unlikely (data + 2 >= end_data))
+ if (unlikely (data + 1 >= end_data))
goto invalid;
  newloc->number = *data++;
  get_uleb128 (newloc->number2, data, end_data);
-- 
2.31.1



☺ Buildbot (Sourceware): elfutils - build successful (master)

2023-02-14 Thread builder--- via Elfutils-devel
A restored build has been detected on builder elfutils-debian-armhf while 
building elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/6/builds/145

Build state: build successful
Revision: 0e8306768a6d0195c01644e7c5a6fff027fd19f2
Worker: debian-armhf
Build Reason: (unknown)
Blamelist: Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/6/logs/warnings__3_

- 7: make check ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/7/logs/test-suite_log

- 8: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/8/logs/stdio

- 9: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/9/logs/stdio

- 10: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/10/logs/stdio

- 11: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/11/logs/stdio

- 12: pass .bunsen.source.gitname ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/12/logs/stdio

- 13: pass .bunsen.source.gitdescribe ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/13/logs/stdio

- 14: pass .bunsen.source.gitbranch ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/14/logs/stdio

- 15: pass .bunsen.source.gitrepo ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/15/logs/stdio

- 16: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/16/logs/stdio

- 17: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/17/logs/stdio

- 18: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/6/builds/145/steps/18/logs/stdio

A restored build has been detected on builder elfutils-debian-i386 while 
building elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/17/builds/149

Build state: build successful
Revision: 0e8306768a6d0195c01644e7c5a6fff027fd19f2
Worker: debian-i386-2
Build Reason: (unknown)
Blamelist: Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/149/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/149/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/149/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/17/builds/149/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/149/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/17/builds/149/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/149/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/17/builds/149/steps/6/logs/warnings__3_

- 7: make check ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/17/builds/149/steps/7/logs/stdio
- 

[PATCH] libdw: check that DWARF strings are null-terminated

2023-02-14 Thread Aleksei Vetrov via Elfutils-devel
From: Aleksei Vetrov 

It is expected from libdw to return strings that are null-terminated to
avoid overflowing ELF data.

* Add calculation of a safe prefix inside string sections, where any
  string will be null-terminated.

* Check if offset overflows the safe prefix in dwarf_formstring.

Signed-off-by: Aleksei Vetrov 
---
 libdw/dwarf_begin_elf.c  | 37 +
 libdw/dwarf_formstring.c |  5 -
 libdw/libdwP.h   | 11 +++
 3 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index 8fcef335..76b30a3c 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -70,6 +70,30 @@ static const char dwarf_scnnames[IDX_last][19] =
 };
 #define ndwarf_scnnames (sizeof (dwarf_scnnames) / sizeof (dwarf_scnnames[0]))
 
+/* Map from section index to string secton index.
+   Non-string sections should have STR_SCN_IDX_last.  */
+static const enum string_secton_index scn_to_string_secton_idx[IDX_last] =
+{
+  [IDX_debug_info] = STR_SCN_IDX_last,
+  [IDX_debug_types] = STR_SCN_IDX_last,
+  [IDX_debug_abbrev] = STR_SCN_IDX_last,
+  [IDX_debug_addr] = STR_SCN_IDX_last,
+  [IDX_debug_aranges] = STR_SCN_IDX_last,
+  [IDX_debug_line] = STR_SCN_IDX_last,
+  [IDX_debug_line_str] = STR_SCN_IDX_debug_line_str,
+  [IDX_debug_frame] = STR_SCN_IDX_last,
+  [IDX_debug_loc] = STR_SCN_IDX_last,
+  [IDX_debug_loclists] = STR_SCN_IDX_last,
+  [IDX_debug_pubnames] = STR_SCN_IDX_last,
+  [IDX_debug_str] = STR_SCN_IDX_debug_str,
+  [IDX_debug_str_offsets] = STR_SCN_IDX_last,
+  [IDX_debug_macinfo] = STR_SCN_IDX_last,
+  [IDX_debug_macro] = STR_SCN_IDX_last,
+  [IDX_debug_ranges] = STR_SCN_IDX_last,
+  [IDX_debug_rnglists] = STR_SCN_IDX_last,
+  [IDX_gnu_debugaltlink] = STR_SCN_IDX_last
+};
+
 static enum dwarf_type
 scn_dwarf_type (Dwarf *result, size_t shstrndx, Elf_Scn *scn)
 {
@@ -230,6 +254,19 @@ check_section (Dwarf *result, size_t shstrndx, Elf_Scn 
*scn, bool inscngrp)
   /* We can now read the section data into results. */
   result->sectiondata[cnt] = data;
 
+  /* If the section contains string data, we want to know a size of a prefix
+ where any string will be null-terminated. */
+  enum string_secton_index string_secton_idx = scn_to_string_secton_idx[cnt];
+  if (string_secton_idx < STR_SCN_IDX_last)
+{
+  size_t size = data->d_size;
+  /* Reduce the size by the number of non-zero bytes at the end of the
+section.  */
+  while (size > 0 && *((const char *) data->d_buf + size - 1) != '\0')
+   --size;
+  result->string_secton_size[string_secton_idx] = size;
+}
+
   return result;
 }
 
diff --git a/libdw/dwarf_formstring.c b/libdw/dwarf_formstring.c
index c3e892a8..a6f511f8 100644
--- a/libdw/dwarf_formstring.c
+++ b/libdw/dwarf_formstring.c
@@ -61,6 +61,9 @@ dwarf_formstring (Dwarf_Attribute *attrp)
   Elf_Data *data = ((attrp->form == DW_FORM_line_strp)
? dbg_ret->sectiondata[IDX_debug_line_str]
: dbg_ret->sectiondata[IDX_debug_str]);
+  size_t data_size = ((attrp->form == DW_FORM_line_strp)
+ ? dbg_ret->string_secton_size[STR_SCN_IDX_debug_line_str]
+ : dbg_ret->string_secton_size[STR_SCN_IDX_debug_str]);
   if (data == NULL)
 {
   __libdw_seterrno ((attrp->form == DW_FORM_line_strp)
@@ -171,7 +174,7 @@ dwarf_formstring (Dwarf_Attribute *attrp)
   else
off = read_8ubyte_unaligned (dbg, datap);
 
-  if (off > dbg->sectiondata[IDX_debug_str]->d_size)
+  if (off >= data_size)
goto invalid_offset;
 }
 
diff --git a/libdw/libdwP.h b/libdw/libdwP.h
index 961fa4e7..55eb45ed 100644
--- a/libdw/libdwP.h
+++ b/libdw/libdwP.h
@@ -86,6 +86,13 @@ enum
 IDX_last
   };
 
+/* Valid indices for the string section's information.  */
+enum string_secton_index
+  {
+STR_SCN_IDX_debug_line_str,
+STR_SCN_IDX_debug_str,
+STR_SCN_IDX_last
+  };
 
 /* Error values.  */
 enum
@@ -169,6 +176,10 @@ struct Dwarf
   /* The section data.  */
   Elf_Data *sectiondata[IDX_last];
 
+  /* Size of a prefix of string sections, where any string will be
+ null-terminated. */
+  size_t string_secton_size[STR_SCN_IDX_last];
+
   /* True if the file has a byte order different from the host.  */
   bool other_byte_order;
 
-- 
2.39.1.581.gbfd45094c4-goog



[COMMITTED] doc: Add .TP before -g in debuginfod.8

2023-02-14 Thread Mark Wielaard
Fixes indentation of -g option.

Signed-off-by: Mark Wielaard 
---
 doc/ChangeLog| 4 
 doc/debuginfod.8 | 1 +
 2 files changed, 5 insertions(+)

diff --git a/doc/ChangeLog b/doc/ChangeLog
index b2ef357a..7f2d6ff4 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2023-02-14  Mark Wielaard  
+
+   * debuginfod.8: Add .TP before -g.
+
 2023-01-11  Frank Ch. Eigler  
 
* debuginfod.8: Tweak -c/-C documentation for heuristic defaults.
diff --git a/doc/debuginfod.8 b/doc/debuginfod.8
index 6d73256f..07cb01ae 100644
--- a/doc/debuginfod.8
+++ b/doc/debuginfod.8
@@ -174,6 +174,7 @@ interrupting a groom pass (if any).
 .B "\-r"
 Apply the -I and -X during groom cycles, so that files excluded by the regexes 
are removed from the index. These parameters are in addition to what normally 
qualifies a file for grooming, not a replacement.
 
+.TP
 .B "\-g SECONDS" "\-\-groom\-time=SECONDS"
 Set the groom time for the index database.  This is the amount of time
 the grooming thread will wait after finishing a grooming pass before
-- 
2.31.1



[PATCH v2 0/1] libdw: check that DWARF strings are null-terminated

2023-02-14 Thread Aleksei Vetrov via Elfutils-devel
Hello,

In the first version of the patch was typo "secton" everywhere.
Reuploading fixed version.

Aleksei Vetrov (1):
  libdw: check that DWARF strings are null-terminated

 libdw/dwarf_begin_elf.c  | 37 +
 libdw/dwarf_formstring.c |  5 -
 libdw/libdwP.h   | 11 +++
 3 files changed, 52 insertions(+), 1 deletion(-)

-- 
2.39.1.581.gbfd45094c4-goog



[PATCH v2 1/1] libdw: check that DWARF strings are null-terminated

2023-02-14 Thread Aleksei Vetrov via Elfutils-devel
It is expected from libdw to return strings that are null-terminated to
avoid overflowing ELF data.

* Add calculation of a safe prefix inside string sections, where any
  string will be null-terminated.

* Check if offset overflows the safe prefix in dwarf_formstring.

Signed-off-by: Aleksei Vetrov 
---
 libdw/dwarf_begin_elf.c  | 37 +
 libdw/dwarf_formstring.c |  5 -
 libdw/libdwP.h   | 11 +++
 3 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index 8fcef335..1d4bb333 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -70,6 +70,30 @@ static const char dwarf_scnnames[IDX_last][19] =
 };
 #define ndwarf_scnnames (sizeof (dwarf_scnnames) / sizeof (dwarf_scnnames[0]))
 
+/* Map from section index to string section index.
+   Non-string sections should have STR_SCN_IDX_last.  */
+static const enum string_section_index scn_to_string_section_idx[IDX_last] =
+{
+  [IDX_debug_info] = STR_SCN_IDX_last,
+  [IDX_debug_types] = STR_SCN_IDX_last,
+  [IDX_debug_abbrev] = STR_SCN_IDX_last,
+  [IDX_debug_addr] = STR_SCN_IDX_last,
+  [IDX_debug_aranges] = STR_SCN_IDX_last,
+  [IDX_debug_line] = STR_SCN_IDX_last,
+  [IDX_debug_line_str] = STR_SCN_IDX_debug_line_str,
+  [IDX_debug_frame] = STR_SCN_IDX_last,
+  [IDX_debug_loc] = STR_SCN_IDX_last,
+  [IDX_debug_loclists] = STR_SCN_IDX_last,
+  [IDX_debug_pubnames] = STR_SCN_IDX_last,
+  [IDX_debug_str] = STR_SCN_IDX_debug_str,
+  [IDX_debug_str_offsets] = STR_SCN_IDX_last,
+  [IDX_debug_macinfo] = STR_SCN_IDX_last,
+  [IDX_debug_macro] = STR_SCN_IDX_last,
+  [IDX_debug_ranges] = STR_SCN_IDX_last,
+  [IDX_debug_rnglists] = STR_SCN_IDX_last,
+  [IDX_gnu_debugaltlink] = STR_SCN_IDX_last
+};
+
 static enum dwarf_type
 scn_dwarf_type (Dwarf *result, size_t shstrndx, Elf_Scn *scn)
 {
@@ -230,6 +254,19 @@ check_section (Dwarf *result, size_t shstrndx, Elf_Scn 
*scn, bool inscngrp)
   /* We can now read the section data into results. */
   result->sectiondata[cnt] = data;
 
+  /* If the section contains string data, we want to know a size of a prefix
+ where any string will be null-terminated. */
+  enum string_section_index string_section_idx = 
scn_to_string_section_idx[cnt];
+  if (string_section_idx < STR_SCN_IDX_last)
+{
+  size_t size = data->d_size;
+  /* Reduce the size by the number of non-zero bytes at the end of the
+section.  */
+  while (size > 0 && *((const char *) data->d_buf + size - 1) != '\0')
+   --size;
+  result->string_section_size[string_section_idx] = size;
+}
+
   return result;
 }
 
diff --git a/libdw/dwarf_formstring.c b/libdw/dwarf_formstring.c
index c3e892a8..0ee42411 100644
--- a/libdw/dwarf_formstring.c
+++ b/libdw/dwarf_formstring.c
@@ -61,6 +61,9 @@ dwarf_formstring (Dwarf_Attribute *attrp)
   Elf_Data *data = ((attrp->form == DW_FORM_line_strp)
? dbg_ret->sectiondata[IDX_debug_line_str]
: dbg_ret->sectiondata[IDX_debug_str]);
+  size_t data_size = ((attrp->form == DW_FORM_line_strp)
+ ? dbg_ret->string_section_size[STR_SCN_IDX_debug_line_str]
+ : dbg_ret->string_section_size[STR_SCN_IDX_debug_str]);
   if (data == NULL)
 {
   __libdw_seterrno ((attrp->form == DW_FORM_line_strp)
@@ -171,7 +174,7 @@ dwarf_formstring (Dwarf_Attribute *attrp)
   else
off = read_8ubyte_unaligned (dbg, datap);
 
-  if (off > dbg->sectiondata[IDX_debug_str]->d_size)
+  if (off >= data_size)
goto invalid_offset;
 }
 
diff --git a/libdw/libdwP.h b/libdw/libdwP.h
index 961fa4e7..5cbdc279 100644
--- a/libdw/libdwP.h
+++ b/libdw/libdwP.h
@@ -86,6 +86,13 @@ enum
 IDX_last
   };
 
+/* Valid indices for the string section's information.  */
+enum string_section_index
+  {
+STR_SCN_IDX_debug_line_str,
+STR_SCN_IDX_debug_str,
+STR_SCN_IDX_last
+  };
 
 /* Error values.  */
 enum
@@ -169,6 +176,10 @@ struct Dwarf
   /* The section data.  */
   Elf_Data *sectiondata[IDX_last];
 
+  /* Size of a prefix of string sections, where any string will be
+ null-terminated. */
+  size_t string_section_size[STR_SCN_IDX_last];
+
   /* True if the file has a byte order different from the host.  */
   bool other_byte_order;
 
-- 
2.39.1.581.gbfd45094c4-goog



☺ Buildbot (Sourceware): elfutils - build successful (master)

2023-02-14 Thread builder--- via Elfutils-devel
A restored build has been detected on builder elfutils-debian-ppc64 while 
building elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/63/builds/154

Build state: build successful
Revision: 67199e1c974db37f2bd200dcca7d7103f42ed06e
Worker: debian-ppc64
Build Reason: (unknown)
Blamelist: Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/6/logs/warnings__3_

- 7: make check ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/7/logs/test-suite_log

- 8: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/8/logs/stdio

- 9: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/9/logs/stdio

- 10: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/10/logs/stdio

- 11: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/11/logs/stdio

- 12: pass .bunsen.source.gitname ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/12/logs/stdio

- 13: pass .bunsen.source.gitdescribe ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/13/logs/stdio

- 14: pass .bunsen.source.gitbranch ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/14/logs/stdio

- 15: pass .bunsen.source.gitrepo ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/15/logs/stdio

- 16: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/16/logs/stdio

- 17: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/17/logs/stdio

- 18: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/63/builds/154/steps/18/logs/stdio

A new failure has been detected on builder elfutils-gentoo-sparc while building 
elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/225/builds/28

Build state: failed test (failure)
Revision: 67199e1c974db37f2bd200dcca7d7103f42ed06e
Worker: gentoo-sparc
Build Reason: (unknown)
Blamelist: Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/225/builds/28/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/225/builds/28/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/225/builds/28/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/225/builds/28/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/225/builds/28/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/225/builds/28/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/225/builds/28/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/225/builds/28/steps/6/logs/warnings__3_

- 7: make check ( failure )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/225/builds/28/steps