Bug 511002 - tgtadm segfaults upon "tgtadm --mode connection --op delete"
tgtadm segfaults upon "tgtadm --mode connection --op delete"
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: scsi-target-utils (Show other bugs)
5.3
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Mike Christie
BaseOS QE
: ZStream
Depends On:
Blocks: 545786
  Show dependency treegraph
 
Reported: 2009-07-13 03:44 EDT by LINBIT
Modified: 2013-01-10 21:32 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, targetadmin (tgtadm) failed and the target daemon (tgtd) could not shut down when users attempted to an open connection with ongoing input/output. With this update, tgtadm shuts down the connection or exits gracefully with an error and the target daemon is no more prevented from subsequently being shut down gracefully.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-13 17:57:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
strace from tgtadm (2.06 KB, text/plain)
2009-07-13 04:34 EDT, LINBIT
no flags Details

  None (edit)
Description LINBIT 2009-07-13 03:44:28 EDT
Description of problem:

When attempting to close an open connection to a target which has ongoing I/O, instead of closing down the connection or exiting gracefully with an error, tgtadm segfaults leaving tgtd in an unusable state. The only working resolution appears to be killing tgtd and restarting.

Version-Release number of selected component (if applicable):
scsi-target-utils-0.0-5.20080917snap.el5

How reproducible:
Attempt to remove an existing connection with "tgtadm --mode connection --op delete" while an initiator produces ongoing I/O on the target.

Steps to Reproduce:
1. Create a target and LU.
2. Connect an initiator to the target and start streaming I/O on the LU.
3. Issue "tgtadm --mode connection --op delete --tid=X --sid=Y --cid=Z"
  
Actual results:
tgtadm exits with SIGSEGV. After this, tgtd cannot be shut down gracefully; any invocation of "service tgtd stop" results in an error. The only way to recover from this state is to
1. Kill tgtd with SIGKILL (SIGTERM won't work)
2. Remove the lockfile at /var/lock/subsys/tgtd
3. Restart tgtd with "service tgtd start"

Expected results:
Either tgtadm shuts down the connection gracefully, or it refuses to do so and exits with an error. In either event, tgtd should not be prevented from subsequently being shut down gracefully.

Additional info:
Appears to be fixed in upstream tgt 0.9.7.
Comment 1 LINBIT 2009-07-13 04:34:30 EDT
Created attachment 351443 [details]
strace from tgtadm
Comment 2 LINBIT 2009-07-13 10:55:38 EDT
Changing severity to "high", as it may leave tgtd in an unusable state, thus may severely affect a system hosting an iSCSI target.
Comment 3 Mike Christie 2009-07-23 05:34:37 EDT
I believe this is fixed in the upstream release:
http://stgt.berlios.de/releases/tgt-0.9.7.tar.bz2 
Are you comfortable with trying that out? If not do not worry. I can make a rpm or try to replicate it here.
Comment 4 LINBIT 2009-07-23 08:03:45 EDT
I already have, and it _is_ fixed in 0.9.7.
Comment 8 LINBIT 2009-08-18 08:31:15 EDT
Update: 0.9.8 has been released. Mike, would you mind giving a brief status update on getting this fixed for RHEL?
Comment 9 Mike Christie 2009-08-18 12:15:46 EDT
It will make RHEL 5.5 for sure.

It was too late for 5.4, but we are testing the 0.9.8 release wrt some other bugs we got late, and when that is done I am going to check with management to see if we can do something before 5.5.
Comment 14 Mike Christie 2009-12-07 11:25:11 EST
Updated rpms are here:
http://people.redhat.com/mchristi/target/tgt/5.5/
I synced up with the current upstream git code per the tgtd maintainer's
suggestion.
Comment 19 Florian Nadge 2011-01-03 10:02:26 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, targetadmin (tgtadm) failed and the target daemon (tgtd) could not shut down when users attempted to an open connection with ongoing input/output. With this update, tgtadm shuts down the connection or exits gracefully with an error and the target daemon is no more prevented from subsequently being shut down gracefully.
Comment 21 errata-xmlrpc 2011-01-13 17:57:53 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0071.html

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