Bug 1329449 - Core dump when use wrong iscsi target name
Summary: Core dump when use wrong iscsi target name
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.3
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Fam Zheng
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-22 01:51 UTC by yduan
Modified: 2016-06-30 08:09 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-30 08:09:22 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description yduan 2016-04-22 01:51:19 UTC
Description of problem:
Core dump when use wrong iscsi target name

Version-Release number of selected component (if applicable):
Host:
  kernel: 3.10.0-382.el7.x86_64
  qemu-kvm-rhev: qemu-kvm-rhev-2.5.0-4.el7.x86_64
Guest:
  kernel: 3.10.0-382.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.#ls /dev/disk/by-path/ip-10.73.72.55\:3260-iscsi-iqn.2001-04.com.example\:storage.disk1.amiens.sys1.xyz-lun-1

/dev/disk/by-path/ip-10.73.72.55:3260-iscsi-iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz-lun-1

2.Start a VM by using following command:
 ...
 -drive file=iscsi://10.73.72.55:3260/iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz-lun-1,format=qcow2,id=drive_sysdisk,if=none,cache=none,aio=native,werror=stop,rerror=stop \
 -device scsi-block,drive=drive_sysdisk,bus=scsi_pci_bus0.0,id=device_sysdisk,bootindex=0
 ...

Actual results:
qemu-kvm: -drive file=iscsi://10.73.72.55:3260/iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz-lun-1,format=qcow2,id=drive_sysdisk,if=none,cache=none,aio=native,werror=stop,rerror=stop: Failed to parse URL : iscsi://10.73.72.55:3260/iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz-lun-1
qemu-kvm:1boot.sh: line 36:   392 Segmentation fault      (core dumped)...

Expected results:
Just show the prompt with no core dump.


Steps to Reproduce:
1.#ls /dev/disk/by-path/ip-10.73.72.55\:3260-iscsi-iqn.2001-04.com.example\:storage.disk1.amiens.sys1.xyz-lun-1

/dev/disk/by-path/ip-10.73.72.55:3260-iscsi-iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz-lun-1

2.Start a VM by using following command:
 ...
 -drive file=iscsi://10.73.72.55:3260/iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz-lun-1/1,format=qcow2,id=drive_sysdisk,if=none,cache=none,aio=native,werror=stop,rerror=stop \
 -device scsi-block,drive=drive_sysdisk,bus=scsi_pci_bus0.0,id=device_sysdisk,bootindex=0
 ...

Actual results:
qemu-kvm: -drive file=iscsi://10.73.72.55:3260/iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz-lun-1/1,format=qcow2,id=drive_sysdisk,if=none,cache=none,aio=native,werror=stop,rerror=stop: iSCSI: Failed to connect to LUN : Failed to log in to target. Status: Target not found(515)
qemu-kvm:1boot.sh: line 37: 17401 Segmentation fault      (core dumped)...

Expected results:
Just show the prompt with no core dump.

Additional info:
These are not reproducible with qemu-kvm-rhev-2.3.0-31.el7_2.12.x86_64.

(gdb) bt
#0  0x00007f5b8225dab4 in vfprintf () from /lib64/libc.so.6
#1  0x00007f5b82261801 in buffered_vfprintf () from /lib64/libc.so.6
#2  0x00007f5b8225c73e in vfprintf () from /lib64/libc.so.6
#3  0x00007f5b8232092d in __vfprintf_chk () from /lib64/libc.so.6
#4  0x00007f5b8a5c1a19 in error_printf (fmt=fmt@entry=0x7f5b8a60bc7a "%s%s") at util/qemu-error.c:40
#5  0x00007f5b8a5c1ea0 in error_print_loc () at util/qemu-error.c:183
#6  error_vreport (fmt=0x7f5b8a647758 "%s", ap=ap@entry=0x7ffe4bf761b0) at util/qemu-error.c:220
#7  0x00007f5b8a5c1f69 in error_report (fmt=fmt@entry=0x7f5b8a647758 "%s") at util/qemu-error.c:237
#8  0x00007f5b8a5c1475 in error_report_err (err=0x7f5b8bc5b3e0) at util/error.c:205
#9  0x00007f5b8a50568a in tap_cleanup (nc=0x7f5b8bd6a000) at net/tap.c:309
#10 0x00007f5b8a500195 in qemu_del_net_client (nc=0x7f5b8bd6a000) at net/net.c:429
#11 0x00007f5b8a50102d in net_cleanup () at net/net.c:1370
#12 0x00007f5b8224de69 in __run_exit_handlers () from /lib64/libc.so.6
#13 0x00007f5b8224deb5 in exit () from /lib64/libc.so.6
#14 0x00007f5b8a321063 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4106

Comment 2 yduan 2016-04-25 07:02:22 UTC
# qemu-img info /dev/sdc
image: /dev/sdc
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: 0

When use this image but with wrong disk format, core dumped.
qemu-kvm: -drive file=/dev/sdc,format=qcow2,id=drive_datadisk0,if=none,cache=none,media=disk,aio=native,werror=stop,rerror=stop,readonly=on: Image is not in qcow2 format
qemu-kvm:0boot.sh: line 45:  2503 Segmentation fault      (core dumped)

backtrace is the same.
(gdb) bt
#0  0x00007fbc73af7ab4 in vfprintf () from /lib64/libc.so.6
#1  0x00007fbc73afb801 in buffered_vfprintf () from /lib64/libc.so.6
#2  0x00007fbc73af673e in vfprintf () from /lib64/libc.so.6
#3  0x00007fbc73bba92d in __vfprintf_chk () from /lib64/libc.so.6
#4  0x00007fbc7be5ba19 in error_printf (fmt=fmt@entry=0x7fbc7bea5c7a "%s%s") at util/qemu-error.c:40
#5  0x00007fbc7be5bea0 in error_print_loc () at util/qemu-error.c:183
#6  error_vreport (fmt=0x7fbc7bee1758 "%s", ap=ap@entry=0x7fffa6bb2780) at util/qemu-error.c:220
#7  0x00007fbc7be5bf69 in error_report (fmt=fmt@entry=0x7fbc7bee1758 "%s") at util/qemu-error.c:237
#8  0x00007fbc7be5b475 in error_report_err (err=0x7fbc7edd7950) at util/error.c:205
#9  0x00007fbc7bd9f68a in tap_cleanup (nc=0x7fbc7eee6000) at net/tap.c:309
#10 0x00007fbc7bd9a195 in qemu_del_net_client (nc=0x7fbc7eee6000) at net/net.c:429
#11 0x00007fbc7bd9b02d in net_cleanup () at net/net.c:1370
#12 0x00007fbc73ae7e69 in __run_exit_handlers () from /lib64/libc.so.6
#13 0x00007fbc73ae7eb5 in exit () from /lib64/libc.so.6
#14 0x00007fbc7bbbb063 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4106


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