Bug 2005433 - Fix missing debug symbols from swtpm rebase
Summary: Fix missing debug symbols from swtpm rebase
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: swtpm
Version: 8.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.5
Assignee: Marc-Andre Lureau
QA Contact: Yanqiu Zhang
URL:
Whiteboard:
Depends On: 1972783
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-17 15:49 UTC by Marc-Andre Lureau
Modified: 2021-11-16 09:03 UTC (History)
14 users (show)

Fixed In Version: 0.6.0-2.20210607gitea627b3
Doc Type: Enhancement
Doc Text:
Clone Of: 1972783
Environment:
Last Closed: 2021-11-16 07:55:27 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-97480 0 None None None 2021-09-17 15:51:38 UTC
Red Hat Product Errata RHBA-2021:4684 0 None None None 2021-11-16 07:57:17 UTC

Description Marc-Andre Lureau 2021-09-17 15:49:34 UTC
+++ This bug was initially created as a clone of Bug #1972783 +++

The rebase introduced a regression in debug packages, caught by RPMDiff. The reason is that CFLAGS are not correctly handled for some binaries. The fix is quite trivial, correctly passing down the configure-time CFLAGS to all binaries.

https://rpmdiff.engineering.redhat.com/run/498040/

Comment 13 Yanqiu Zhang 2021-10-08 14:11:28 UTC
Thank you Marc-Andre! Following are my test results. Any mistakes please correct me. Thanks!
Envs:
hostA:swtpm-0.6.0-1.20210607gitea627b3.module+el8.5.0+11638+3d8f9850.x86_64
hostB:swtpm-0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc.x86_64

1. .debug filess size have no obvious difference:
# rpmdiff swtpm-debuginfo-0.6.0-1.20210607gitea627b3.module+el8.5.0+11638+3d8f9850.x86_64.rpm  swtpm-debuginfo-0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc.x86_64.rpm
removed     PROVIDES debuginfo(build-id) = d16c08c800a0abdfce12fc857723962329784866
removed     PROVIDES swtpm-debuginfo = 0.6.0-1.20210607gitea627b3.module+el8.5.0+11638+3d8f9850
removed     PROVIDES swtpm-debuginfo(x86-64) = 0.6.0-1.20210607gitea627b3.module+el8.5.0+11638+3d8f9850
added       PROVIDES debuginfo(build-id) = fe507698857bb3d7bdc053093faa9a1d194539e8
added       PROVIDES swtpm-debuginfo = 0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc
added       PROVIDES swtpm-debuginfo(x86-64) = 0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc
removed     RECOMMENDS swtpm-debugsource(x86-64) = 0.6.0-1.20210607gitea627b3.module+el8.5.0+11638+3d8f9850
added       RECOMMENDS swtpm-debugsource(x86-64) = 0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc
..........T /usr/lib/debug
..........T /usr/lib/debug/.build-id
removed     /usr/lib/debug/.build-id/d1
removed     /usr/lib/debug/.build-id/d1/6c08c800a0abdfce12fc857723962329784866
removed     /usr/lib/debug/.build-id/d1/6c08c800a0abdfce12fc857723962329784866.debug
added       /usr/lib/debug/.build-id/fe
added       /usr/lib/debug/.build-id/fe/507698857bb3d7bdc053093faa9a1d194539e8
added       /usr/lib/debug/.build-id/fe/507698857bb3d7bdc053093faa9a1d194539e8.debug
..........T /usr/lib/debug/.dwz
removed     /usr/lib/debug/.dwz/swtpm-0.6.0-1.20210607gitea627b3.module+el8.5.0+11638+3d8f9850.x86_64
added       /usr/lib/debug/.dwz/swtpm-0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc.x86_64
..........T /usr/lib/debug/usr
..........T /usr/lib/debug/usr/bin
removed     /usr/lib/debug/usr/bin/swtpm-0.6.0-1.20210607gitea627b3.module+el8.5.0+11638+3d8f9850.x86_64.debug
added       /usr/lib/debug/usr/bin/swtpm-0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc.x86_64.debug

hostA:# ll -h /usr/lib/debug/usr/bin/swtpm-0.6.0-1.20210607gitea627b3.module+el8.5.0+11638+3d8f9850.x86_64.debug
-rw-r--r--. 1 root root 48K Jun 30 12:07 /usr/lib/debug/usr/bin/swtpm-0.6.0-1.20210607gitea627b3.module+el8.5.0+11638+3d8f9850.x86_64.debug

hostB: #  ll -h /usr/lib/debug/usr/bin/swtpm-0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc.x86_64.debug 
-rw-r--r--. 1 root root 48K Sep 21 04:01 /usr/lib/debug/usr/bin/swtpm-0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc.x86_64.debug


2.Some differences when gdb:
(1)hostA  # gdb swtpm_bios
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-16.el8
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from swtpm_bios...Reading symbols from /usr/lib/debug/usr/bin/swtpm_bios-0.6.0-1.20210607gitea627b3.module+el8.5.0+11638+3d8f9850.x86_64.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
(gdb) info functions
All defined functions:

Non-debugging symbols:
0x0000000000000df8  _init
0x0000000000001030  .annobin_elf_init.c.exit
0x0000000000001030  .annobin_elf_init.c.hot
0x0000000000001030  .annobin_elf_init.c.startup
0x0000000000001030  .annobin_elf_init.c.unlikely
0x0000000000001030  .annobin_elf_init.c_end.exit
0x0000000000001030  .annobin_elf_init.c_end.hot
0x0000000000001030  .annobin_elf_init.c_end.startup
0x0000000000001030  .annobin_elf_init.c_end.unlikely
0x0000000000001030  .annobin_init.c.exit
0x0000000000001030  .annobin_init.c.hot
0x0000000000001030  .annobin_init.c.startup
0x0000000000001030  .annobin_init.c.unlikely
0x0000000000001030  .annobin_init.c_end.exit
0x0000000000001030  .annobin_init.c_end.hot
0x0000000000001030  .annobin_init.c_end.startup
0x0000000000001030  .annobin_init.c_end.unlikely
0x0000000000001030  _start
0x000000000000105f  .annobin_init.c
0x000000000000105f  .annobin_init.c_end
0x0000000000001060  deregister_tm_clones
0x0000000000001090  register_tm_clones
0x00000000000010d0  __do_global_dtors_aux
0x0000000000001110  frame_dummy
0x0000000000001119  __bswap_16
0x000000000000112d  __bswap_32
0x000000000000113b  parse_tcp_optarg
0x00000000000013bd  open_connection
0x0000000000001805  talk
--Type <RET> for more, q to quit, c to continue without paging--
0x0000000000001b89  TPM_Startup
0x0000000000001c1c  TSC_PhysicalPresence
0x0000000000001cb0  TPM_GetCapability_Subcap
0x0000000000001d66  TPM_PhysicalEnable
0x0000000000001de5  TPM_PhysicalSetDeactivated
0x0000000000001e70  TPM_ContinueSelfTest
0x0000000000001eef  TPM2_Startup
0x0000000000001f83  TPM2_IncrementalSelfTest
0x000000000000201d  TPM2_HierarchyChangeAuth
0x00000000000021e7  tpm12_bios
0x0000000000002545  tpm2_bios
0x0000000000002667  versioninfo
0x000000000000268e  print_usage
0x00000000000026bf  main
0x0000000000002990  .annobin___libc_csu_init.start
0x0000000000002990  .annobin_elf_init.c
0x0000000000002990  __libc_csu_init
0x00000000000029f5  .annobin___libc_csu_fini.start
0x00000000000029f5  .annobin___libc_csu_init.end
0x0000000000002a00  __libc_csu_fini
0x0000000000002a05  .annobin___libc_csu_fini.end
0x0000000000002a05  .annobin_elf_init.c_end
0x0000000000002a08  _fini
0x0000000000000e30  printf@plt
0x0000000000000e40  memset@plt
0x0000000000000e50  snprintf@plt
0x0000000000000e60  close@plt
0x0000000000000e70  puts@plt
0x0000000000000e80  getopt_long_only@plt
0x0000000000000e90  __isoc99_sscanf@plt
0x0000000000000ea0  select@plt
0x0000000000000eb0  getaddrinfo@plt
--Type <RET> for more, q to quit, c to continue without paging--
0x0000000000000ec0  putchar@plt
0x0000000000000ed0  read@plt
0x0000000000000ee0  freeaddrinfo@plt
0x0000000000000ef0  strlen@plt
0x0000000000000f00  __cxa_finalize@plt
0x0000000000000f10  strrchr@plt
0x0000000000000f20  strerror@plt
0x0000000000000f30  atoi@plt
0x0000000000000f40  connect@plt
0x0000000000000f50  signal@plt
0x0000000000000f60  socket@plt
0x0000000000000f70  getenv@plt
0x0000000000000f80  __errno_location@plt
0x0000000000000f90  strdup@plt
0x0000000000000fa0  __stack_chk_fail@plt
0x0000000000000fb0  strncpy@plt
0x0000000000000fc0  fwrite@plt
0x0000000000000fd0  gai_strerror@plt
0x0000000000000fe0  fprintf@plt
0x0000000000000ff0  write@plt
0x0000000000001000  memcpy@plt
0x0000000000001010  open@plt
0x0000000000001020  strndup@plt
(gdb) 



(2)hostB:# gdb swtpm_bios
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-16.el8
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from swtpm_bios...Reading symbols from /usr/lib/debug/usr/bin/swtpm_bios-0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc.x86_64.debug...done.
done.
(gdb) info functions
All defined functions:

File tpm_bios.c:
677:	int main(int, char **);
321:	static int TSC_PhysicalPresence(unsigned short, int *);
643:	static void print_usage(const char *);
233:	static int talk(const void *, size_t, int *, unsigned int, struct tpm_resp_header *, size_t);

Non-debugging symbols:
0x0000000000000e60  _init
0x00000000000024cd  .annobin_TSC_PhysicalPresence.end
0x00000000000024cd  .annobin_tpm_bios.c_end
0x00000000000024d0  .annobin___libc_csu_init.start
0x00000000000024d0  .annobin_elf_init.c
0x00000000000024d0  __libc_csu_init
0x0000000000002535  .annobin___libc_csu_fini.start
0x0000000000002535  .annobin___libc_csu_init.end
0x0000000000002540  __libc_csu_fini
0x0000000000002545  .annobin___libc_csu_fini.end
0x0000000000002545  .annobin_elf_init.c_end
0x0000000000002548  _fini
0x0000000000001070  __strncpy_chk@plt
0x0000000000001080  close@plt
0x0000000000001090  __fprintf_chk@plt
0x00000000000010a0  puts@plt
0x00000000000010b0  getopt_long_only@plt
0x00000000000010c0  __isoc99_sscanf@plt
0x00000000000010d0  select@plt
0x00000000000010e0  __printf_chk@plt
0x00000000000010f0  getaddrinfo@plt
0x0000000000001100  putchar@plt
0x0000000000001110  read@plt
--Type <RET> for more, q to quit, c to continue without paging--
0x0000000000001120  freeaddrinfo@plt
0x0000000000001130  __cxa_finalize@plt
0x0000000000001140  strrchr@plt
0x0000000000001150  strerror@plt
0x0000000000001160  strtol@plt
0x0000000000001170  connect@plt
0x0000000000001180  signal@plt
0x0000000000001190  socket@plt
0x00000000000011a0  getenv@plt
0x00000000000011b0  __errno_location@plt
0x00000000000011c0  strdup@plt
0x00000000000011d0  __stack_chk_fail@plt
0x00000000000011e0  __snprintf_chk@plt
0x00000000000011f0  fwrite@plt
0x0000000000001200  gai_strerror@plt
0x0000000000001210  write@plt
0x0000000000001220  open@plt
0x0000000000001230  strndup@plt
0x0000000000001240  __fdelt_chk@plt
(gdb) 

3. vtpm regression test passed:
https://libvirt-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/libvirt-RHEL-8.5-runtest-x86_64-function-tpm_emulator/40/testReport/
swtpm-0.6.0-2.20210607gitea627b3.module+el8.5.0+12696+4ce1c6bc

Comment 15 errata-xmlrpc 2021-11-16 07:55:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4684


Note You need to log in before you can comment on or make changes to this bug.