[LU-5678] kernel crash due to NULL pointer dereference in kiblnd_pool_alloc_node() Created: 29/Sep/14 Updated: 14/Jun/18 Resolved: 09/Jul/15 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.7.0, Lustre 2.8.0, Lustre 2.5.4 |
| Fix Version/s: | Lustre 2.7.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Li Xi (Inactive) | Assignee: | Amir Shehata (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | p4b, patch | ||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 15902 | ||||||||
| Description |
|
After OSTs were umounted, when running lustre_rmmod, two OSSs crashed with same reason. <4>Lustre: Failing over lustre-OST0019 Following is some output of crash command: It seems ps->ps_pool_list was broken since it had a NULL entry. |
| Comments |
| Comment by Li Xi (Inactive) [ 29/Sep/14 ] |
|
There might be better solutions, but following patch helps us to aviod this crash. |
| Comment by Peter Jones [ 29/Sep/14 ] |
|
Amir Could you please review this patch? Thanks Peter |
| Comment by Liang Zhen (Inactive) [ 29/Sep/14 ] |
|
I think probably we should not send NOOP anymore in o2iblnd when LNet is shutting down. |
| Comment by Liang Zhen (Inactive) [ 01/Oct/14 ] |
|
thanks lixi, I have reviewed this patch, it's on the right direction, but can be simplified to two lines. |
| Comment by Liang Zhen (Inactive) [ 10/Nov/14 ] |
|
Lixi, I updated your patch due to problem found by Isaac, could you check it? |
| Comment by Liang Zhen (Inactive) [ 25/Nov/14 ] |
|
I think I found the real issue here, in kiblnd_post_rx(): kib_conn_t *conn = rx->rx_conn;
......
rc = ib_post_recv(conn->ibc_cmid->qp, &rx->rx_wrq, &bad_wrq);
if (rc != 0) {
CERROR("Can't post rx for %s: %d, bad_wrq: %p\n",
libcfs_nid2str(conn->ibc_peer->ibp_nid), rc, bad_wrq);
rx->rx_nob = 0;
}
At this point, because we have posted RX, so we don't own it anymore, and we don't own rx_conn as well because another thread may poll this RX again, then drop it and release reference on connection, which means all below code lines can refer to an already destroyed connection. spin_lock(&conn->ibc_lock);
if (credit == IBLND_POSTRX_PEER_CREDIT)
conn->ibc_outstanding_credits++;
else
conn->ibc_reserved_credits++;
spin_unlock(&conn->ibc_lock);
kiblnd_check_sends(conn);
I will post a new patch to address this issue. |
| Comment by Gerrit Updater [ 25/Nov/14 ] |
|
Liang Zhen (liang.zhen@intel.com) uploaded a new patch: http://review.whamcloud.com/12852 |
| Comment by Isaac Huang (Inactive) [ 02/Dec/14 ] |
|
BTW, looks like we had a similar issue a very long time ago: And there seemed to be some work undone there, which was why I kept it open. I'll look into that. |
| Comment by Liang Zhen (Inactive) [ 02/Dec/14 ] |
|
Isaac, could you take a look at this patch when you have time? http://review.whamcloud.com/#/c/12718/ |
| Comment by Isaac Huang (Inactive) [ 03/Dec/14 ] |
|
Comments posted. |
| Comment by Gerrit Updater [ 10/Jan/15 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/12852/ |
| Comment by Jodi Levi (Inactive) [ 15/Jan/15 ] |
|
Patch landed to Master. Patches for other versions tracked externally. |
| Comment by Sebastien Piechurski [ 02/Apr/15 ] |
|
We still hit this bug after applying patch http://review.whamcloud.com/12852/ on the 2.5.3 lustre version. |
| Comment by Liang Zhen (Inactive) [ 07/Apr/15 ] |
|
Sebastien, I will recheck this problem |
| Comment by Peter Jones [ 23/Apr/15 ] |
|
Amir Could you please look into this issue? Thanks Peter |
| Comment by Amir Shehata (Inactive) [ 30/Apr/15 ] |
|
Sebastien, I want to clarify, have you tried to apply: http://review.whamcloud.com/#/c/12718/ and did it fix your issue? |
| Comment by Sebastien Buisson (Inactive) [ 30/Apr/15 ] |
|
Hi Amir, We get the following error when trying to access http://review.whamcloud.com/#/c/12718/ : "The page you requested was not found, or you do not have permission to view this page." Cheers, |
| Comment by Peter Jones [ 30/Apr/15 ] |
|
Sebastien Do you have a reliable reproducer for this issue? Peter |
| Comment by Amir Shehata (Inactive) [ 30/Apr/15 ] |
|
What would be helpful is if you can attach the vmcore and vmlinux of the crash, so I can investigate further. |
| Comment by Sebastien Piechurski [ 26/May/15 ] |
|
Hi Amir, I have uploaded a tarball with a dump and the matching vmlinux and module files on the FTP site under /uploads/ Regards, Sebastien. |
| Comment by Amir Shehata (Inactive) [ 10/Jun/15 ] |
|
Hi Sebastien, Can you please let me know the version of Lustre you're running, and list all the patches that have been applied to it. Also regarding the core, is it possible to upload the System.map file. Have you ever tried out this patch: http://review.whamcloud.com/12104 I also want to confirm that you see this crash on shutdown? Is it consistently reproducible? thanks |
| Comment by Sebastien Piechurski [ 10/Jun/15 ] |
|
Hi Amir, The version of Lustre is based on a 2.5.3 plus some patches. I don't have a complete mapping of these patches to the review.whamcloud.com site, but I uploaded those patches on the ftp site under uploads/ The crash is seen when unmounting a target, either on OSS or MDS, but this is not consistently reproducible. |
| Comment by Amir Shehata (Inactive) [ 11/Jun/15 ] |
|
Thanks for the extra info. I'm currently investigating and will update the bug as soon as I make more progress. |
| Comment by Amir Shehata (Inactive) [ 12/Jun/15 ] |
crash> bt PID: 9622 TASK: ffff881066c50080 CPU: 1 COMMAND: "kiblnd_sd_00_02" #0 [ffff880f23ee3630] machine_kexec at ffffffff8103b71b #1 [ffff880f23ee3690] crash_kexec at ffffffff810c9852 #2 [ffff880f23ee3760] oops_end at ffffffff8152ec30 #3 [ffff880f23ee3790] no_context at ffffffff8104c80b #4 [ffff880f23ee37e0] __bad_area_nosemaphore at ffffffff8104ca95 #5 [ffff880f23ee3830] bad_area_nosemaphore at ffffffff8104cb63 #6 [ffff880f23ee3840] __do_page_fault at ffffffff8104d2bf #7 [ffff880f23ee3960] do_page_fault at ffffffff81530b7e #8 [ffff880f23ee3990] page_fault at ffffffff8152df35 [exception RIP: kiblnd_pool_alloc_node+73] RIP: ffffffffa0b77439 RSP: ffff880f23ee3a40 RFLAGS: 00010207 RAX: 0000000000000000 RBX: ffff880fec59ce40 RCX: 000000000000003f RDX: 0000000000000010 RSI: 0000000000000002 RDI: ffff880fec59ce40 RBP: ffff880f23ee3a80 R8: 72f8000000000000 R9: 97c0000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff880fec59ce70 R13: ffff880f23ee3a48 R14: ffff880fec59ce50 R15: 0000000000000012 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #9 [ffff880f23ee3a88] kiblnd_get_idle_tx at ffffffffa0b81fa9 [ko2iblnd] #10 [ffff880f23ee3aa8] kiblnd_check_sends at ffffffffa0b857b5 [ko2iblnd] #11 [ffff880f23ee3b08] kiblnd_post_rx at ffffffffa0b87dd8 [ko2iblnd] #12 [ffff880f23ee3b58] kiblnd_recv at ffffffffa0b882c6 [ko2iblnd] #13 [ffff880f23ee3be8] lnet_ni_recv at ffffffffa05f9ecb [lnet] #14 [ffff880f23ee3c38] lnet_drop_message at ffffffffa05facf1 [lnet] #15 [ffff880f23ee3c78] lnet_parse at ffffffffa05ff672 [lnet] #16 [ffff880f23ee3d58] kiblnd_handle_rx at ffffffffa0b889db [ko2iblnd] #17 [ffff880f23ee3da8] kiblnd_rx_complete at ffffffffa0b896c3 [ko2iblnd] #18 [ffff880f23ee3df8] kiblnd_complete at ffffffffa0b89872 [ko2iblnd] #19 [ffff880f23ee3e08] kiblnd_scheduler at ffffffffa0b89c2a [ko2iblnd] #20 [ffff880f23ee3ee8] kthread at ffffffff8109e66e #21 [ffff880f23ee3f48] kernel_thread at ffffffff8100c20a crash> (gdb) l *kiblnd_pool_alloc_node+73 0x3469 is in kiblnd_pool_alloc_node (/home/ashehata/LU-5678/lnet/klnds/o2iblnd/o2iblnd.c:1855). 1850 int rc; 1851 1852 again: 1853 spin_lock(&ps->ps_lock); 1854 cfs_list_for_each_entry(pool, &ps->ps_pool_list, po_list) { 1855 if (cfs_list_empty(&pool->po_free_list)) 1856 continue; 1857 1858 pool->po_allocated ++; 1859 pool->po_deadline = cfs_time_shift(IBLND_POOL_DEADLINE); (gdb) We're looking at the possibility that this might not be the same race condition as the one addressed by the previous patch. |
| Comment by Amir Shehata (Inactive) [ 15/Jun/15 ] |
|
Is it possible to enable net and malloc debugging: lctl set_param debug=+net lctl set_param debug=+malloc And try to reproduce the issue? I'm hoping to get some insight into the system state before the crash occurs. |
| Comment by Peter Jones [ 09/Jul/15 ] |
|
Given that the fix that has landed to master seems to have met the needs of the original reporter I suggest that we recluse this ticket and that Bull open a new ticket to track any similar issue that is still outstanding. |