[Bug debuginfod/32314] New: Profile script in elfutils-debuginfod-client throws error on login

2024-10-27 Thread ngren...@cygnusx-1.org
https://sourceware.org/bugzilla/show_bug.cgi?id=32314

Bug ID: 32314
   Summary: Profile script in elfutils-debuginfod-client throws
error on login
   Product: elfutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: debuginfod
  Assignee: unassigned at sourceware dot org
  Reporter: ngren...@cygnusx-1.org
CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

With elfutils 0.192 on Fedora 41 with a shell set to zsh I get the error below.
This can be argued to be a packaging bug of Fedora's, and I did file a bug
report with them, linked below. Yet I see multiple things that could be better
at this upstream level.

1. Both of these configure options are required to make
/etc/profile.d/debuginfod.sh behave with zsh. This could be simplified into one
configuration option, or something like it.

--enable-debuginfod-urls=%{dist_debuginfod_url} \
--enable-debuginfod-ima-cert-path=%{_sysconfdir}/debuginfod \

2. The /etc/profile.d/debuginfod.sh script could either be made to work with no
certpath file when the shell is zsh, the template could be modified such that
if the second configure option is not specified it the if statement for
*.certpath is not included, or both.

3. Is --enable-debuginfod-ima-cert-path meant to be something like
/etc/ssl/certs?

Error message:
/etc/profile.d/debuginfod.sh:14: no matches found: /etc/debuginfod/*.certpath

Fedora bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=2321818

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

[Bug libelf/32311] New: elf_compress_gnu.c: gcc warns null-dereference with lto

2024-10-27 Thread the.ra2.ifv at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32311

Bug ID: 32311
   Summary: elf_compress_gnu.c: gcc warns null-dereference with
lto
   Product: elfutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: minor
  Priority: P2
 Component: libelf
  Assignee: unassigned at sourceware dot org
  Reporter: the.ra2.ifv at gmail dot com
CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

Created attachment 15764
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15764&action=edit
full log when building elfutils in openwrt

elfutils: 0.191
When compiling elfutils in OpenWRT, gcc warn potential null pointer dereference
with lto enabled. If I disable it or use `-Wno-null-dereference` then the build
would pass with no problems.

```
ccache aarch64-openwrt-linux-musl-gcc -std=gnu99 -Wall -Wshadow -Wformat=2
-Wold-style-definition -Wstrict-prototypes -Wtrampolines -Wlogical-op
-Wduplicated-co
nd -Wnull-dereference -Wimplicit-fallthrough=5 -Wuse-after-free=3 -Werror
-Wunused -Wextra -Wstack-usage=262144-fno-caller-saves -fno-plt -pipe
-Ofast -fhon
our-copts
-fmacro-prefix-map=/openwrt/build_dir/target-aarch64_generic_musl/elfutils-0.191=elfutils-0.191
-ffunction-sections -fdata-sections -flto=auto -fno-fa
t-lto-objects -Wformat -Werror=format-security -fstack-protector
-D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro   -D_GNU_SOURCE -Wno-unused-result
-Wno-format-nonl
iteral -Wno-error=use-after-free  
-L/openwrt/staging_dir/toolchain-aarch64_generic_gcc-14.2.0_musl/usr/lib
-L/openwrt/staging_dir/toolchain-aarch64_generic_gcc
-14.2.0_musl/lib -fuse-ld=mold -Wl,--gc-sections -flto=auto -fuse-linker-plugin
-znow -zrelro-Wl,--build-id -o libelf.so -shared -Wl,-z,defs -Wl,-z,relro
-o
 libelf.so \
-Wl,--soname,libelf.so.1 \
-Wl,--version-script,libelf.map \
-Wl,--no-undefined \
-Wl,--whole-archive libelf_pic.a -Wl,--no-whole-archive \
../lib/libeu.a -lz
elf_compress.c: In function 'elf_compress':
elf_compress.c:675:26: error: potential null pointer dereference
[-Werror=null-dereference]
  675 |   shdr->sh_flags |= SHF_COMPRESSED;
  |  ^
elf_compress.c:675:15: error: potential null pointer dereference
[-Werror=null-dereference]
  675 |   shdr->sh_flags |= SHF_COMPRESSED;
  |   ^
elf_compress.c:674:30: error: potential null pointer dereference
[-Werror=null-dereference]
  674 |   shdr->sh_addralign = __libelf_type_align (ELFCLASS32,
ELF_T_CHDR);
  |  ^
elf_compress.c:673:25: error: potential null pointer dereference
[-Werror=null-dereference]
  673 |   shdr->sh_size = new_size;
  | ^
elf_compress.c:675:26: error: potential null pointer dereference
[-Werror=null-dereference]
  675 |   shdr->sh_flags |= SHF_COMPRESSED;
  |  ^
elf_compress.c:675:15: error: potential null pointer dereference
[-Werror=null-dereference]
  675 |   shdr->sh_flags |= SHF_COMPRESSED;
  |   ^
elf_compress.c:674:30: error: potential null pointer dereference
[-Werror=null-dereference]
  674 |   shdr->sh_addralign = __libelf_type_align (ELFCLASS32,
ELF_T_CHDR);
  |  ^
elf_compress.c:673:25: error: potential null pointer dereference
[-Werror=null-dereference]
  673 |   shdr->sh_size = new_size;
  | ^
elf_compress.c:682:26: error: potential null pointer dereference
[-Werror=null-dereference]
  682 |   shdr->sh_flags |= SHF_COMPRESSED;
  |  ^
elf_compress.c:682:15: error: potential null pointer dereference
[-Werror=null-dereference]
  682 |   shdr->sh_flags |= SHF_COMPRESSED;
  |   ^
elf_compress.c:681:30: error: potential null pointer dereference
[-Werror=null-dereference]
  681 |   shdr->sh_addralign = __libelf_type_align (ELFCLASS64,
ELF_T_CHDR);
  |  ^
elf_compress.c:680:25: error: potential null pointer dereference
[-Werror=null-dereference]
  680 |   shdr->sh_size = new_size;
  | ^
elf_compress.c:682:26: error: potential null pointer dereference
[-Werror=null-dereference]
  682 |   shdr->sh_flags |= SHF_COMPRESSED;
  |  ^
elf_compress.c:682:15: error: potential null pointer dereference
[-Werror=null-dereference]
  682 |   shdr->sh_flags |= SHF_COMPRESSED;
  |   ^
elf_compress.c:681:30: error: potential null pointer dereference
[-Werror=null-dereference]
  681 |   shdr->sh_addralign = __libelf_type_align (ELFCLASS64,
ELF_T_CHDR);
  |  ^
elf_compress.c:680:25: error: potential null pointer dereference
[-Werror=null-dereference]
  680 |   shdr->sh_size = new_si