Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to compile on osx system? #1

Open
carmark opened this issue Jun 21, 2017 · 0 comments
Open

how to compile on osx system? #1

carmark opened this issue Jun 21, 2017 · 0 comments

Comments

@carmark
Copy link

carmark commented Jun 21, 2017

install cunit via homebrew

brew install cunit

set env

export ISCSITEST=yes

compile

./autogen.sh
./configure CPPFLAGS='-I/usr/local/Cellar/cunit/2.1-3/include' LDFLAGS='-L/usr/local/Cellar/cunit/2.1-3/lib'
make
carmark pushed a commit that referenced this issue Dec 10, 2022
Hit segfault at iser_reg_mr during attaching disk with backtrace:
 #0  0x000055ace9635b0f in iser_reg_mr (iser_conn=0x55aceca33820) at iser.c:1060
 #1  iser_connected_handler (cma_id=<optimized out>) at iser.c:1300
 sahlberg#2  iser_cma_handler (event=0x7f29ef1f7950, cma_id=<optimized out>, iser_conn=0x55aceca33820) at iser.c:1326
 sahlberg#3  cm_thread (arg=0x55aceca33820) at iser.c:1380
 sahlberg#4  0x00007f2e2c31c4a4 in start_thread (arg=0x7f29ef1f8700) at pthread_create.c:456
 sahlberg#5  0x00007f2e2c05ed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
 (gdb) p *iser_conn->tx_desc
 Cannot access memory at address 0x20

This issue can be reproduced easily by attaching several disks of iser
protocol:
 # virsh attach-device stretch iser0.xml
 # virsh attach-device stretch iser1.xml
 ...

Initialize instances with zero to avoid random value pointer.

Signed-off-by: zhenwei pi <[email protected]>
carmark pushed a commit that referenced this issue Dec 10, 2022
Hit the crash stack:
 #0  iser_initialize_headers (iser_pdu=0x7f1a3404ef50, iser_conn=0x0) at iser.c:514
 #1  iscsi_iser_send_pdu (iscsi=0x7f1a3406d700, pdu=0x7f1a3404ef50) at iser.c:714
 sahlberg#2  0x000055e3160f0157 in iscsi_scsi_command_async (iscsi=0x7f1a3406d700, iscsi@entry=0x55e317fbcc70,
     lun=lun@entry=1, task=task@entry=0x7f1a34026610, cb=cb@entry=0x55e316044c10 <iscsi_co_generic_cb>,
     d=d@entry=0x7f15feeb7710, private_data=private_data@entry=0x7f15feeb77e0) at iscsi-command.c:282
 sahlberg#3  0x000055e3160f1616 in iscsi_write10_iov_task (iscsi=0x55e317fbcc70, lun=1, lba=lba@entry=10401896,
     data=data@entry=0x0, datalen=4096, blocksize=<optimized out>, wrprotect=0, dpo=0, fua=0, fua_nv=0,
     group_number=0, cb=0x55e316044c10 <iscsi_co_generic_cb>, private_data=0x7f15feeb77e0, iov=0x7f1a34042090,
     niov=1) at iscsi-command.c:1107
 sahlberg#4  0x000055e31604680f in iscsi_co_writev (bs=<optimized out>, sector_num=<optimized out>,
     nb_sectors=<optimized out>, iov=0x7f1a3404e380, flags=<optimized out>) at block/iscsi.c:640
 sahlberg#5  0x000055e31601e89c in bdrv_driver_pwritev (bs=bs@entry=0x55e317fb6570, offset=offset@entry=5325770752,
     bytes=bytes@entry=4096, qiov=qiov@entry=0x7f1a3404e380, qiov_offset=qiov_offset@entry=0, flags=flags@entry=0)
     at block/io.c:1220

The reason is that during async reconnection, before reconnecting
call back function gets woked, we have closed the old connection,
and the new connection is not ready.
At the same time, up layer still sends pdu to the old iscsi context.

In this patch, before reconnecting successfully, just add the pdu to
waitpdu without sending.
Suggested by Bart, do not show iser related log here.

Signed-off-by: zhenwei pi <[email protected]>
[ bvanassche: reformatted patch ]
carmark pushed a commit that referenced this issue Dec 10, 2022
Hit iser hang in rdma_destroy_id with trace:
 #0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
 #1  0x00007f96ecbbcbb3 in rdma_destroy_id () from /usr/lib/librdmacm.so.1
 sahlberg#2  0x00005632027311d4 in iser_conn_release (iser_conn=iser_conn@entry=0x7f96d4027440) at iser.c:261
 sahlberg#3  0x0000563202731428 in iscsi_iser_connect (iscsi=0x563205206c70, sa=<optimized out>, ai_family=<optimized out>)
     at iser.c:1516
 sahlberg#4  0x000056320273dd3c in iscsi_connect_async (iscsi=iscsi@entry=0x563205206c70,
     portal=portal@entry=0x563205207084 "210.32.124.205:3260", cb=cb@entry=0x56320272b220 <iscsi_connect_cb>,
     private_data=private_data@entry=0x7f96d4008b00) at socket.c:389
 sahlberg#5  0x000056320272b325 in iscsi_full_connect_async (iscsi=0x563205206c70,
     portal=0x563205207084 "210.32.124.205:3260", lun=1, cb=cb@entry=0x56320272aef0 <iscsi_reconnect_cb>,
     private_data=private_data@entry=0x0) at connect.c:230
 sahlberg#6  0x000056320272b711 in iscsi_reconnect (iscsi=<optimized out>) at connect.c:473
 sahlberg#7  0x00005632026810a8 in iscsi_timed_check_events (opaque=0x563205206ae0) at block/iscsi.c:387

Currently use pthread_cancel to kill cmthread forcefully, cmthread may
exits without rdma_ack_cm_event, then unacknowledged event will be
remained in librdmacm. rdma_destroy_id hangs until uplayer ack all
the cm event.

Since destroying qp, cm thread will handle DISCONNECTED event, and
exits by itself. Joining cm thread to wait cm thread to exit
gracefully.

Signed-off-by: zhenwei pi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant