Re: [PATCH 2/2] libdw: Use elf_rawdata when checking .debug section

2023-02-21 Thread Mark Wielaard
Hi,

On Tue, 2023-02-21 at 05:28 +0300, Evgeny Vereshchagin wrote:
> On Mon, 20 Feb 2023 at 19:03, Aleksei Vetrov  wrote:
> > On Mon, Feb 20, 2023 at 3:55 PM Mark Wielaard  wrote:
> > > 
> > > .debug sections are raw bytes and don't need conversion even when host
> > > and file have different endian order.
> > 
> > Thank you! I like this patch more for its simplicity, looks good to me.
> 
> Agreed. I haven't actually tested the patch though but since it's
> covered by the fuzz
> target it should be tested once it's merged anyway.

I was actually planning on pushing both patches.
This one makes sure the conversion code isn't called, because that is
unnecessary in this case. The first patch adjusts the conversion code
so it doesn't leave some undefined bytes in the section data.

> On a somewhat related looking at some recent patches and especially
> https://sourceware.org/git/?p=elfutils.git;a=commit;h=64ee2cb792e7b6ba6ad2a5759bff7ce8714e4668
> it seems apart from OSS-Fuzz elfutils is fuzzed elsewhere. Aleksei I
> wonder if it would
> be possible to add those fuzz targets to OSS-Fuzz? There are blind
> spots there and I think it would be
> really great to start covering at least some of them.

I do often run a fuzzer (afl with --enable-sanitize-undefined and --
enable-sanitize-address with CC="afl-gcc -m32") when writing a new
testcase. Some testcases are nice as fuzz targets because they test
just one function, so running the fuzzer for a couple of hours exhausts
the different input values.

Cheers,

Mark


Re: [PATCH] libasm: Fix use-after-free issue with circular single linked list cleanup

2023-02-21 Thread Mark Wielaard
Hi,

On Fri, 2023-02-17 at 15:00 +0100, Mark Wielaard wrote:
> Pointed out by gcc 12 with -Wuse-after-free=3
> 
> In function ‘free_section’
> asm_end.c:552:17: error: pointer ‘data’ used after ‘free’ 
> [-Werror=use-after-free]
>   552 | while (oldp != scnp->content);
>   |~^~~~
> asm_end.c:550:9: note: call to ‘free’ here
>   550 | free (oldp);
>   | ^~~
> 
> Fix by freeing scnp->content last.

I pushed this and also committed the attached patch that adds -Wuse-
after-free=3 if the compiler supports it.

Cheers,

Mark
From c9c055a6949702af57e46f4eac3355d4a4f94c5d Mon Sep 17 00:00:00 2001
From: Mark Wielaard 
Date: Tue, 21 Feb 2023 13:12:38 +0100
Subject: [PATCH] configure: Check for and -Wuse-after-free=3 when available

gcc already includes -Wuse-after-free=2 in -Wall. -Wuse-after-free=3
also warns for indeterminate pointers in equality expressions.

Signed-off-by: Mark Wielaard 
---
 ChangeLog|  4 
 config/ChangeLog |  5 +
 config/eu.am |  8 
 configure.ac | 11 ++-
 4 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index d99d837d..5da4f352 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2023-02-21  Mark Wielaard  
+
+	* configure.ac: Check for -Wuse-after-free=3
+
 2023-02-15  Mark Wielaard  
 
 	* configure.ac: Error out when demangler is enabled, but
diff --git a/config/ChangeLog b/config/ChangeLog
index c63caa0c..ce1f74f6 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,8 @@
+2023-02-21  Mark Wielaard  
+
+	* eu.am (USE_AFTER_FREE3_WARNING): Define.
+	(AM_CFLAGS): Use USE_AFTER_FREE3_WARNING.
+
 2022-10-02  Mark Wielaard  
 
 	* elfutils.spec.in: Update for 0.188.
diff --git a/config/eu.am b/config/eu.am
index c3cefe7e..e6c241f9 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -1,6 +1,7 @@
 ## Common automake fragments for elfutils subdirectory makefiles.
 ##
 ## Copyright (C) 2010, 2014, 2016 Red Hat, Inc.
+## Copyright (C) 2023, Mark J. Wielaard 
 ##
 ## This file is part of elfutils.
 ##
@@ -87,10 +88,17 @@ else
 NO_PACKED_NOT_ALIGNED_WARNING=
 endif
 
+if HAVE_USE_AFTER_FREE3_WARNING
+USE_AFTER_FREE3_WARNING=-Wuse-after-free=3
+else
+USE_AFTER_FREE3_WARNING=
+endif
+
 AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
 	-Wold-style-definition -Wstrict-prototypes $(TRAMPOLINES_WARNING) \
 	$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
 	$(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
+	$(USE_AFTER_FREE3_WARNING) \
 	$(if $($(*F)_no_Werror),,-Werror) \
 	$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
 	$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
diff --git a/configure.ac b/configure.ac
index 4c8a4c31..142a89f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
 dnl Configure input file for elfutils. -*-autoconf-*-
 dnl
 dnl Copyright (C) 1996-2019 Red Hat, Inc.
-dnl Copyright (C) 2022 Mark J. Wielaard 
+dnl Copyright (C) 2022, 2023 Mark J. Wielaard 
 dnl
 dnl This file is part of elfutils.
 dnl
@@ -618,6 +618,15 @@ CFLAGS="$old_CFLAGS"])
 AM_CONDITIONAL(HAVE_NO_PACKED_NOT_ALIGNED_WARNING,
 	   [test "x$ac_cv_no_packed_not_aligned" != "xno"])
 
+AC_CACHE_CHECK([whether the compiler accepts -Wuse-after-free=3], ac_cv_use_after_free3, [dnl
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wuse-after-free=3 -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
+		  ac_cv_use_after_free3=yes, ac_cv_use_after_free3=no)
+CFLAGS="$old_CFLAGS"])
+AM_CONDITIONAL(HAVE_USE_AFTER_FREE3_WARNING,
+	   [test "x$ac_cv_use_after_free3" != "xno"])
+
 AC_CACHE_CHECK([whether the compiler accepts -fno-addrsig], ac_cv_fno_addrsig, [dnl
 old_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -fno-addrsig -Werror"
-- 
2.39.2



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

2023-02-21 Thread builder--- via Elfutils-devel
A restored build has been detected on builder elfutils-rawhide-x86_64 while 
building elfutils.

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

Build state: build successful
Revision: eb79a7bd87adc51dae77eb8d5ec37ad58ec71feb
Worker: bb2-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/140/builds/117/steps/2/logs/stdio

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

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

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

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

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

- 8: make distcheck ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/140/builds/117/steps/8/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#builders/140/builds/117/steps/8/logs/test-suite_log
- warnings (6): 
https://builder.sourceware.org/buildbot/#builders/140/builds/117/steps/8/logs/warnings__6_

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

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

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

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

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

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

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

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

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

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

- 19: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/140/builds/117/steps/19/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/32

Build state: failed test (failure)
Revision: eb79a7bd87adc51dae77eb8d5ec37ad58ec71feb
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/32/steps/2/logs/stdio

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

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

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

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

2023-02-21 Thread builder--- via Elfutils-devel
A restored build has been detected on builder elfutils-gentoo-sparc while 
building elfutils.

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

Build state: build successful
Revision: c9c055a6949702af57e46f4eac3355d4a4f94c5d
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/33/steps/2/logs/stdio

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



elfutils 0.189 release next week

2023-02-21 Thread Mark Wielaard
Hi,

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 and will go over the following 25
pending patches to see what can be incorporated:
https://patchwork.sourceware.org/project/elfutils/list/ [*]
If your patch is not on that list please ping.

I propose to do the 0.189 release on Tuesday February 28, but it can be
earlier or later if that is more convenient.

Cheers,

Mark

[*] That is this list of patches:
git pw patch list --format simple --state New --state RFC --state
Under-Review --state Changes-Requested --column Name

[2/2] libdw: Use elf_rawdata when checking .debug section
[1/2] libelf: memmove any extra bytes left by elf_cvt_gnuhash convers...
A scenario where Perf cannot unwind the user stack by dwarf with libd...
PR28873 - Implement eu-readelf -D
[v2,16/16] lib: Use HAVE_LIBINTL_H to guard #include 
[v2,15/16] libelf: F_GETFD may not predefined with msvc/mingw, guard ...
[v2,14/16] Add function sys_get_page_size to replace platform depende...
[v2,12/16] libasm/debuginfod: fchmod doesn't present on win32
[v2,11/16] libebl/libdwelf: define ssize_t and pid_t for MSVC within ...
[v2,10/16] libasm: stdio_ext.h are not present on win32
[v2,09/16] libelf: uid_t, gid_t and mode_t are not comes with msvcrt,...
[v2,08/16] lib: Implement error properly even when not HAVE_ERR_H
[v2,07/16] libdw: Fixes compile of dwarf_whatattr.c and dwarf_whatfor...
[v2,05/16] libcpu: Remove the need of NMNES by using enum
[v2,04/16] Fixes usage of basename about prototype differences
[v2,03/16] Use configure to detect HAVE_DECL_MMAP and use it for syst...
[v2,02/16] move platform depended include into system.h of libebl
PATCH: Bug debuginfod/29472 followup
[RFC] backends: Add RISC-V object attribute printing
[Bug,libdw/29434] Memory leak in `dwarf_getscopes`
[PATCHv2] strip: keep .ctf section in stripped file
[4/4] libdwfl, eu-stack, aarch64: Add API for setting AARCH64 PAC mas...
[3/4] libdwfl, aarch64: Demangle return addresses using a PAC mask
[2/4] libdw, aarch64: Implement DW_CFA_AARCH64_negate_ra_state CFI in...
[1/4] aarch64: Create definitions for AARCH64_RA_SIGN_STATE register



Re: elfutils code names

2023-02-21 Thread Mark Wielaard
On Thu, 2023-02-16 at 13:37 +0100, Mark Wielaard wrote:
> Hi,
> 
> On irc (#elfutils on libera.chat) we had a discussion about the
> elfutils code names. For some reason those are only in the irc channel
> topic. Which seems to mean not many people know about them. I could
> recover the following:
> 
> 0.170 "DWARF4 1/2"
> 0.171 "DWARF5 split!"
> 0.172 "DWARF5 bugs split!"
> 0.173 "crash free"
> 0.174 "extended shnum"
> 0.176 "At your own RISC-V"
> 0.177 "What is your category, class and taxonomy?"
> 0.178 "All the build-id you can count!" 
> 0.179 "All your packages are belong to us!"
> 0.180 "We got an L, we got an T, can we have a O?"
> 0.181 "Show me your ARMs"
> 0.182 "October Surprise!"
> 0.183 "100+ commits"
> 0.184 "negative results"
> 0.185 "oops, I did it again"   
> 0.186 "Just In Time"
> 0.187 "no zero negatives"
> 0.188 "no section left behind"
> 
> I believe some older versions also had code names, but I could not find
> them.

Found some more:

0.162 "hard hat" 
0.163 "size matters" 
0.164 "strip, no unstrip!" 
0.165 "big DWARF & tiny ELF" 
0.166 "bugs be gone!" 
0.167 "disassemble this!" 
0.168 "kthxbye" 

So 0.169 is missing and I am not sure any version before 0.162 had a
code name. But if you remember differently please update/correct this
list.

Thanks,

Mark


Issue 56134 in oss-fuzz: elfutils:fuzz-libdwfl: Use-of-uninitialized-value in check_section

2023-02-21 Thread ClusterFuzz-External via monorail via Elfutils-devel
Updates:
Labels: -Reproducible Unreproducible

Comment #3 on issue 56134 by ClusterFuzz-External: elfutils:fuzz-libdwfl: 
Use-of-uninitialized-value in check_section
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56134#c3

ClusterFuzz testcase 6724057145147392 appears to be flaky, updating 
reproducibility label.

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.


[Bug libdw/30085] Negative strides in dwarf_aggregate_size

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

--- Comment #2 from Mark Wielaard  ---
I asked around and John DelSignore came up with the following fortran example:

= array.f95 =

program f_prog
integer*4, allocatable, target, dimension (:,:) :: big_array
integer, dimension (:,:), pointer :: neg_array
allocate (big_array(2000,1000))
neg_array => big_array(2000:1:-1,1000:1:-1)
end program f_prog

So, neg_array is a pointer to an array section where the elements of big_array
are reversed. That is, neg_array(x,y) references big_array(2000-x+1,1000-y+1).

In this example, the stride makes us go "backwards" into the array.

But note that gfortran -g array.f95 produces DW_FORM_exprlocs for the
DW_AT_byte_stride because almost all attributes of the array are dynamic at
runtime:

 [c9]array_type   abbrev: 10
 ordering (data1) col_major (1)
 data_location(exprloc) 
  [ 0] push_object_address
  [ 1] deref
 allocated(exprloc) 
  [ 0] push_object_address
  [ 1] deref
  [ 2] lit0
  [ 3] ne
 type (ref4) [72]
 sibling  (ref4) [   106]
 [db]  subrange_typeabbrev: 1
   lower_bound  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 48
[ 3] deref
   upper_bound  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 56
[ 3] deref
   byte_stride  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 40
[ 3] deref
[ 4] push_object_address
[ 5] plus_uconst 32
[ 7] deref
[ 8] mul
 [f0]  subrange_typeabbrev: 1
   lower_bound  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 72
[ 3] deref
   upper_bound  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 80
[ 3] deref
   byte_stride  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 64
[ 3] deref
[ 4] push_object_address
[ 5] plus_uconst 32
[ 7] deref
[ 8] mul
 [   106]array_type   abbrev: 11
 ordering (data1) col_major (1)
 data_location(exprloc) 
  [ 0] push_object_address
  [ 1] deref
 associated   (exprloc) 
  [ 0] push_object_address
  [ 1] deref
  [ 2] lit0
  [ 3] ne
 type (ref4) [72]
 [   114]  subrange_typeabbrev: 1
   lower_bound  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 48
[ 3] deref
   upper_bound  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 56
[ 3] deref
   byte_stride  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 40
[ 3] deref
[ 4] push_object_address
[ 5] plus_uconst 32
[ 7] deref
[ 8] mul
 [   129]  subrange_typeabbrev: 1
   lower_bound  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 72
[ 3] deref
   upper_bound  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 80
[ 3] deref
   byte_stride  (exprloc) 
[ 0] push_object_address
[ 1] plus_uconst 64
[ 3] deref
[ 4] push_object_address
[ 5] plus_uconst 32
[ 7] deref
[ 8] mul

Something dwarf_aggregate_size doesn't handle. And even if it could handle the
expression, it doesn't know the object address or how to deref memory...

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

Re: [PATCH 2/2] libdw: Use elf_rawdata when checking .debug section

2023-02-21 Thread Aleksei Vetrov via Elfutils-devel
Hi Evgeny,

On Tue, Feb 21, 2023 at 2:29 AM Evgeny Vereshchagin 
wrote:
> Aleksei I wonder if it would be possible to add those fuzz targets to
> OSS-Fuzz? There are blind spots there and I think it would be really
great to
> start covering at least some of them.

We are fuzzing a tool named STG
(https://android.googlesource.com/platform/external/stg/+/refs/heads/master
),
which is using libdw and libdwfl from elfutils. And it already has support
for
execution through libFuzzer:
https://android.googlesource.com/platform/external/stg/+/refs/heads/master/fuzz/

The problem is in building infrastructure. STG as fuzzing target is built
inside
Google using internal build and fuzzing infrastructure, but in principle it
does
the same thing as OSS-Fuzz. An AOSP version of STG is built using Android
build
system, which doesn't support the same simplicity of building with
libFuzzer and
sanitizers. So it needs some work to integrate STG into OSS-Fuzz.


[Bug libdw/30085] Negative strides in dwarf_aggregate_size

2023-02-21 Thread thaines.astro at gmail dot com via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=30085

--- Comment #3 from Tim Haines  ---
I was actually trying to make a Fortran example, but couldn't get one to work!
Glad John was able to make one.

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

[COMMITTED] Update m4 files from autoconf-archive

2023-02-21 Thread Mark Wielaard
Update m4/ax_check_compile_flag.m4 and m4/ax_cxx_compile_stdcxx.m4
to autoconf-archive-2023.02.20.

Signed-off-by: Mark Wielaard 
---
 m4/ax_check_compile_flag.m4 |  33 +--
 m4/ax_cxx_compile_stdcxx.m4 | 532 +---
 2 files changed, 503 insertions(+), 62 deletions(-)

diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
index ca363971..bd753b34 100644
--- a/m4/ax_check_compile_flag.m4
+++ b/m4/ax_check_compile_flag.m4
@@ -1,5 +1,5 @@
 # ===
-#   http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+#  https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
 # ===
 #
 # SYNOPSIS
@@ -29,33 +29,12 @@
 #   Copyright (c) 2008 Guido U. Draheim 
 #   Copyright (c) 2011 Maarten Bosmans 
 #
-#   This program is free software: you can redistribute it and/or modify it
-#   under the terms of the GNU General Public License as published by the
-#   Free Software Foundation, either version 3 of the License, or (at your
-#   option) any later version.
-#
-#   This program is distributed in the hope that it will be useful, but
-#   WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-#   Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see .
-#
-#   As a special exception, the respective Autoconf Macro's copyright owner
-#   gives unlimited permission to copy, distribute and modify the configure
-#   scripts that are the output of Autoconf when processing the Macro. You
-#   need not follow the terms of the GNU General Public License when using
-#   or distributing such scripts, even though portions of the text of the
-#   Macro appear in them. The GNU General Public License (GPL) does govern
-#   all other use of the material that constitutes the Autoconf Macro.
-#
-#   This special exception to the GPL applies to versions of the Autoconf
-#   Macro released by the Autoconf Archive. When you make and distribute a
-#   modified version of the Autoconf Macro, you may extend this special
-#   exception to the GPL to apply to your modified version as well.
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
 
-#serial 4
+#serial 6
 
 AC_DEFUN([AX_CHECK_COMPILE_FLAG],
 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4
index 8adc7656..8edf5152 100644
--- a/m4/ax_cxx_compile_stdcxx.m4
+++ b/m4/ax_cxx_compile_stdcxx.m4
@@ -1,5 +1,5 @@
 # ===
-#   http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
+#  https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
 # ===
 #
 # SYNOPSIS
@@ -9,14 +9,14 @@
 # DESCRIPTION
 #
 #   Check for baseline language coverage in the compiler for the specified
-#   version of the C++ standard.  If necessary, add switches to CXX to
-#   enable support.  VERSION may be '11' (for the C++11 standard) or '14'
-#   (for the C++14 standard).
+#   version of the C++ standard.  If necessary, add switches to CXX and
+#   CXXCPP to enable support.  VERSION may be '11', '14', '17', or '20' for
+#   the respective C++ standard version.
 #
 #   The second argument, if specified, indicates whether you insist on an
 #   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
 #   -std=c++11).  If neither is specified, you get whatever works, with
-#   preference for an extended mode.
+#   preference for no added switch, and then for an extended mode.
 #
 #   The third argument, if specified 'mandatory' or if left unspecified,
 #   indicates that baseline support for the specified C++ standard is
@@ -33,21 +33,26 @@
 #   Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov 

 #   Copyright (c) 2015 Paul Norman 
 #   Copyright (c) 2015 Moritz Klammler 
+#   Copyright (c) 2016, 2018 Krzesimir Nowak 
+#   Copyright (c) 2019 Enji Cooper 
+#   Copyright (c) 2020 Jason Merrill 
+#   Copyright (c) 2021 Jörn Heusipp 
 #
 #   Copying and distribution of this file, with or without modification, are
 #   permitted in any medium without royalty provided the copyright notice
 #   and this notice are preserved.  This file is offered as-is, without any
 #   warranty.
 
-#serial 3
+#serial 18
 
 dnl  This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
 dnl  (serial version number 13).
 
 AC_DEFUN([AX_CXX_COMPILE_STD