GithubHelp home page GithubHelp logo

sahlberg / libiscsi Goto Github PK

View Code? Open in Web Editor NEW
187.0 187.0 162.0 6.02 MB

iscsi client library and utilities

License: Other

C 97.61% Shell 1.32% Makefile 0.57% M4 0.49% Emacs Lisp 0.01% Batchfile 0.01%

libiscsi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libiscsi's Issues

[FEATURE REQUEST] Using WWN identificator to initialize a session

Hey guys,
I was wondering if this is possible.
Some people configure target servers to expose a device using a single target IQN and views for each initiator. This generally means that ( most of the time ) each initiator sees the same device attached on a different LUN.
One of the features of openiscsi ( with the help of udev ) is being able to access a device using the its persistent name - for example

/dev/disk/by-id/wwn-0x60030480008bbc901ac2e7f6fe30872e

This would be very useful with QEMU - for live migrations - since AFAIK you cannot swap the device while migrating.

Regards,
Ivelin Slavov

Protocol error after Target NOP-Out

Hi Ronnie,

I have seen the following PDU being rejected with a protocol error. Its a reply to a target initated NOP-Out (seen after a reconnect).

libiscsi:2 reconnect was successful [iqn.2001-05.com.equallogic:4-52aed6-e9bca98a4-df10029dd9e539fd-00-test-lieven]
libiscsi:1 Request was rejected with reason: 0x04 (Protocol Error) [iqn.2001-05.com.equallogic:4-52aed6-e9bca98a4-df10029dd9e539fd-00-test-lieven]
libiscsi:0 PDU header: 40 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 02 e4 00 01 00 00 00 05 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [iqn.2001-05.com.equallogic:4-52aed6-e9bca98a4-df10029dd9e539fd-00-test-lieven]
libiscsi:1 Can not match REJECT withany outstanding pdu with itt:0xffffffff [iqn.2001-05.com.equallogic:4-52aed6-e9bca98a4-df10029dd9e539fd-00-test-lieven]
libiscsi:2 reconnect initiated [iqn.2001-05.com.equallogic:4-52aed6-e9bca98a4-df10029dd9e539fd-00-test-lieven]

I have not been able to reproduce, but I wonder if we have a bug in iscsi_process_target_nop_in().

RFC7143 section 11.19.2 says that the StatSN is not increased after a NOP-Out with itt 0xfffffff, but we have

statsn = scsi_get_uint32(&in->hdr[24]);
if (statsn > iscsi->statsn) {
    iscsi->statsn = statsn;
}

In the function. Maybe the expstatsn in the NOP-IN is thus wrong in this is why the target issues a protocol error for the NOP-IN.

Peter

Enhancements to test_unmap_simple.c

  1. Check via the VPD, what's the max number of unmap block descriptor count that is possible - and use it.
  2. (Negative test) Try to unmap more than the max number of unmap block descriptor count (as specified in the VPD)
  3. (Negative test) Try to unmap more than the range (as specified in the VPD)

perl script to convert cunit to junit exits with error code 1 when producing XML of failed runs

This makes running it in Jenkins difficult - if it succeeded in creating the JUNIT XML, the RC should be 0:

[root@lg572 tmp]# perl cunit-to-junit.pl CUnitAutomated-Results.xml
cunit-to-junit.pl: ran 1 tests, 4 failed
[root@lg572 tmp]# echo $?
1
[root@lg572 tmp]# cat reports/TEST-ProutRegister.xml
test_prout_register_simple.c:46: CU_ASSERT_EQUAL(ret,0)test_prout_register_simple.c:50: CU_ASSERT_EQUAL(ret,0)test_prout_register_simple.c:54: CU_ASSERT_EQUAL(ret,0)test_prout_register_simple.c:58: CU_ASSERT_EQUAL(ret,0)

ubuntu 12.04/12.10 install crashes qemu-kvm

if i try to install a ubuntu12.04 or 12.10 server 64-bit system on a iscsi device on qemu-kvm 1.2.0 it crashes reproducably with

Oct 29 11:40:05 kamp-test-ucs-4-1/KAMP-Test kvm (newsfeed-spool-ubuntu): Bad ram pointer 0x3039303620008000

This happens after confirming the timezone settings. I will try to grab a stack trace.

How to compile it in Fedora 17?

Hi, I tried following steps but failed to install it in F17 x86_64 ,Could u give me a hand ?

git clone git://github.com/sahlberg/libiscsi.git

sudo ./autogen.sh

autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 autoreconf: configure.ac: tracing autoreconf: configure.ac: not using Libtool autoreconf: running: /usr/bin/autoconf --force autoreconf: running: /usr/bin/autoheader --force autoreconf: running: automake --add-missing --copy --force-missing configure.ac:20: installing./config.guess'
configure.ac:20: installing ./config.sub' configure.ac:6: installing./install-sh'
configure.ac:6: installing ./missing' Makefile.am:24: Libtool library used butLIBTOOL' is undefined
Makefile.am:24: The usual way to define LIBTOOL' is to addLT_INIT'
Makefile.am:24: to configure.ac' and runaclocal' and autoconf' again. Makefile.am:24: IfLT_INIT' is in configure.ac', make sure Makefile.am:24: its definition is in aclocal's search path. Makefile.am: installing./depcomp'
autoreconf: automake failed with exit status: 1
Now run ./configure and then make.
[mike@MIke-Cao-Office libiscsi]$ sudo ./configure
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
./configure: line 2372: LT_INIT: command not found
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for sin_len in sock... no
checking for sys filio.h... no
checking whether libpopt is available... no
configure: You need libpopt to compile the sample libiscsi clients.
configure: Only the library will be compiled and installed.
configure: creating ./config.status
config.status: error: cannot find input file: `Makefile.in'

Thanks,
Mike

iscsi-ls with lot of lun : * iscsi-ls: double free or corruption (out): 0x00007fff0099b7d0 ***

previously I can't list more than 256 luns,
now it crashing at lun 276

Target:iqn.1986-03.com.sun:02:7971f46d-bd0e-6289-9240-8090b5b2be9a Portal:10.6.0.38:3260,2
Lun:0 Type:DIRECT_ACCESS (Size:31G)
Lun:1 Type:DIRECT_ACCESS (Size:19G)
Lun:2 Type:DIRECT_ACCESS (Size:14G)
Lun:3 Type:DIRECT_ACCESS (Size:39G)
Lun:8 Type:DIRECT_ACCESS (Size:19G)
Lun:9 Type:DIRECT_ACCESS (Size:19G)
Lun:10 Type:DIRECT_ACCESS (Size:139G)
Lun:14 Type:DIRECT_ACCESS (Size:14G)
Lun:29 Type:DIRECT_ACCESS (Size:19G)
Lun:30 Type:DIRECT_ACCESS (Size:19G)
Lun:31 Type:DIRECT_ACCESS (Size:19G)
Lun:32 Type:DIRECT_ACCESS (Size:39G)
Lun:36 Type:DIRECT_ACCESS (Size:14G)
Lun:102 Type:DIRECT_ACCESS (Size:14G)
Lun:112 Type:DIRECT_ACCESS (Size:15G)
Lun:125 Type:DIRECT_ACCESS (Size:29G)
Lun:135 Type:DIRECT_ACCESS (Size:15G)
Lun:158 Type:DIRECT_ACCESS (Size:14G)
Lun:159 Type:DIRECT_ACCESS (Size:19G)
Lun:166 Type:DIRECT_ACCESS (Size:40G)
Lun:167 Type:DIRECT_ACCESS (Size:14G)
Lun:171 Type:DIRECT_ACCESS (Size:34G)
Lun:173 Type:DIRECT_ACCESS (Size:14G)
Lun:203 Type:DIRECT_ACCESS (Size:14G)
Lun:204 Type:DIRECT_ACCESS (Size:59G)
Lun:205 Type:DIRECT_ACCESS (Size:14G)
Lun:206 Type:DIRECT_ACCESS (Size:59G)
Lun:229 Type:DIRECT_ACCESS (Size:14G)
Lun:231 Type:DIRECT_ACCESS (Size:14G)
Lun:232 Type:DIRECT_ACCESS (Size:19G)
Lun:235 Type:DIRECT_ACCESS (Size:14G)
Lun:236 Type:DIRECT_ACCESS (Size:24G)
Lun:243 Type:DIRECT_ACCESS (Size:14G)
Lun:244 Type:DIRECT_ACCESS (Size:14G)
Lun:245 Type:DIRECT_ACCESS (Size:14G)
Lun:246 Type:DIRECT_ACCESS (Size:14G)
Lun:247 Type:DIRECT_ACCESS (Size:14G)
Lun:248 Type:DIRECT_ACCESS (Size:14G)
Lun:251 Type:DIRECT_ACCESS (Size:14G)
Lun:252 Type:DIRECT_ACCESS (Size:14G)
Lun:253 Type:DIRECT_ACCESS (Size:14G)
Lun:254 Type:DIRECT_ACCESS (Size:14G)
Lun:255 Type:DIRECT_ACCESS (Size:14G)
Lun:256 Type:DIRECT_ACCESS (Size:14G)
Lun:257 Type:DIRECT_ACCESS (Size:14G)
Lun:275 Type:DIRECT_ACCESS (Size:14G)
Lun:276 Type:DIRECT_ACCESS (Size:14G)
*** glibc detected *** iscsi-ls: double free or corruption (out): 0x00007fff0099b7d0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x71bd6)[0x7f57d321dbd6]
/lib/libc.so.6(cfree+0x6c)[0x7f57d322294c]
/usr/lib/libiscsi.so.1(iscsi_destroy_context+0x179)[0x7f57d371ea19]
iscsi-ls[0x401bd7]
/usr/lib/libiscsi.so.1(+0x4ca5)[0x7f57d371dca5]
/usr/lib/libiscsi.so.1(+0x824e)[0x7f57d372124e]
/usr/lib/libiscsi.so.1(iscsi_service+0x32b)[0x7f57d372751b]
iscsi-ls[0x401c7b]
iscsi-ls[0x401fa4]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f57d31cac8d]
iscsi-ls[0x401359]
======= Memory map: ========
00400000-00403000 r-xp 00000000 fd:00 3114442 /usr/bin/iscsi-ls
00602000-00603000 rw-p 00002000 fd:00 3114442 /usr/bin/iscsi-ls
0255c000-0257d000 rw-p 00000000 00:00 0 [heap]
7f57cc000000-7f57cc021000 rw-p 00000000 00:00 0
7f57cc021000-7f57d0000000 ---p 00000000 00:00 0
7f57d2f96000-7f57d2fac000 r-xp 00000000 fd:00 2146474 /lib/libgcc_s.so.1
7f57d2fac000-7f57d31ab000 ---p 00016000 fd:00 2146474 /lib/libgcc_s.so.1
7f57d31ab000-7f57d31ac000 rw-p 00015000 fd:00 2146474 /lib/libgcc_s.so.1
7f57d31ac000-7f57d3305000 r-xp 00000000 fd:00 2147119 /lib/libc-2.11.3.so
7f57d3305000-7f57d3504000 ---p 00159000 fd:00 2147119 /lib/libc-2.11.3.so
7f57d3504000-7f57d3508000 r--p 00158000 fd:00 2147119 /lib/libc-2.11.3.so
7f57d3508000-7f57d3509000 rw-p 0015c000 fd:00 2147119 /lib/libc-2.11.3.so
7f57d3509000-7f57d350e000 rw-p 00000000 00:00 0
7f57d350e000-7f57d3519000 r-xp 00000000 fd:00 2146568 /lib/libpopt.so.0.0.0
7f57d3519000-7f57d3718000 ---p 0000b000 fd:00 2146568 /lib/libpopt.so.0.0.0
7f57d3718000-7f57d3719000 rw-p 0000a000 fd:00 2146568 /lib/libpopt.so.0.0.0
7f57d3719000-7f57d372f000 r-xp 00000000 fd:00 3105136 /usr/lib/libiscsi.so.1.0.10500
7f57d372f000-7f57d392f000 ---p 00016000 fd:00 3105136 /usr/lib/libiscsi.so.1.0.10500
7f57d392f000-7f57d3930000 rw-p 00016000 fd:00 3105136 /usr/lib/libiscsi.so.1.0.10500
7f57d3930000-7f57d394e000 r-xp 00000000 fd:00 2147115 /lib/ld-2.11.3.so
7f57d3b3d000-7f57d3b40000 rw-p 00000000 00:00 0
7f57d3b4a000-7f57d3b4d000 rw-p 00000000 00:00 0
7f57d3b4d000-7f57d3b4e000 r--p 0001d000 fd:00 2147115 /lib/ld-2.11.3.so
7f57d3b4e000-7f57d3b4f000 rw-p 0001e000 fd:00 2147115 /lib/ld-2.11.3.so
7f57d3b4f000-7f57d3b50000 rw-p 00000000 00:00 0
7fff00988000-7fff0099d000 rw-p 00000000 00:00 0 [stack]
7fff009fe000-7fff00a00000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted

target problem

Hi, I don't know if it's a bug, and a bad crafted iscsi packet, but ...
[edited by sahlberg]

iscsi_parse_url should sanitize urlencoded urls

I am having problems using libvirt, because they urlencode all parts of the URI ( which is valid ). Since libiscsi uses the URI syntax, I think the URI parser should care to urldecode all parts ( after splitting ) before using any.

WRITE SAME (16) differences between SBC-3 vs SBC-4

In SBC-4, a new bit is added to WRITE SAME (16) called NDOB. It's used to indicate whether the data in the data-out-buffer should be used when the UNMAP bit is set. It's only valid when UNMAP==1 and is a check condition if NDOB and not UNMAP. If NDOB==1, this means that there doesn't need to be any data supplied with the WRITE SAME (16) command and that the target will proceed as if the data-out-buffer had a block of all zeroes.

The test_writesame16_unmap tests appear to be using the SBC-3 behavior where there is no knowledge of the NDOB flag, and UNMAP==1 implies that there doesn't have to be any data in the data-out-buffer. It's expecting that and the target will write it's own buffer of zeroes.

This is not necessarily a bug, but will cause test failures when talking to an SBC-4 compliant target since it will see that there is insufficient data in the data-out-buffer in these WRITE SAME (16) w/ UNMAP tests. I'm not sure what the correct solution is.

makerpms failure - iscsi-multipath.c:47:29: fatal error: iscsi-multipath.h: No such file or directory

make[2]: Entering directory `/home/yanivk/rpmbuild/BUILD/libiscsi-1.14.0/test-tool'
gcc -DHAVE_CONFIG_H -I. -I.. -I. -I./../include "-D_U_=attribute((unused)) " "-D_R_(A,B)=attribute((format(printf,A,B)))" -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wno-strict-aliasing -Werror -Wwrite-strings -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o iscsi-test-cu.o iscsi-test-cu.c
gcc -DHAVE_CONFIG_H -I. -I.. -I. -I./../include "-D_U_=attribute((unused)) " "-D_R_(A,B)=attribute((format(printf,A,B)))" -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wno-strict-aliasing -Werror -Wwrite-strings -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o iscsi-support.o iscsi-support.c
gcc -DHAVE_CONFIG_H -I. -I.. -I. -I./../include "-D_U_=attribute((unused)) " "-D_R_(A,B)=attribute((format(printf,A,B)))" -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wno-strict-aliasing -Werror -Wwrite-strings -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o iscsi-multipath.o iscsi-multipath.c
gcc -DHAVE_CONFIG_H -I. -I.. -I. -I./../include "-D_U_=attribute((unused)) " "-D_R_(A,B)=attribute((format(printf,A,B)))" -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wno-strict-aliasing -Werror -Wwrite-strings -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o test_compareandwrite_simple.o test_compareandwrite_simple.c
iscsi-multipath.c:47:29: fatal error: iscsi-multipath.h: No such file or directory
#include "iscsi-multipath.h"
^
compilation terminated.
iscsi-test-cu.c:54:29: fatal error: iscsi-multipath.h: No such file or directory
#include "iscsi-multipath.h"
^
compilation terminated.

Last commit:
commit 3f73f00
Merge: a8e4268 ff7a733
Author: Ronnie Sahlberg [email protected]
Date: Tue Jun 2 19:39:02 2015 -0700

Merge pull request #168 from rodrigc/fix1

test_reserve6_target_cold_reset: fix login parameters

Secondary initiator name is not used in multipath ProutPreempt tests

When running the ProutPreempt tests normally here are the results:

Suite: ProutPreempt
  Test: RemoveRegistration ...
    Test Persistent Reserve IN PREEMPT works.
    Send PROUT/REGISTER_AND_IGNORE to register init=iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test
    Send PROUT/CLEAR to clear all registrations and any PR reservation
    Send PROUT/REGISTER_AND_IGNORE to register init=iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test
    cloning sd1 for second session
    Send PROUT/REGISTER_AND_IGNORE to register init=iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test-2
    Send PRIN/READ_KEYS
    Send PROUT/PREEMPT to preempt reservation and/or registration
    Got UA for TUR
    TUR good after 1 retries
    TUR good after 0 retries
    Send PRIN/READ_KEYS
    Send PROUT/REGISTER to unregister init=iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test-2
passed

(You might need to scroll right to see the full initiators being used)
When using multipath here are the results:

Suite: ProutPreempt
  Test: RemoveRegistration ...
    Test Persistent Reserve IN PREEMPT works.
    Send PROUT/REGISTER_AND_IGNORE to register init=iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test
    Send PROUT/CLEAR to clear all registrations and any PR reservation
    Send PROUT/REGISTER_AND_IGNORE to register init=iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test
    using multipath dev for second session
    Send PROUT/REGISTER_AND_IGNORE to register init=iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test
    Send PRIN/READ_KEYS
    Send PROUT/PREEMPT to preempt reservation and/or registration
    [FAILED] PROUT command: failed with sense. RESERVATION CONFLICT
    TUR good after 0 retries
    TUR good after 0 retries
    Send PRIN/READ_KEYS
    Send PROUT/REGISTER to unregister init=iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test
FAILED
    1. test_prout_preempt.c:81  - CU_ASSERT_EQUAL(rk->num_keys,2)
    2. test_prout_preempt.c:91  - CU_ASSERT_EQUAL(ret,0)
    3. test_prout_preempt.c:104  - CU_ASSERT_EQUAL(rk->prgeneration,old_gen + 1)

In the multipath case the iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test-2 initiator name is never used...

Difficulty iscsi-test-cu connecting to SAN after configuring the initiators and shares.

I'm having trouble getting iscsi-test-cu to connect to the SAN iscsi share.

I can get my ubuntu client to discover and attach the iscsi share, format it, write to it...so the configuration of the LUN seems adequate.

I have added both the default iscsi initiators to the SAN config
iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test
iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test-2
and added them to the target lun. Configured the LUN to attach to all initiators.

confirmed the LUN number = 1 with iscsi-ls

Then I run this command as root
iscsi-test-cu -t=LINUX.Write10 iscsi://10.145.137.117:3260/iqn.1986-03.com.sun:02:e3d302ca-1cba-ca84-e67b-c57cd86387b3/1

and get the following
[FAILED] INQUIRY command failed with sense. (null)
[FAILED] INQUIRY command failed with sense. (null)
Failed to read Block Device Characteristics page
[SKIPPED] REPORT_SUPPORTED_OPCODES is not implemented.

 CUnit - A unit testing framework for C - Version 2.1-2
 http://cunit.sourceforge.net/

Run Summary: Type Total Ran Passed Failed Inactive
suites 0 0 n/a 0 0
tests 0 0 0 0 0
asserts 0 0 0 0 n/a

Elapsed time = 0.000 seconds
Tests completed with return value: 0

Is this likely a problem with my SAN? As I said, I can use standard iscsi mount, write, read, workflows using open-iscsi, but I'm having trouble getting the iscsi-test-cu tool to work.

Overflow in iscsi-perf.c

In fill_read_queue(), I believe that num_blocks is an int, and the calculation:
num_blocks = client->num_blocks - client->pos;

Might overflow a bit (as client->num_blocks is a 64bit unsigned number and client->pos may be zero in sequential IO), so num_blocks may end up as a negative value.
Passed on to other functions, it may be well over the limit we wanted. Certainly if it's a negative number, the check:
if (num_blocks > blocks_per_io) {
num_blocks = blocks_per_io;
}

Will not work.

libiscsi compilation relies on external XSL - and fails to compile

  1. The fact it relies on an external URL is sometimes problematic (when compiling within a closed network?)
  2. Compilation failed:
    test -z "/usr/bin/xsltproc" || /usr/bin/xsltproc -o doc/iscsi-inq.1 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl doc/iscsi-inq.1.xml
    http://www.oasis-open.org/docbook/xml/4.2/ent/iso-amsn.ent:1: parser error : Content error in the external subset
    HTTP/1.0 200 OK
    ^
    http://www.oasis-open.org/docbook/xml/4.2/ent/iso-amsn.ent:1: validity error : All markup of the conditional section is not in the same entity
    HTTP/1.0 200 OK
    ^
    http://www.oasis-open.org/docbook/xml/4.2/ent/iso-amsn.ent:1: parser error : Content error in the external subset
    HTTP/1.0 200 OK
    ^
    http://www.oasis-open.org/docbook/xml/4.2/ent/iso-amsn.ent:1: validity error : All markup of the conditional section is not in the same entity
    HTTP/1.0 200 OK
    ^
    http://www.oasis-open.org/docbook/xml/4.2/ent/iso-amsn.ent:1: parser error : Content error in the external subset
    HTTP/1.0 200 OK
    ^
    unable to parse doc/iscsi-inq.1.xml
    make: [doc/iscsi-inq.1] Error 6 (ignored)

CDB USAGE DATA issue for REPORT SUPPORTED OPCODES test case

Dear sahlberg,

I found that the CDB[0] Usage Data should be operation code in SPC-4 document.

"The CDB USAGE DATA field contains information about the CDB for the command being queried.The first byte of the CDB USAGE DATA field shall contain the operation code for the command being queried."

But test case verifies that CDB[0] Usage Data should be 0xFF in test-tool/test_report_supported_opcodes_one_command.c
Could you help to check this?
Thanks.

...
..
logging(LOG_VERBOSE, "Verify CDB[0] Usage Data is 0xFF");
CU_ASSERT_EQUAL(rsoc_one->cdb_usage_data[0], 0xff);
if (rsoc_one->cdb_usage_data[0] != 0xff) {
    logging(LOG_NORMAL, "[FAILED] CDB[0] Usage Data is "
        "not 0xFF");
}

Best Regards.

iscsi-perf is not packaged in RPM

Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/yanivk/rpmbuild/BUILDROOT/libiscsi-1.13.0-1.db47577.el7.centos.x86_64
error: Installed (but unpackaged) file(s) found:
/usr/bin/iscsi-perf

RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/bin/iscsi-perf

LD_PRELOAD=, writing to lun not working, any hint ?

Hi,
I'm trying to copy a raw file to a lun,with ld_preload

LD_PRELOAD=./bin/ld_iscsi.so dd if=image.raw of=iscsi://127.0.0.1:3262/iqn.ronnie.test/2 bs=4K

But I get an
" Resource temporarily unavailable" error

reading from the lun and writing to file works fine
LD_PRELOAD=./bin/ld_iscsi.so dd if=iscsi://127.0.0.1:3262/iqn.ronnie.test/2 of=image.raw bs=4k

Any idea ?

Regards,

Alexandre

Qemu + libiscsi = lun 0 only access

I'm using Qemu v.2.2.1 with libiscsi 1.13 as initiator and SCST 3.1 as target and it works.
Earlier I've opened issue #154, but it was closed as "unpronounceable".
The issue nature is - when I try to use libiscsi > 1.13 with QEMU - no matter which lun number I pass, it always connects to lun 0.
So, for now, I've repeated my tests and get same result - qemu opens lun 0.
Here, some tests.
First:
./iscsi-inq iscsi://192.168.21.29/iqn.2005-05.com.sdsys:pool400g/0
Peripheral Qualifier:CONNECTED
Peripheral Device Type:DIRECT_ACCESS
........
Vendor:SCST_FIO
Product:dummy22964
.......
So yes, lun 0 has underluying device "SCST_FIO dummy22964" - its seems to connect to right lun.

Second:
./iscsi-inq iscsi://192.168.21.29/iqn.2005-05.com.sdsys:pool400g/1
Peripheral Qualifier:CONNECTED
Peripheral Device Type:DIRECT_ACCESS
....
Vendor:SCST_BIO
Product:v3075215056
....
It's all right again - lun 1 has underluying device "SCST_BIO v3075215056".

Now, I try to run qemu with libiscsi 1.13:
Command line is:
/usr/bin/kvm ....... -drive file=iscsi://192.168.21.29/iqn.2005-05.com.sdsys:pool400g/1 .....

good-lun

It's seems to be fine, virtio_scsi has "SCST_BIO v3075215056" which belongs to lun 1.

But when I switch to libiscsi 1.15 with same command line, as before, I have:
bad-lun
Now, virtio_scsi has "SCST_FIO dummy22964" which belongs to lun 0.

So, issue is reproducible.

I've bisect between 1.13 and 1.14 and discovered, that:

  1. b03959d including this commit and earlier qemu starts and connects to proper lun.
  2. 15490a4 including this commit and to the previously mentioned qemu don't start at all, with Segmentation Fault.
  3. a45094b including this commit and later qemu starts, but always connects to lun 0

Hard time compiling libiscsi==1.9.0 on OmniOS (Solaris)

I managed to compile the previous versions easily, but with 1.8.0 and 1.9.0,
I get the following error when performing "make":

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -I./include "-D_U_=__attribute__((unused))" "-D_R_(A,B)=__attribute__((format(printf,A,B)))" -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Werror -Wno-strict-aliasing -g -O2 -MT lib/socket.lo -MD -MP -MF lib/.deps/socket.Tpo -c lib/socket.c  -fPIC -DPIC -o lib/.libs/socket.o
lib/socket.c: In function 'iscsi_read_from_socket':
lib/socket.c:492:33: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
lib/socket.c: In function 'iscsi_set_bind_interfaces':
lib/socket.c:858:68: error: unused parameter 'interfaces' [-Werror=unused-parameter]
cc1: all warnings being treated as errors


I also had to apply the following patch before that

diff --git a/include/iscsi-private.h b/include/iscsi-private.h
index 9345b09..239da43 100644
--- a/include/iscsi-private.h
+++ b/include/iscsi-private.h
@@ -323,7 +323,7 @@ iscsi_add_to_outqueue(struct iscsi_context *iscsi, struct iscsi_pdu *pdu);
 int
 iscsi_serial32_compare(uint32_t s1, uint32_t s2);

-u_int32_t
+uint32_t
 iscsi_itt_post_increment(struct iscsi_context *iscsi);

 #ifdef __cplusplus

I disabled -Werror ( applying a patch from another issue ) and got to

/bin/sh ./libtool  --tag=CC   --mode=link gcc -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-strict-aliasing -g -O2   -o bin/iscsi-inq src/iscsi-inq.o lib/libiscsi.la -lpopt 
libtool: link: gcc -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-strict-aliasing -g -O2 -o bin/.libs/iscsi-inq src/iscsi-inq.o  lib/.libs/libiscsi.so -lpopt -R/usr/local/lib
Undefined                       first referenced
 symbol                             in file
recv                                lib/.libs/libiscsi.so
send                                lib/.libs/libiscsi.so
iscsi_set_bind_interface            lib/.libs/libiscsi.so
getsockname                         lib/.libs/libiscsi.so
socket                              lib/.libs/libiscsi.so
getprotobyname                      lib/.libs/libiscsi.so
setsockopt                          lib/.libs/libiscsi.so
getsockopt                          lib/.libs/libiscsi.so
connect                             lib/.libs/libiscsi.so
getaddrinfo                         lib/.libs/libiscsi.so
freeaddrinfo                        lib/.libs/libiscsi.so
inet_ntoa                           lib/.libs/libiscsi.so
ld: fatal: symbol referencing errors. No output written to bin/.libs/iscsi-inq

After that I applied

diff --git a/Makefile.am b/Makefile.am
index 1797ddf..9b2f087 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ AUTOMAKE_OPTIONS = foreign subdir-objects
 AM_CPPFLAGS=-I. -I$(srcdir)/include "-D_U_=__attribute__((unused))" \
        "-D_R_(A,B)=__attribute__((format(printf,A,B)))"
 AM_CFLAGS=$(WARN_CFLAGS)
-LDADD = lib/libiscsi.la -lpopt
+LDADD = lib/libiscsi.la -lpopt -lsocket

 EXTRA_DIST = autogen.sh COPYING LICENCE-GPL-2.txt LICENCE-LGPL-2.1.txt \
             packaging/RPM/libiscsi.spec.in packaging/RPM/makerpms.sh

Which i am not sure is the right thing to do, since there is a socket.o file in lib/.libs, but anyway, I got to

/bin/sh ./libtool  --tag=CC   --mode=link gcc -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-strict-aliasing -g -O2   -o bin/iscsi-inq src/iscsi-inq.o lib/libiscsi.la -lpopt -lsocket 
libtool: link: gcc -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-strict-aliasing -g -O2 -o bin/.libs/iscsi-inq src/iscsi-inq.o  lib/.libs/libiscsi.so -lpopt -lsocket -R/usr/local/lib
Undefined                       first referenced
 symbol                             in file
iscsi_set_bind_interface            lib/.libs/libiscsi.so

Which I woked around with

diff --git a/lib/libiscsi.syms b/lib/libiscsi.syms
index 80673f5..37d8efe 100644
--- a/lib/libiscsi.syms
+++ b/lib/libiscsi.syms
@@ -87,7 +87,7 @@ iscsi_set_tcp_keepidle
 iscsi_set_tcp_keepcnt
 iscsi_set_tcp_keepintvl
 iscsi_set_tcp_syncnt
-iscsi_set_bind_interface
+#iscsi_set_bind_interface
 iscsi_startstopunit_sync
 iscsi_startstopunit_task
 iscsi_synchronizecache10_sync

And it finally compiled.
I am explaining all of this, because I am not very fond of C and there are probably better ways to fix this, also, Is the library part good enough with this way of compiling ?
Regards,

qemu with libiscsi and equallogic sans -> protcol errors

During high load situations I see "Protocol error in packet received from initiator" errors on the SAN. Whats the best way to debug this? The SAN closes the connection, is it possible to log the last command send before the connection is closed?

another one clang build fail

[fedya@xgene libiscsi-1.11.0]$ make
make all-recursive
make[1]: Entering directory '/home/fedya/libiscsi/BUILD/libiscsi-1.11.0'
Making all in lib
make[2]: Entering directory '/home/fedya/libiscsi/BUILD/libiscsi-1.11.0/lib'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/fedya/libiscsi/BUILD/libiscsi-1.11.0/lib'
Making all in doc
make[2]: Entering directory '/home/fedya/libiscsi/BUILD/libiscsi-1.11.0/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/fedya/libiscsi/BUILD/libiscsi-1.11.0/doc'
Making all in utils
make[2]: Entering directory '/home/fedya/libiscsi/BUILD/libiscsi-1.11.0/utils'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/fedya/libiscsi/BUILD/libiscsi-1.11.0/utils'
Making all in test-tool
make[2]: Entering directory '/home/fedya/libiscsi/BUILD/libiscsi-1.11.0/test-tool'
/usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include "-D_U_=attribute((unused))" "-D_R_(A,B)=attribute((format(printf,A,B)))" -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wno-strict-aliasing -Werror -Wwrite-strings -O2 -g -c -o 0430_report_all_supported_ops.o 0430_report_all_supported_ops.c
0430_report_all_supported_ops.c:189:10: error: cast from 'char ' to 'struct scsi_command_descriptor *' increases required alignment from 1 to 4 [-Werror,-Wcast-align]
desc = (struct scsi_command_descriptor *)((char *)desc +
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Makefile:1388: recipe for target '0430_report_all_supported_ops.o' failed
make[2]: *
* [0430_report_all_supported_ops.o] Error 1
make[2]: Leaving directory '/home/fedya/libiscsi/BUILD/libiscsi-1.11.0/test-tool'
Makefile:483: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/fedya/libiscsi/BUILD/libiscsi-1.11.0'
Makefile:370: recipe for target 'all' failed
make: *** [all] Error 2

clang build fail

I trying to compile libiscsi with clang 3.4

Build Log: http://pastie.org/9355907

Error:
C -c -o iscsi-swp.o iscsi-swp.c
iscsi-swp.c:165:17: error: comparison of array 'iscsi_url->user' not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
if (iscsi_url->user != NULL) {
~~~~~~~~~~~^~~~ ~~~~

JUNIT/XML output does not show skipped tests

2014-03-25 11:50:57 + /usr/bin/iscsi-test-cu -i iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test -t ALL.CompareAndWrite iscsi://10.205.31.6:3260/iqn.2008-05.com.xtremio:001e67594d7d/0 -v --xml
2014-03-25 11:50:57
2014-03-25 11:50:57 [SKIPPED] --dataloss flag is not set. Skipping test.
2014-03-25 11:50:57 [SKIPPED] --dataloss flag is not set. Skipping test.
2014-03-25 11:50:57 + perl /tmp/cunit-to-junit.pl
2014-03-25 11:50:57 /tmp/cunit-to-junit.pl: ran 2 tests, 0 failed

The XML doesn't show tests as skipped:



can't build

Hi, trying to build from 1.4.0 tarball (on fedora 17 x64)

INSTALL says run ./autogen.sh but it's not present.

skipping to step 2 and running ./configure results in "configure: error: cannot run /bin/sh ./config.sub".

On lun add/remove all iscsi sessions are restarting

Hi, I'm using scst v3.0.2 target with Proxmox VE 3.4, libiscsi 1.12

When I add/remove iscsi LUN, whole VM's which connected to this
target stops it's disk activity, and seems to be forced to re-connect to
target. It's not a problem when you have 3-5 luns, but when target have
more than 100 luns this re-connect sequence takes about 10 minutes Is
it possible, to change such behavior ?

SCST team's answer on such request follows:

Please ask the Proxmox maintainers to modify how SCSI unit attention conditions are handled in Proxmox. SCST submits a "REPORTED LUNS DATA HAS CHANGED" to the initiator after a LUN has been added or removed. If the initiator receives that UA it should rescan LUNs instead of disconnecting and reconnecting. See also http://www.t10.org/lists/asc-num.htm for a complete list of unit attention conditions.

And Proxmox anwer is:
I think someone should post the problem on the libiscsi list.

So, here I am.

Regression: build failure (since commit 370741f8) on CentOS 6.5 at least.

On CentOS 6.5:
{noformat}
Creating libiscsi-1.12.0.tar.gz ... autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 configure.ac:8: warning: macroAM_PROG_AR' not found in library
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in .'. libtoolize: copying file./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, m4'. libtoolize: copying filem4/libtool.m4'
libtoolize: copying file m4/ltoptions.m4' libtoolize: copying filem4/ltsugar.m4'
libtoolize: copying file m4/ltversion.m4' libtoolize: copying filem4/lt~obsolete.m4'
configure.ac:8: warning: macro `AM_PROG_AR' not found in library
autoreconf: running: /usr/bin/autoconf --force
configure.ac:8: error: possibly undefined macro: AM_PROG_AR
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
Now run ./configure and then make.
configure: error: cannot find install-sh or install.sh in "." "./.." "./../.."
{noformat}

It passed fine in 7d96336 and before:
{noformat}
Creating libiscsi-1.12.0.tar.gz ... autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 autoreconf: configure.ac: tracing autoreconf: running: libtoolize --copy --force libtoolize: putting auxiliary files in.'.
libtoolize: copying file ./ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR,m4'.
libtoolize: copying file m4/libtool.m4' libtoolize: copying filem4/ltoptions.m4'
libtoolize: copying file m4/ltsugar.m4' libtoolize: copying filem4/ltversion.m4'
libtoolize: copying file m4/lt~obsolete.m4' autoreconf: running: /usr/bin/autoconf --force autoreconf: running: /usr/bin/autoheader --force autoreconf: running: automake --add-missing --copy --force-missing configure.ac:13: installing./compile'
configure.ac:8: installing ./config.guess' configure.ac:8: installing./config.sub'
configure.ac:6: installing ./install-sh' configure.ac:6: installing./missing'
examples/Makefile.am: installing ./depcomp' autoreconf: Leaving directory.'
Now run ./configure and then make.
{noformat}

XML option doesn't seem to work

Almost sure it previously worked, now it doesn't:
running:
/usr/bin/iscsi-test-cu --xml -l

No XML is produced.
Ran with strace and could not see any XML being created/called/etc.
(Also tried running tests - which for the time being failed - no XML created).

It'd also be nice if -v and -x worked together, btw.

Leak from malloc in iscsi_full_connect_async()

iscsi_full_connect_async() has a malloc of a connect_task that is never freed.

Scratching my head about correct way to handle, as ends up getting used and propogated through multiple callbacks

Thought I'd just post my observations and see if there was a general way to approach with your callback design pattern.

jon

persistent portals not supported?

Is it itentional that libiscsi fails if the target sends a "Target moved temporarily" (257) response?
There a a lot of storages out there which use virtual IPs for a persistent connections and redirect the users to different ports or members for load sharing or in case of storage evacuation.

RPM packaging fails

  1. Running from libiscsi's root directory, it creates a directory under my home dir:
    /home/yanivk/rpmbuild/BUILD/libiscsi-1.10.0
    (while I've expected it to build under
    /home/yanivk/libiscsi/rpmbuild/BUILD/libiscsi-1.10.0)
    It was launched from /home/yanivk/libiscsi , by calling ./packaging/RPM/makerpms.sh
  2. Eventually when it runs, it fails on the following:
  3. /usr/bin/mkdir -p /home/yanivk/rpmbuild/BUILDROOT/libiscsi-1.10.0-1.cc81b67.fc19.x86_64/usr/share/doc/libiscsi-devel-1.10.0
  4. cp -pr COPYING /home/yanivk/rpmbuild/BUILDROOT/libiscsi-1.10.0-1.cc81b67.fc19.x86_64/usr/share/doc/libiscsi-devel-1.10.0
  5. cp -pr LICENCE-LGPL-2.1.txt /home/yanivk/rpmbuild/BUILDROOT/libiscsi-1.10.0-1.cc81b67.fc19.x86_64/usr/share/doc/libiscsi-devel-1.10.0
  6. cp -pr README /home/yanivk/rpmbuild/BUILDROOT/libiscsi-1.10.0-1.cc81b67.fc19.x86_64/usr/share/doc/libiscsi-devel-1.10.0
  7. cp -pr TODO /home/yanivk/rpmbuild/BUILDROOT/libiscsi-1.10.0-1.cc81b67.fc19.x86_64/usr/share/doc/libiscsi-devel-1.10.0
  8. exit 0
    Provides: libiscsi-devel = 1.10.0-1.cc81b67.fc19 libiscsi-devel(x86-64) = 1.10.0-1.cc81b67.fc19 pkgconfig(libiscsi) = 1.10.0
    Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
    Requires: /usr/bin/pkg-config libiscsi.so.3()(64bit)
    Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/yanivk/rpmbuild/BUILDROOT/libiscsi-1.10.0-1.cc81b67.fc19.x86_64
    error: Installed (but unpackaged) file(s) found:
    /usr/bin/iscsi-swp
    /usr/share/man/man1/iscsi-swp.1.gz

RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/bin/iscsi-swp
/usr/share/man/man1/iscsi-swp.1.gz

Running with cc81b67 on Fedora 20

-Werror breaking compilation on printf("%lu", uint64_t)

When compiling libiscsi-1.12.0 with gcc-4.8.3 I got the following:

iscsi-dd.c: In function 'write_cb':
iscsi-dd.c:82:3: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' [-Werror=format=]
   printf("\r%lu of %lu blocks transferred.", client->pos, client->src_num_blocks);
   ^
iscsi-dd.c:82:3: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t' [-Werror=format=]
iscsi-dd.c: In function 'main':
iscsi-dd.c:381:3: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t' [-Werror=format=]
   fprintf(stderr, "source LUN is bigger than destination (%lu > %lu sectors)\n", client.src_num_blocks, client.dst_num_blocks);
   ^
iscsi-dd.c:381:3: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t' [-Werror=format=]
cc1: all warnings being treated as errors
make[2]: *** [iscsi-dd.o] Error 1
make[2]: Leaving directory `/tmp/libiscsi-1.12.0/libiscsi-1.12.0/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/libiscsi-1.12.0/libiscsi-1.12.0'
make: *** [all] Error 2

This simple patch fixes it.

--- libiscsi-1.12.0/examples/iscsi-dd.c 2014-07-21 17:36:03.000000000 +0300
+++ libiscsi-1.12.0/examples/iscsi-dd.c 2014-08-02 00:37:29.146796941 +0300
@@ -20,2 +20,3 @@
 #include <stdint.h>
+#include <inttypes.h>
 #include <string.h>
@@ -81,3 +82,3 @@ void write_cb(struct iscsi_context *iscs
        if (client->progress) {
-               printf("\r%lu of %lu blocks transferred.", client->pos, client->src_num_blocks);
+               printf("\r%"PRIu64" of %"PRIu64" blocks transferred.", client->pos, client->src_num_blocks);
        }
@@ -380,3 +381,3 @@ int main(int argc, char *argv[])
        if (client.src_num_blocks > client.dst_num_blocks) {
-               fprintf(stderr, "source LUN is bigger than destination (%lu > %lu sectors)\n", client.src_num_blocks, client.dst_num_blocks);
+               fprintf(stderr, "source LUN is bigger than destination (%"PRIu64" > %"PRIu64" sectors)\n", client.src_num_blocks, client.dst_num_blocks);
                exit(10);

If built with gcc 4.9, iscsi-test-cu segfaults when it is invoked without a testname regexp

I think that this issue is more a gcc bug than a bug in libiscsi but I open an issue here to gather your opinion.

I built libiscsi with gcc on Debian testing (Debian gcc version 4.9.1-11) and I experience a very strange crash when I invoke iscsi-test-cu without a testname regexp:

$ ./iscsi-test-cu -i iqn.1998-01.com.vmware:esx1-1102c5da \
-I iqn.1998-01.com.vmware:esx2-77a134a0 iscsi://10.21.58.53/iqn.1995-05.foo.bar:iscsi1/0
Segmentation fault

What happens is that a strdup() of a NULL variable is performed. In the snippet below, the else path is taken even if testname_re is NULL:

if (!testname_re) {
    family_re = strdup("*");
    suite_re = strdup("*");
    test_re = strdup("*");
} else {
    family_re = strdup(testname_re);
}

I have extracted the code from iscsi-test-cu that triggers the bug. You can find it there:
https://gist.github.com/cvubrugier/e2b72080ab344b9f1a15

I have tested with several gcc versions and only gcc 4.9 with -O2 exhibit this bug (4.7 and 4.8 are OK). Moreover, passing the -fno-strict-aliasing flag to gcc 4.9 fixes the issue.

Error running autogen.sh

I'm running autoconf 2.63. When I go to build, I get:

autoreconf: running: /usr/bin/autoconf --force
configure.ac:22: error: possibly undefined macro: AS_SET_STATUS
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

I'm not really up on autoconf, and anything I tried to do to work around it just made it worse. Any help would be appreciated!

iscsi-test-cu can't cope with abort?

While running iscsi-test-cu with -t ALL against a software iSCSI target libiscsi failed to respond to a NOP making the initiator abort the connection. libiscsi went on to establish a new connection but became stuck in iscsi_logout_sync.

Can't build RPM (1.14.0)

After latest 'git pull' and 'make clean' :
yanivk@vd-yanivk7:~/libiscsi (master)> ./packaging/RPM/makerpms.sh
~/libiscsi ~/libiscsi
Creating libiscsi-1.14.0.tar.gz ... make dist-gzip am__post_remove_distdir='@:'
make[1]: Entering directory `/home/yanivk/libiscsi'
if test -d "libiscsi-1.13.0"; then find "libiscsi-1.13.0" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "libiscsi-1.13.0" || { sleep 5 && rm -rf "libiscsi-1.13.0"; }; else :; fi
...

On a clean clone, I'm getting:
yanivk@vd-yanivk7:/tmp/libi/libiscsi (master)> ./packaging/RPM/makerpms.sh
/tmp/libi/libiscsi /tmp/libi/libiscsi
Creating libiscsi-1.14.0.tar.gz ... make: *** No rule to make target `dist'. Stop.
/tmp/libi/libiscsi
Done.
Build failed!

XML output is less verbose than regular output

Where with '-v' you see some nice and well understood failure messages, with '-x' you just get the asserts. For example:
test_verify12_simple.c:52: CU_ASSERT_EQUAL(ret,0)
In the XML, compared to:
VERIFY12 command: failed with sense. SENSE KEY:ILLEGAL_REQUEST(5) ASCQ:(null)(0x4900)
With '-v'.

At least JUNIT supports both stdout and stderr outputs. Not sure about CUnit's XML format.

It means that failed jobs have to be re-run again to check the error, which is a bit of waste of time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.