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
warning fixes for libiscsi #4
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks. Merged. |
sitsofe
pushed a commit
to sitsofe/libiscsi
that referenced
this pull request
Sep 19, 2013
warning fixes for libiscsi
Closed
pizhenwei
added a commit
to bytedance/libiscsi
that referenced
this pull request
Feb 28, 2020
Hit segfault at iser_reg_mr during attaching disk with backtrace: #0 0x000055ace9635b0f in iser_reg_mr (iser_conn=0x55aceca33820) at iser.c:1060 sahlberg#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 <pizhenwei@bytedance.com>
neutronsharc
pushed a commit
to neutronsharc/libiscsi
that referenced
this pull request
Mar 3, 2020
Hit segfault at iser_reg_mr during attaching disk with backtrace: #0 0x000055ace9635b0f in iser_reg_mr (iser_conn=0x55aceca33820) at iser.c:1060 sahlberg#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 <pizhenwei@bytedance.com>
pizhenwei
added a commit
to bytedance/libiscsi
that referenced
this pull request
Mar 11, 2020
Hit the crash stack: #0 iser_initialize_headers (iser_pdu=0x7f1a3404ef50, iser_conn=0x0) at iser.c:514 sahlberg#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. Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
pizhenwei
added a commit
to bytedance/libiscsi
that referenced
this pull request
Mar 11, 2020
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 sahlberg#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. Using a variable for cmthread to exit gracefully, the main thread can wait at most 1000ms, Reconnect iser 100 times with this patch: 84%: wait 0ms 5%: wait 1~10ms 9%: wait 11~50ms 2%: wait 51~1000ms All of the 100 tests do not hang in rdma_destroy_id any more. Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
pizhenwei
added a commit
to bytedance/libiscsi
that referenced
this pull request
Mar 18, 2020
Hit the crash stack: #0 iser_initialize_headers (iser_pdu=0x7f1a3404ef50, iser_conn=0x0) at iser.c:514 sahlberg#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 <pizhenwei@bytedance.com>
pizhenwei
added a commit
to bytedance/libiscsi
that referenced
this pull request
Mar 18, 2020
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 sahlberg#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 <pizhenwei@bytedance.com>
bvanassche
pushed a commit
that referenced
this pull request
Mar 18, 2020
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 #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 #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 #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 #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 <pizhenwei@bytedance.com> [ bvanassche: reformatted patch ]
bvanassche
pushed a commit
that referenced
this pull request
Mar 18, 2020
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 #2 0x00005632027311d4 in iser_conn_release (iser_conn=iser_conn@entry=0x7f96d4027440) at iser.c:261 #3 0x0000563202731428 in iscsi_iser_connect (iscsi=0x563205206c70, sa=<optimized out>, ai_family=<optimized out>) at iser.c:1516 #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 #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 #6 0x000056320272b711 in iscsi_reconnect (iscsi=<optimized out>) at connect.c:473 #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 <pizhenwei@bytedance.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Ronnie,
please pull a few small fixes for compilation warnings.