Re: [PATCH 1/2] libdwfl: specify optional sysroot to search for shared libraries and binaries

2024-07-02 Thread Michal Sekletar
On Tue, Jul 2, 2024 at 1:04 PM Dmitry V. Levin wrote: > On Mon, Jul 01, 2024 at 06:56:21PM +0200, Michal Sekletar wrote: > [...] > > --- a/libdwfl/link_map.c > > +++ b/libdwfl/link_map.c > > @@ -416,8 +416,22 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t > elfdata, > >if (name !=

[PATCH v2 2/3] eu-stack: add support for sysroot option

2024-07-02 Thread Michal Sekletar
From: Luke Diamand Use the dwfl_set_sysroot() function to set the sysroot to be used when analysing a core: e.g. $ eu-stack --core core --sysroot /path/to/sysroot -e crashing_prog Signed-off-by: Luke Diamand Signed-off-by: Michal Sekletar --- src/stack.c | 9 + 1 file changed, 9 i

[PATCH v2 1/3] libdwfl: specify optional sysroot to search for shared libraries and binaries

2024-07-02 Thread Michal Sekletar
From: Luke Diamand When searching the list of modules in a core file, if the core was generated on a different system to the current one, we need to look in a sysroot for the various shared objects. For example, we might be looking at a core file from an ARM system using elfutils running on an x

Re: [PATCH 1/2] libdwfl: specify optional sysroot to search for shared libraries and binaries

2024-07-02 Thread Michal Sekletar
On Tue, Jul 2, 2024 at 1:04 PM Dmitry V. Levin wrote: > > On Mon, Jul 01, 2024 at 06:56:21PM +0200, Michal Sekletar wrote: > [...] > > --- a/libdwfl/link_map.c > > +++ b/libdwfl/link_map.c > > @@ -416,8 +416,22 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata, > >if (name !=

[Bug libdw/31944] New: RFE: dwfl_linux_proc_self_attach

2024-07-02 Thread fche at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31944 Bug ID: 31944 Summary: RFE: dwfl_linux_proc_self_attach Product: elfutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: libdw

Re: [PATCH 1/2] libdwfl: specify optional sysroot to search for shared libraries and binaries

2024-07-02 Thread Frank Ch. Eigler
Hi - > > > [...] For example, we might be looking at a core file from an ARM > > > system using elfutils running on an x86 host. [...] > > > > Makes sense. By the way, to what extent would debuginfod (serving > > files from that sysroot) work for this same use case? > [...] > Frankly I don't kno

Re: [PATCH] sparc_attrs: Fix string overflow

2024-07-02 Thread Mark Wielaard
Hi Maks, On Tue, Jul 02, 2024 at 12:33:06AM +0300, Maks Mishin wrote: > A string is copied into the buffer 's' of size 577 without checking its > length first at sparc_attrs.c:95. I don't really like having runtime asserts in the library code. The buffer really should be big enough as the commen

Re: [PATCH] readelf: Fix memory leak in print_hash_info()

2024-07-02 Thread Mark Wielaard
Hi Maks, On Tue, Jul 02, 2024 at 12:05:34AM +0300, Maks Mishin wrote: > Signed-off-by: Maks Mishin > --- > src/readelf.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/readelf.c b/src/readelf.c > index c945b371..48035264 100644 > --- a/src/readelf.c > +++ b/src/readelf.c > @@ -359

Re: [PATCH] unstrip: Fix deref-of-null in copy_elided_sections()

2024-07-02 Thread Mark Wielaard
On Mon, Jul 01, 2024 at 11:53:13PM +0300, Maks Mishin wrote: > Pointer `symstrdata` is dereferenced at unstrip.c:1977 without checking for > NULL. If there has to be a NULL check then it needs to be when symstrdata is assigned a value from elf_getdata. Cheers, Mark

Re: [PATCH] size: Fix deref-of-null in handle_ar() function

2024-07-02 Thread Mark Wielaard
Hi, On Mon, Jul 01, 2024 at 09:54:46PM +0100, Sam James wrote: > Maks Mishin writes: > > > Pointer, returned from function 'elf_getarhdr' at size.c:362, > > may be NULL and is dereferenced at size.c:367. > > > > Your other patch has "Found by RASU JSC." but the rest don't. Are they > all found

Re: [PATCH] Fix deref-of-null in handle_file_note()

2024-07-02 Thread Mark Wielaard
Hi Maks, On Mon, Jul 01, 2024 at 10:47:05PM +0300, Maks Mishin wrote: > After having been assigned to a NULL value at > dwfl_segment_report_module.c:200, > pointer 'retval' is dereferenced at dwfl_segment_report_module.c:208 by > calling function 'strcmp'. > > Found by RASU JSC. > [...] >

Re: [PATCH 1/2] libdwfl: specify optional sysroot to search for shared libraries and binaries

2024-07-02 Thread Dmitry V. Levin
On Mon, Jul 01, 2024 at 06:56:21PM +0200, Michal Sekletar wrote: [...] > --- a/libdwfl/link_map.c > +++ b/libdwfl/link_map.c > @@ -416,8 +416,22 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t > elfdata, >if (name != NULL) > { > /* This code is mostly inlined dwfl_repo

Re: [PATCH 1/2] libdwfl: specify optional sysroot to search for shared libraries and binaries

2024-07-02 Thread Michal Sekletar
On Mon, Jul 1, 2024 at 7:06 PM Frank Ch. Eigler wrote: > > Hi - > > > [...] For example, we might be looking at a core file from an ARM > > system using elfutils running on an x86 host. [...] > > Makes sense. By the way, to what extent would debuginfod (serving > files from that sysroot) work fo