{"action":"created","issue":{"url":"https://api.github.com/repos/spdk/spdk/issues/89","repository_url":"https://api.github.com/repos/spdk/spdk","labels_url":"https://api.github.com/repos/spdk/spdk/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/spdk/spdk/issues/89/comments","events_url":"https://api.github.com/repos/spdk/spdk/issues/89/events","html_url":"https://github.com/spdk/spdk/issues/89","id":196247570,"number":89,"title":"libiscsi test suite can cause double free in spdk iSCSI target","user":{"login":"sitsofe","id":4005180,"avatar_url":"https://avatars.githubusercontent.com/u/4005180?v=3","gravatar_id":"","url":"https://api.github.com/users/sitsofe","html_url":"https://github.com/sitsofe","followers_url":"https://api.github.com/users/sitsofe/followers","following_url":"https://api.github.com/users/sitsofe/following{/other_user}","gists_url":"https://api.github.com/users/sitsofe/gists{/gist_id}","starred_url":"https://api.github.com/users/sitsofe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sitsofe/subscriptions","organizations_url":"https://api.github.com/users/sitsofe/orgs","repos_url":"https://api.github.com/users/sitsofe/repos","events_url":"https://api.github.com/users/sitsofe/events{/privacy}","received_events_url":"https://api.github.com/users/sitsofe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-17T22:59:12Z","updated_at":"2016-12-21T07:24:41Z","closed_at":null,"body":"Description of the problem\r\nRepeatedly running [libiscsi](https://github.com/sahlberg/libiscsi)'s test suite against a spdk memory based iSCSI target resulted in a double free.\r\n\r\nStep to reproduce:\r\n1. Create an iSCSI configuration at app/iscsi_tgt/iscsi.conf that includes the following:\r\n```\r\n[Malloc]\r\n  # Number of Malloc targets\r\n  NumberOfLuns 1\r\n  # Malloc targets are 128M\r\n  LunSizeInMB 128\r\n  # Block size. Default is 512 bytes.\r\n  BlockSize 512\r\n\r\n[InitiatorGroup1]\r\n  InitiatorName ALL\r\n  Netmask 127.0.0.1/16\r\n\r\n[TargetNode1]\r\n  TargetName disk1\r\n  TargetAlias \"Data Disk1\"\r\n  Mapping PortalGroup1 InitiatorGroup1\r\n  UseDigest Auto\r\n  # Use the first malloc target\r\n  LUN0 Malloc0\r\n\r\n  QueueDepth 128\r\n```\r\n2. Run\r\n`sudo app/iscsi_tgt/iscsi_tgt -c app/iscsi_tgt/iscsi.conf`\r\n3. After the target is started run\r\n`iscsi-test-cu -V -t SCSI.Read6 iscsi://127.0.0.1/iqn.2016-06.io.spdk:disk1/0`\r\n4. When step 3 hangs press Ctrl-C.\r\n5. Run\r\n`iscsi-test-cu -V -t SCSI.Read6 iscsi://127.0.0.1/iqn.2016-06.io.spdk:disk1/0`\r\n\r\nExpected result:\r\nTest suite not to hang after 3? iSCSI target not to crash after 5?\r\n\r\nActual result:\r\nAfter 3 libiscsi's test suite hangs on\r\n```\r\n    Send READ6 (Expecting CHECK_CONDITION) LBA:261985 blocks:160\r\n    [FAILED] READ6 failed with wrong sense. Should have failed with ILLEGAL_REQUEST(0x05)/LBA_OUT_OF_RANGE(0x2100) but failed with Sense: (null)(0x00)/(0x0000)\r\n\r\n    Send READ6 (Expecting CHECK_CONDITION) LBA:261984 blocks:161\r\n```\r\n\r\nAfter 5 the iSCSI target prints this:\r\n```\r\niscsi.c:1540:spdk_iscsi_op_login_initialize_port: ***ERROR*** InitiatorName is empty\r\niscsi.c:4247:spdk_iscsi_execute: ***ERROR*** iscsi_op_login() failed\r\nconn.c:1214:spdk_iscsi_conn_handle_incoming_pdus: ***ERROR*** spdk_iscsi_execute() fatal error on NULL(NULL)\r\niscsi_subsystem.c: 493:spdk_put_pdu: ***ERROR*** Negative PDU refcount: 0x7f7d825716c0\r\n*** Error in `app/iscsi_tgt/iscsi_tgt': double free or corruption (!prev): 0x00000000024aaa50 ***\r\n```\r\n\r\nHow reproducible is the problem?\r\nThe problem is reproducible every time.\r\n\r\nVersion information:\r\nlibiscsi commit 3a598ea8465c8204688c6ccbc6d74003342f6651\r\nspdk commit b8da09b629c9f19a317edcb2495271fd5e278b65\r\ndpdk-16.11"},"comment":{"url":"https://api.github.com/repos/spdk/spdk/issues/comments/268454771","html_url":"https://github.com/spdk/spdk/issues/89#issuecomment-268454771","issue_url":"https://api.github.com/repos/spdk/spdk/issues/89","id":268454771,"user":{"login":"optimistyzy","id":4121731,"avatar_url":"https://avatars.githubusercontent.com/u/4121731?v=3","gravatar_id":"","url":"https://api.github.com/users/optimistyzy","html_url":"https://github.com/optimistyzy","followers_url":"https://api.github.com/users/optimistyzy/followers","following_url":"https://api.github.com/users/optimistyzy/following{/other_user}","gists_url":"https://api.github.com/users/optimistyzy/gists{/gist_id}","starred_url":"https://api.github.com/users/optimistyzy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optimistyzy/subscriptions","organizations_url":"https://api.github.com/users/optimistyzy/orgs","repos_url":"https://api.github.com/users/optimistyzy/repos","events_url":"https://api.github.com/users/optimistyzy/events{/privacy}","received_events_url":"https://api.github.com/users/optimistyzy/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T07:24:41Z","updated_at":"2016-12-21T07:24:41Z","body":"The issue is solved, the related patches will be pushed later."}}
{"actor":{"display_login":"optimistyzy"}}