Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1769713

Summary: RHEL8.1 RC1: lvdisplay giving segfault
Product: Red Hat Enterprise Linux 8 Reporter: Akanksha.Pandey1
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Command-line tools QA Contact: cluster-qe <cluster-qe>
Status: CLOSED DUPLICATE Docs Contact:
Severity: high    
Priority: unspecified CC: agk, Akanksha.Pandey1, ashankar, codonell, dj, fweimer, heinzm, jbrassow, marappan_gopinath, mcsontos, mnewsome, msnitzer, pfrankli, prajnoha, thornber, zkabelac
Version: 8.1   
Target Milestone: rc   
Target Release: 8.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-08 09:06:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Core dump for the lvdisplay process
none
lvdisplay -vvv trace none

Description Akanksha.Pandey1 2019-11-07 09:45:05 UTC
Description of problem:
lvdisplay is giving segfault in RHEL8.1 RC1(4.18.0-147.el8.x86_64). Similar issue is appearing with one of our product's daemon process.

Version-Release number of selected component (if applicable):
RHEL8.1 RC1(4.18.0-147.el8.x86_64)

Additional info:

# lvdisplay =
  /dev/sdb: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  Volume group name "=" has invalid characters.
Segmentation fault (core dumped)


# tail -n 10 /var/log/messages
Nov  7 04:35:31 ncpp243050 kernel: Info:emcp:Top child bio ffff8e4a78e3ac00 __bi_remaining 1, ppbio ffff8e55f7c08480 flags 346 req ffff8e559b436900, private ffff8e55f7c08480
Nov  7 04:35:31 ncpp243050 kernel: Info:emcp:Top child bio ffff8e55e70e4f00 __bi_remaining 1, ppbio ffff8e55d505d500 flags 346 req ffff8e5599e40700, private ffff8e55d505d500
Nov  7 04:35:31 ncpp243050 kernel: Info:emcp:Top child bio ffff8e55e70e4d00 __bi_remaining 1, ppbio ffff8e55d505d500 flags 346 req ffff8e5594792680, private ffff8e55d505d500
Nov  7 04:35:31 ncpp243050 kernel: Info:emcp:Top child bio ffff8e45c5450a00 __bi_remaining 1, ppbio ffff8e55d505c900 flags 346 req ffff8e558b998c00, private ffff8e55d505c900
Nov  7 04:35:31 ncpp243050 kernel: Info:emcp:Top child bio ffff8e56395af400 __bi_remaining 1, ppbio ffff8e5578617180 flags 346 req ffff8e5588ade700, private ffff8e5578617180
Nov  7 04:35:31 ncpp243050 kernel: Info:emcp:Top child bio ffff8e56395aee00 __bi_remaining 1, ppbio ffff8e5578614c00 flags 346 req ffff8e5587b8e380, private ffff8e5578614c00
Nov  7 04:35:31 ncpp243050 kernel: lvdisplay[3884]: segfault at 62 ip 00007fca49355b73 sp 00007ffe23bb6658 error 4 in libc-2.28.so[7fca492b2000+1b9000]
Nov  7 04:35:31 ncpp243050 kernel: Code: a4 c3 80 fa 08 73 12 80 fa 04 73 1e 80 fa 01 77 26 72 05 0f b6 0e 88 0f c3 48 8b 4c 16 f8 48 8b 36 48 89 4c 17 f8 48 89 37 c3 <8b> 4c 16 fc 8b 36 89 4c 17 fc 89 37 c3 0f b7 4c 16 fe 0f b7 36 66
Nov  7 04:35:31 ncpp243050 systemd[1]: Started Process Core Dump (PID 4066/UID 0).
Nov  7 04:35:32 ncpp243050 systemd-coredump[4067]: Process 3884 (lvdisplay) of user 0 dumped core.#012#012Stack trace of thread 3884:#012#0  0x00007fca49355b73 __memcpy_sse2_unaligned_erms (libc.so.6)#012#1  0x000056492fe9c847 id_write_format (lvm)#012#2  0x000056492fdf7610 process_each_lv_in_vg (lvm)#012#3  0x000056492fdf97b3 process_each_lv (lvm)#012#4  0x000056492fdd7be6 lvdisplay (lvm)#012#5  0x000056492fdde435 lvm_run_command (lvm)#012#6  0x000056492fddf763 lvm2_main (lvm)#012#7  0x00007fca492d5873 __libc_start_main (libc.so.6)#012#8  0x000056492fdbbc9e _start (lvm)

Comment 1 Florian Weimer 2019-11-07 11:09:42 UTC
Would you please attach the coredump to this bug?  You should be able to write to a file using “coredumpctl dump 4067 | gzip -9 > core.4067.gz”. Thanks.

Comment 2 Akanksha.Pandey1 2019-11-08 05:48:28 UTC
Created attachment 1633864 [details]
Core dump for the lvdisplay process

Comment 3 Florian Weimer 2019-11-08 08:38:21 UTC
Thanks. It looks like that lvdisplay calls memcpy with a null pointer with a small offset:

(gdb) bt
#0  __memmove_sse2_unaligned_erms ()
    at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:311
#1  0x000055752e001847 in memcpy (__len=6, __src=<optimized out>, 
    __dest=<optimized out>) at /usr/include/bits/string_fortified.h:34
#2  id_write_format (id=id@entry=0x60, buffer=<optimized out>, 
    buffer@entry=0x7ffc53bd4e60 "", size=size@entry=64) at uuid/uuid.c:180
#3  0x000055752df5c610 in process_each_lv_in_vg (cmd=cmd@entry=0x55752f563600, 
    vg=vg@entry=0x0, arg_lvnames=arg_lvnames@entry=0x7ffc53bd5030, 
    tags_in=tags_in@entry=0x0, stop_on_error=stop_on_error@entry=0, 
    handle=handle@entry=0x55752f658fc0, check_single_lv=0x0, 
    process_single_lv=0x55752df3ca10 <_lvdisplay_single>) at toollib.c:3040
#4  0x000055752df5e7b3 in _process_lv_vgnameid_list (
    process_single_lv=0x55752df3ca10 <_lvdisplay_single>, check_single_lv=0x0, 
    handle=0x55752f658fc0, arg_tags=0x7ffc53bd4fe0, 
    arg_lvnames=0x7ffc53bd5000, arg_vgnames=0x7ffc53bd4ff0, 
    vgnameids_to_process=0x7ffc53bd5020, read_flags=0, cmd=0x55752f563600)
    at toollib.c:3697
#5  process_each_lv (cmd=cmd@entry=0x55752f563600, argc=argc@entry=1, 
    argv=argv@entry=0x7ffc53bd5470, one_vgname=one_vgname@entry=0x0, 
    one_lvname=one_lvname@entry=0x0, read_flags=read_flags@entry=0, 
    handle=0x55752f658fc0, check_single_lv=<optimized out>, 
    process_single_lv=<optimized out>) at toollib.c:3854
#6  0x000055752df3cbe6 in lvdisplay (cmd=0x55752f563600, argc=1, 
    argv=0x7ffc53bd5470) at lvdisplay.c:61
#7  0x000055752df43435 in lvm_run_command (cmd=cmd@entry=0x55752f563600, 
    argc=<optimized out>, argc@entry=2, argv=<optimized out>, 
    argv@entry=0x7ffc53bd5468) at lvmcmdline.c:3036
#8  0x000055752df44763 in lvm2_main (argc=2, argv=0x7ffc53bd5468)
    at lvmcmdline.c:3566
#9  0x00007f07ee2f1873 in __libc_start_main (main=0x55752df20bd0 <main>, 
    argc=2, argv=0x7ffc53bd5468, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7ffc53bd5458)
    at ../csu/libc-start.c:308

And:

(gdb) up
#1  0x000055752e001847 in memcpy (__len=6, __src=<optimized out>, 
    __dest=<optimized out>) at /usr/include/bits/string_fortified.h:34
34	  return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
(gdb) 
#2  id_write_format (id=id@entry=0x60, buffer=<optimized out>, 
    buffer@entry=0x7ffc53bd4e60 "", size=size@entry=64) at uuid/uuid.c:180
180			memcpy(buffer, id->uuid + tot, group_size[i]);
(gdb) print id
$4 = (const struct id *) 0x60

This is probably a bug in lvm2. It's very unlikely that this is a glibc issue.

Comment 4 Zdenek Kabelac 2019-11-08 08:46:42 UTC
Please add version of 'lvm2' package in use and 'lvdisplay = -vvvv' trace.

Also please attach lvm2 metadata backup  (vgcfgbackup)
actual state of DM table  (dmsetup table   & dmsetup status & dmsetup info -c)
in case lvm2 tried to access something unexpected...

(I also believe the upstream version has this issue fixed as I cannot reproduce it)

Comment 5 Akanksha.Pandey1 2019-11-08 08:57:27 UTC
Please find below:

[root@ncpp243050 ~]# lvm version
  LVM version:     2.03.05(2)-RHEL8 (2019-06-15)
  Library version: 1.02.163-RHEL8 (2019-06-15)
  Driver version:  4.39.0
  Configuration:   ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-default-dm-run-dir=/run --with-default-run-dir=/run/lvm --with-default-pid-dir=/run --with-default-locking-dir=/run/lock/lvm --with-usrlibdir=/usr/lib64 --enable-fsadm --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-cmdlib --enable-dmeventd --enable-blkid_wiping --with-cluster=internal --enable-cmirrord --with-udevdir=/usr/lib/udev/rules.d --enable-udev_sync --with-thin=internal --with-cache=internal --enable-lvmpolld --enable-lvmlockd-dlm --enable-lvmlockd-dlmcontrol --enable-lvmlockd-sanlock --enable-dbus-service --enable-notify-dbus --enable-dmfilemapd --with-vdo=internal --with-vdo-format=/usr/bin/vdoformat --disable-silent-rules

[root@ncpp243050 ~]# lvdisplay = -vvvv &> lvdisplay_trace.txt
Segmentation fault (core dumped)

[Output File is attached]

[root@ncpp243050 ~]# vgcfgbackup
  /dev/sdb: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found

[root@ncpp243050 ~]# dmsetup table
No devices found
[root@ncpp243050 ~]# dmsetup status
No devices found
[root@ncpp243050 ~]# dmsetup info -c
No devices found

Comment 6 Akanksha.Pandey1 2019-11-08 08:58:46 UTC
Created attachment 1633929 [details]
lvdisplay -vvv trace

Comment 7 Zdenek Kabelac 2019-11-08 09:01:48 UTC
Yep assuming this commit:

commit 7cfbf3a394c2663fbeed17705320b83e69781720
Author: David Teigland <teigland>
Date:   Thu Aug 29 11:35:46 2019 -0500

https://www.redhat.com/archives/lvm-devel/2019-August/msg00094.html

is fixing this issue.

Comment 8 Marian Csontos 2019-11-08 09:06:08 UTC

*** This bug has been marked as a duplicate of bug 1746593 ***

Comment 9 Akanksha.Pandey1 2019-11-08 09:25:37 UTC
I see the commit but I am still getting the issue:

[root@ncpp243050 ~]# cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.1 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.1"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.1 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.1:GA"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.1
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.1"

[root@ncpp243050 ~]# uname -r
4.18.0-147.el8.x86_64

[root@ncpp243050 ~]# lvdisplay = foo
  /dev/sdb: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  Volume group name "=" has invalid characters.
Segmentation fault (core dumped)

[root@ncpp243050 ~]# date
Fri Nov  8 04:32:24 EST 2019

Comment 10 Zdenek Kabelac 2019-11-08 09:28:13 UTC
You lvm2 package is built: 2019-06-15
Commit is dated:           2019-08-29

Next released version of lvm2 package will have this fix included.

Meanwhile as workaround please avoid using invalid characters in  vgname.

Comment 11 Akanksha.Pandey1 2019-11-08 09:30:51 UTC
Got it!

Do you have a tentative for the next release of the lvm2 package?