Skip to contentSkip to conversation

kernel bug encountered at drivers/net/xen-netback/netback.c:430!

BUG Alex Braunegg 5 participants 16 messages Dec 22, 2017 – Jan 10, 2018

lore
Share & tools
lore
#0 lore raw

Hi all,

Experienced the same issue again today:

============================================================================
=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x2f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) k10temp(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 12636 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff880062518000 task.stack: ffffc90004f88000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc90004f8bc68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90000fcd000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc90004f8be98 R08: 000000000000037d R09: 000000000000037e
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90000fd6730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007f40c63639a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000006375f000 CR4: 0000000000000660
Call Trace:
 ? error_exit+0x5/0x20
 ? __update_load_avg_cfs_rq+0x176/0x180
 ? xen_mc_flush+0x87/0x120
 ? xen_load_sp0+0x84/0xa0
 ? __switch_to+0x1c1/0x360
 ? finish_task_switch+0x78/0x240
 ? __schedule+0x192/0x496
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_unlock_irqrestore+0x11/0x20
 xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
 ? do_wait_intr+0x80/0x80
 ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
 kthread+0x106/0x140
 ? kthread_destroy_worker+0x60/0x60
 ? kthread_destroy_worker+0x60/0x60
 ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 5b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 99 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 5b 55 a0 31 c0 45 31 
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc90004f8bc68
---[ end trace 010682c76619a1bd ]---

============================================================================
=========

Best regards,

Alex

-----Original Message-----
From: Alex Braunegg [mailto:[email protected]]
Sent: Thursday, 21 December 2017 8:04 AM
To: '[email protected]'
Subject: [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

Hi all,

I experienced the following bug whilst using a Xen VM. What happened was that this morning a single Xen VM suddenly terminated without cause with the following being logged in dmesg.

Only 1 VM experienced an issue (out of 2 which were running), the other remained up and fully functional until I attempted to restart the crashed VM which triggered the kernel bug.

Kernel: 4.14.6
Xen: 4.8.2

============================================================================
=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x3f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) k10temp(E) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 13163 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff8800595cc980 task.stack: ffffc900028e0000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc900028e3c68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90002969000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc900028e3e98 R08: 000000000000037b R09: 000000000000037c
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90002972730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007fee260ff9a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 0000000062815000 CR4: 0000000000000660
Call Trace:
 ? error_exit+0x5/0x20
 ? __update_load_avg_cfs_rq+0x176/0x180
 ? xen_mc_flush+0x87/0x120
 ? xen_load_sp0+0x84/0xa0
 ? __switch_to+0x1c1/0x360
 ? finish_task_switch+0x78/0x240
 ? __schedule+0x192/0x496
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_unlock_irqrestore+0x11/0x20
 xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
 ? do_wait_intr+0x80/0x80
 ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
 kthread+0x106/0x140
 ? kthread_destroy_worker+0x60/0x60
 ? kthread_destroy_worker+0x60/0x60
 ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 3b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 b9 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 3b 55 a0 31 c0 45 31 
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc900028e3c68
---[ end trace 7d827dae67002ffc ]---

============================================================================
=========

The section of relevant kernel code is:

============================================================================
=========

static inline void xenvif_grant_handle_reset(struct xenvif_queue *queue,
u16 pending_idx)

{
        if (unlikely(queue->grant_tx_handle[pending_idx] ==
                     NETBACK_INVALID_HANDLE)) {
                netdev_err(queue->vif->dev,
                           "Trying to unmap invalid handle! pending_idx:
0x%x\n",
                           pending_idx);
                BUG();
        }
        queue->grant_tx_handle[pending_idx] = NETBACK_INVALID_HANDLE;
}

============================================================================
=========

In an attempt to recover from this situation I restarted / destroyed (xl restart <vmname> / xl destroy <vmname>) the VM to recover it's state and the following error messages were logged at the console:

============================================================================
=========

libxl: error: libxl_exec.c:129:libxl_report_child_exitstatus:
/etc/xen/scripts/block remove [25271] died due to fatal signal Segmentation fault
libxl: error: libxl_device.c:1080:device_backend_callback: unable to remove device with path /local/domain/0/backend/vif/2/0
libxl: error: libxl.c:1647:devices_destroy_cb: libxl__devices_destroy failed for 2

============================================================================
=========

After which the physical system hung, then the physical system restarted with nothing else logged and everything came back OK & operational including the VM that crashed.

Further details (xl dmesg, xl info) attached.

Best regards,

Alex Braunegg

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#1 lore raw
Quoted 3 lines · Alex Braunegg

Hi all,

Experienced the same issue again today:

Ccing the maintainers.

Juergen

Quoted 185 lines

============================================================================
=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x2f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) k10temp(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 12636 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff880062518000 task.stack: ffffc90004f88000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc90004f8bc68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90000fcd000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc90004f8be98 R08: 000000000000037d R09: 000000000000037e
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90000fd6730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007f40c63639a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000006375f000 CR4: 0000000000000660
Call Trace:
 ? error_exit+0x5/0x20
 ? __update_load_avg_cfs_rq+0x176/0x180
 ? xen_mc_flush+0x87/0x120
 ? xen_load_sp0+0x84/0xa0
 ? __switch_to+0x1c1/0x360
 ? finish_task_switch+0x78/0x240
 ? __schedule+0x192/0x496
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_unlock_irqrestore+0x11/0x20
 xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
 ? do_wait_intr+0x80/0x80
 ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
 kthread+0x106/0x140
 ? kthread_destroy_worker+0x60/0x60
 ? kthread_destroy_worker+0x60/0x60
 ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 5b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 99 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 5b 55 a0 31 c0 45 31 
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc90004f8bc68
---[ end trace 010682c76619a1bd ]---

============================================================================
=========

Best regards,

Alex

-----Original Message-----
From: Alex Braunegg [mailto:[email protected]]
Sent: Thursday, 21 December 2017 8:04 AM
To: '[email protected]'
Subject: [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

Hi all,

I experienced the following bug whilst using a Xen VM. What happened was that this morning a single Xen VM suddenly terminated without cause with the following being logged in dmesg.

Only 1 VM experienced an issue (out of 2 which were running), the other remained up and fully functional until I attempted to restart the crashed VM which triggered the kernel bug.

Kernel: 4.14.6
Xen: 4.8.2

============================================================================
=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x3f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) k10temp(E) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 13163 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff8800595cc980 task.stack: ffffc900028e0000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc900028e3c68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90002969000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc900028e3e98 R08: 000000000000037b R09: 000000000000037c
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90002972730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007fee260ff9a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 0000000062815000 CR4: 0000000000000660
Call Trace:
 ? error_exit+0x5/0x20
 ? __update_load_avg_cfs_rq+0x176/0x180
 ? xen_mc_flush+0x87/0x120
 ? xen_load_sp0+0x84/0xa0
 ? __switch_to+0x1c1/0x360
 ? finish_task_switch+0x78/0x240
 ? __schedule+0x192/0x496
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_unlock_irqrestore+0x11/0x20
 xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
 ? do_wait_intr+0x80/0x80
 ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
 kthread+0x106/0x140
 ? kthread_destroy_worker+0x60/0x60
 ? kthread_destroy_worker+0x60/0x60
 ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 3b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 b9 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 3b 55 a0 31 c0 45 31 
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc900028e3c68
---[ end trace 7d827dae67002ffc ]---

============================================================================
=========

The section of relevant kernel code is:

============================================================================
=========

static inline void xenvif_grant_handle_reset(struct xenvif_queue *queue,
u16 pending_idx)

{
        if (unlikely(queue->grant_tx_handle[pending_idx] ==
                     NETBACK_INVALID_HANDLE)) {
                netdev_err(queue->vif->dev,
                           "Trying to unmap invalid handle! pending_idx:
0x%x\n",
                           pending_idx);
                BUG();
        }
        queue->grant_tx_handle[pending_idx] = NETBACK_INVALID_HANDLE;
}

============================================================================
=========

In an attempt to recover from this situation I restarted / destroyed (xl restart <vmname> / xl destroy <vmname>) the VM to recover it's state and the following error messages were logged at the console:

============================================================================
=========

libxl: error: libxl_exec.c:129:libxl_report_child_exitstatus:
/etc/xen/scripts/block remove [25271] died due to fatal signal Segmentation fault
libxl: error: libxl_device.c:1080:device_backend_callback: unable to remove device with path /local/domain/0/backend/vif/2/0
libxl: error: libxl.c:1647:devices_destroy_cb: libxl__devices_destroy failed for 2

============================================================================
=========

After which the physical system hung, then the physical system restarted with nothing else logged and everything came back OK & operational including the VM that crashed.

Further details (xl dmesg, xl info) attached.

Best regards,

Quoted 8 lines

Alex Braunegg

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw

Hi all,

Another crash this morning:

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x3a

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E) xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) k10temp(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)
CPU: 0 PID: 14238 Comm: vif2.0-q0-deall Tainted: P           OE   4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff880059e255c0 task.stack: ffffc90001f64000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc90001f67c68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90001f55000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc90001f67e98 R08: 0000000000000372 R09: 0000000000000373
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90001f5e730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007f92865d29a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000006209c000 CR4: 0000000000000660
Call Trace:
 ? _raw_spin_unlock_irqrestore+0x11/0x20
 ? error_exit+0x5/0x20
 ? __update_load_avg_cfs_rq+0x176/0x180
 ? xen_mc_flush+0x87/0x120
 ? xen_load_sp0+0x84/0xa0
 ? __switch_to+0x1c1/0x360
 ? finish_task_switch+0x78/0x240
 ? __schedule+0x192/0x496
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_unlock_irqrestore+0x11/0x20
 xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
 ? do_wait_intr+0x80/0x80
 ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
 kthread+0x106/0x140
 ? kthread_destroy_worker+0x60/0x60
 ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48 c7 c6 10 2b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 c9 06 e1 <0f> 0b 0f 0b 48 8b 53 20 89 c1 48 c7 c6 48 2b 55 a0 31 c0 45 31 
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP: ffffc90001f67c68
---[ end trace 130de0b7e39d0eea ]---

Best regards,

Alex

-----Original Message-----
From: Juergen Gross [mailto:[email protected]]
Sent: Friday, 22 December 2017 5:47 PM
To: Alex Braunegg; [email protected]
Cc: Wei Liu; Paul Durrant
Subject: Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

Quoted 3 lines · Alex Braunegg

Hi all,

Experienced the same issue again today:

Ccing the maintainers.

Juergen

Quoted 185 lines

============================================================================
=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x2f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) k10temp(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 12636 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff880062518000 task.stack: ffffc90004f88000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc90004f8bc68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90000fcd000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc90004f8be98 R08: 000000000000037d R09: 000000000000037e
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90000fd6730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007f40c63639a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000006375f000 CR4: 0000000000000660
Call Trace:
 ? error_exit+0x5/0x20
 ? __update_load_avg_cfs_rq+0x176/0x180
 ? xen_mc_flush+0x87/0x120
 ? xen_load_sp0+0x84/0xa0
 ? __switch_to+0x1c1/0x360
 ? finish_task_switch+0x78/0x240
 ? __schedule+0x192/0x496
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_unlock_irqrestore+0x11/0x20
 xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
 ? do_wait_intr+0x80/0x80
 ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
 kthread+0x106/0x140
 ? kthread_destroy_worker+0x60/0x60
 ? kthread_destroy_worker+0x60/0x60
 ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 5b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 99 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 5b 55 a0 31 c0 45 31 
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc90004f8bc68
---[ end trace 010682c76619a1bd ]---

============================================================================
=========

Best regards,

Alex

-----Original Message-----
From: Alex Braunegg [mailto:[email protected]]
Sent: Thursday, 21 December 2017 8:04 AM
To: '[email protected]'
Subject: [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

Hi all,

I experienced the following bug whilst using a Xen VM. What happened was that this morning a single Xen VM suddenly terminated without cause with the following being logged in dmesg.

Only 1 VM experienced an issue (out of 2 which were running), the other remained up and fully functional until I attempted to restart the crashed VM which triggered the kernel bug.

Kernel: 4.14.6
Xen: 4.8.2

============================================================================
=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x3f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) k10temp(E) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 13163 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff8800595cc980 task.stack: ffffc900028e0000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc900028e3c68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90002969000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc900028e3e98 R08: 000000000000037b R09: 000000000000037c
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90002972730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007fee260ff9a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 0000000062815000 CR4: 0000000000000660
Call Trace:
 ? error_exit+0x5/0x20
 ? __update_load_avg_cfs_rq+0x176/0x180
 ? xen_mc_flush+0x87/0x120
 ? xen_load_sp0+0x84/0xa0
 ? __switch_to+0x1c1/0x360
 ? finish_task_switch+0x78/0x240
 ? __schedule+0x192/0x496
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_lock_irqsave+0x1a/0x3c
 ? _raw_spin_unlock_irqrestore+0x11/0x20
 xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
 ? do_wait_intr+0x80/0x80
 ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
 kthread+0x106/0x140
 ? kthread_destroy_worker+0x60/0x60
 ? kthread_destroy_worker+0x60/0x60
 ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 3b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 b9 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 3b 55 a0 31 c0 45 31 
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc900028e3c68
---[ end trace 7d827dae67002ffc ]---

============================================================================
=========

The section of relevant kernel code is:

============================================================================
=========

static inline void xenvif_grant_handle_reset(struct xenvif_queue *queue,
u16 pending_idx)

{
        if (unlikely(queue->grant_tx_handle[pending_idx] ==
                     NETBACK_INVALID_HANDLE)) {
                netdev_err(queue->vif->dev,
                           "Trying to unmap invalid handle! pending_idx:
0x%x\n",
                           pending_idx);
                BUG();
        }
        queue->grant_tx_handle[pending_idx] = NETBACK_INVALID_HANDLE;
}

============================================================================
=========

In an attempt to recover from this situation I restarted / destroyed (xl restart <vmname> / xl destroy <vmname>) the VM to recover it's state and the following error messages were logged at the console:

============================================================================
=========

libxl: error: libxl_exec.c:129:libxl_report_child_exitstatus:
/etc/xen/scripts/block remove [25271] died due to fatal signal Segmentation fault
libxl: error: libxl_device.c:1080:device_backend_callback: unable to remove device with path /local/domain/0/backend/vif/2/0
libxl: error: libxl.c:1647:devices_destroy_cb: libxl__devices_destroy failed for 2

============================================================================
=========

After which the physical system hung, then the physical system restarted with nothing else logged and everything came back OK & operational including the VM that crashed.

Further details (xl dmesg, xl info) attached.

Best regards,

Quoted 8 lines

Alex Braunegg

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw

Alex,

         I saw this same issue when running a kernel 4.13+, switched back to 4.11 and the problem has not resurfaced.  I would like to understand the root cause of this issue.

Mike

Quoted 259 lines · Alex Braunegg

Hi all,

Another crash this morning:

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x3a

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E) xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) k10temp(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)
CPU: 0 PID: 14238 Comm: vif2.0-q0-deall Tainted: P           OE   4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff880059e255c0 task.stack: ffffc90001f64000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc90001f67c68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90001f55000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc90001f67e98 R08: 0000000000000372 R09: 0000000000000373
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90001f5e730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007f92865d29a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000006209c000 CR4: 0000000000000660
Call Trace:
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  ? error_exit+0x5/0x20
  ? __update_load_avg_cfs_rq+0x176/0x180
  ? xen_mc_flush+0x87/0x120
  ? xen_load_sp0+0x84/0xa0
  ? __switch_to+0x1c1/0x360
  ? finish_task_switch+0x78/0x240
  ? __schedule+0x192/0x496
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
  ? do_wait_intr+0x80/0x80
  ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
  kthread+0x106/0x140
  ? kthread_destroy_worker+0x60/0x60
  ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48 c7 c6 10 2b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 c9 06 e1 <0f> 0b 0f 0b 48 8b 53 20 89 c1 48 c7 c6 48 2b 55 a0 31 c0 45 31
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP: ffffc90001f67c68
---[ end trace 130de0b7e39d0eea ]---

Best regards,

Alex

-----Original Message-----
From: Juergen Gross [mailto:[email protected]]
Sent: Friday, 22 December 2017 5:47 PM
To: Alex Braunegg; [email protected]
Cc: Wei Liu; Paul Durrant
Subject: Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

Quoted 3 lines · Alex Braunegg

Hi all,

Experienced the same issue again today:

Ccing the maintainers.

Juergen

Quoted 184 lines

============================================================================
=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x2f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) k10temp(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 12636 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff880062518000 task.stack: ffffc90004f88000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc90004f8bc68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90000fcd000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc90004f8be98 R08: 000000000000037d R09: 000000000000037e
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90000fd6730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007f40c63639a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000006375f000 CR4: 0000000000000660
Call Trace:
  ? error_exit+0x5/0x20
  ? __update_load_avg_cfs_rq+0x176/0x180
  ? xen_mc_flush+0x87/0x120
  ? xen_load_sp0+0x84/0xa0
  ? __switch_to+0x1c1/0x360
  ? finish_task_switch+0x78/0x240
  ? __schedule+0x192/0x496
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
  ? do_wait_intr+0x80/0x80
  ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
  kthread+0x106/0x140
  ? kthread_destroy_worker+0x60/0x60
  ? kthread_destroy_worker+0x60/0x60
  ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 5b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 99 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 5b 55 a0 31 c0 45 31
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc90004f8bc68
---[ end trace 010682c76619a1bd ]---

============================================================================
=========

Best regards,

Alex

-----Original Message-----
From: Alex Braunegg [mailto:[email protected]]
Sent: Thursday, 21 December 2017 8:04 AM
To: '[email protected]'
Subject: [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

Hi all,

I experienced the following bug whilst using a Xen VM. What happened was that this morning a single Xen VM suddenly terminated without cause with the following being logged in dmesg.

Only 1 VM experienced an issue (out of 2 which were running), the other remained up and fully functional until I attempted to restart the crashed VM which triggered the kernel bug.

Kernel: 4.14.6
Xen: 4.8.2

============================================================================
=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x3f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) k10temp(E) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 13163 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff8800595cc980 task.stack: ffffc900028e0000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc900028e3c68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90002969000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc900028e3e98 R08: 000000000000037b R09: 000000000000037c
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90002972730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007fee260ff9a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 0000000062815000 CR4: 0000000000000660
Call Trace:
  ? error_exit+0x5/0x20
  ? __update_load_avg_cfs_rq+0x176/0x180
  ? xen_mc_flush+0x87/0x120
  ? xen_load_sp0+0x84/0xa0
  ? __switch_to+0x1c1/0x360
  ? finish_task_switch+0x78/0x240
  ? __schedule+0x192/0x496
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
  ? do_wait_intr+0x80/0x80
  ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
  kthread+0x106/0x140
  ? kthread_destroy_worker+0x60/0x60
  ? kthread_destroy_worker+0x60/0x60
  ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 3b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 b9 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 3b 55 a0 31 c0 45 31
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc900028e3c68
---[ end trace 7d827dae67002ffc ]---

============================================================================
=========

The section of relevant kernel code is:

============================================================================
=========

static inline void xenvif_grant_handle_reset(struct xenvif_queue *queue,
u16 pending_idx)

{
         if (unlikely(queue->grant_tx_handle[pending_idx] ==
                      NETBACK_INVALID_HANDLE)) {
                 netdev_err(queue->vif->dev,
                            "Trying to unmap invalid handle! pending_idx:
0x%x\n",
                            pending_idx);
                 BUG();
         }
         queue->grant_tx_handle[pending_idx] = NETBACK_INVALID_HANDLE;
}

============================================================================
=========

In an attempt to recover from this situation I restarted / destroyed (xl restart <vmname> / xl destroy <vmname>) the VM to recover it's state and the following error messages were logged at the console:

============================================================================
=========

libxl: error: libxl_exec.c:129:libxl_report_child_exitstatus:
/etc/xen/scripts/block remove [25271] died due to fatal signal Segmentation fault
libxl: error: libxl_device.c:1080:device_backend_callback: unable to remove device with path /local/domain/0/backend/vif/2/0
libxl: error: libxl.c:1647:devices_destroy_cb: libxl__devices_destroy failed for 2

============================================================================
=========

After which the physical system hung, then the physical system restarted with nothing else logged and everything came back OK & operational including the VM that crashed.

Further details (xl dmesg, xl info) attached.

Best regards,

Quoted 8 lines

Alex Braunegg

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw

Hi Mike,

Thanks for the confirmation on that. Since the last crash I was having them daily until I downgraded back to kernel 4.4 and Xen 4.6 where stability resumed. Zero crashes since 24th December.

@Paul, Wei,

Can we get this investigated? It appears that this is a stability blocker for Xen releases on newer kernels.

Best regards,

Alex

-----Original Message-----
From: Michael Collins [mailto:[email protected]]
Sent: Friday, 29 December 2017 5:05 AM
To: Alex Braunegg; 'Juergen Gross'; [email protected]
Cc: 'Paul Durrant'; 'Wei Liu'
Subject: Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

Alex,

I saw this same issue when running a kernel 4.13+, switched
back to 4.11 and the problem has not resurfaced. I would like to understand the root cause of this issue.

Mike

Quoted 259 lines · Alex Braunegg

Hi all,

Another crash this morning:

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x3a

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E) xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) k10temp(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)
CPU: 0 PID: 14238 Comm: vif2.0-q0-deall Tainted: P           OE   4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff880059e255c0 task.stack: ffffc90001f64000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc90001f67c68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90001f55000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc90001f67e98 R08: 0000000000000372 R09: 0000000000000373
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90001f5e730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007f92865d29a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000006209c000 CR4: 0000000000000660
Call Trace:
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  ? error_exit+0x5/0x20
  ? __update_load_avg_cfs_rq+0x176/0x180
  ? xen_mc_flush+0x87/0x120
  ? xen_load_sp0+0x84/0xa0
  ? __switch_to+0x1c1/0x360
  ? finish_task_switch+0x78/0x240
  ? __schedule+0x192/0x496
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
  ? do_wait_intr+0x80/0x80
  ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
  kthread+0x106/0x140
  ? kthread_destroy_worker+0x60/0x60
  ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48 c7 c6 10 2b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 c9 06 e1 <0f> 0b 0f 0b 48 8b 53 20 89 c1 48 c7 c6 48 2b 55 a0 31 c0 45 31
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP: ffffc90001f67c68
---[ end trace 130de0b7e39d0eea ]---

Best regards,

Alex

-----Original Message-----
From: Juergen Gross [mailto:[email protected]]
Sent: Friday, 22 December 2017 5:47 PM
To: Alex Braunegg; [email protected]
Cc: Wei Liu; Paul Durrant
Subject: Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

Quoted 3 lines · Alex Braunegg

Hi all,

Experienced the same issue again today:

Ccing the maintainers.

Juergen

Quoted 184 lines

============================================================================
=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x2f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) k10temp(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 12636 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff880062518000 task.stack: ffffc90004f88000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc90004f8bc68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90000fcd000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc90004f8be98 R08: 000000000000037d R09: 000000000000037e
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90000fd6730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007f40c63639a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000006375f000 CR4: 0000000000000660
Call Trace:
  ? error_exit+0x5/0x20
  ? __update_load_avg_cfs_rq+0x176/0x180
  ? xen_mc_flush+0x87/0x120
  ? xen_load_sp0+0x84/0xa0
  ? __switch_to+0x1c1/0x360
  ? finish_task_switch+0x78/0x240
  ? __schedule+0x192/0x496
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
  ? do_wait_intr+0x80/0x80
  ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
  kthread+0x106/0x140
  ? kthread_destroy_worker+0x60/0x60
  ? kthread_destroy_worker+0x60/0x60
  ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 5b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 99 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 5b 55 a0 31 c0 45 31
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc90004f8bc68
---[ end trace 010682c76619a1bd ]---

============================================================================
=========

Best regards,

Alex

-----Original Message-----
From: Alex Braunegg [mailto:[email protected]]
Sent: Thursday, 21 December 2017 8:04 AM
To: '[email protected]'
Subject: [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

Hi all,

I experienced the following bug whilst using a Xen VM. What happened was that this morning a single Xen VM suddenly terminated without cause with the following being logged in dmesg.

Only 1 VM experienced an issue (out of 2 which were running), the other remained up and fully functional until I attempted to restart the crashed VM which triggered the kernel bug.

Kernel: 4.14.6
Xen: 4.8.2

============================================================================
=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x3f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) k10temp(E) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 13163 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff8800595cc980 task.stack: ffffc900028e0000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc900028e3c68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90002969000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc900028e3e98 R08: 000000000000037b R09: 000000000000037c
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90002972730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007fee260ff9a0(0000) GS:ffff88007f400000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 0000000062815000 CR4: 0000000000000660
Call Trace:
  ? error_exit+0x5/0x20
  ? __update_load_avg_cfs_rq+0x176/0x180
  ? xen_mc_flush+0x87/0x120
  ? xen_load_sp0+0x84/0xa0
  ? __switch_to+0x1c1/0x360
  ? finish_task_switch+0x78/0x240
  ? __schedule+0x192/0x496
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
  ? do_wait_intr+0x80/0x80
  ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
  kthread+0x106/0x140
  ? kthread_destroy_worker+0x60/0x60
  ? kthread_destroy_worker+0x60/0x60
  ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 3b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 b9 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 3b 55 a0 31 c0 45 31
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc900028e3c68
---[ end trace 7d827dae67002ffc ]---

============================================================================
=========

The section of relevant kernel code is:

============================================================================
=========

static inline void xenvif_grant_handle_reset(struct xenvif_queue *queue,
u16 pending_idx)

{
         if (unlikely(queue->grant_tx_handle[pending_idx] ==
                      NETBACK_INVALID_HANDLE)) {
                 netdev_err(queue->vif->dev,
                            "Trying to unmap invalid handle! pending_idx:
0x%x\n",
                            pending_idx);
                 BUG();
         }
         queue->grant_tx_handle[pending_idx] = NETBACK_INVALID_HANDLE;
}

============================================================================
=========

In an attempt to recover from this situation I restarted / destroyed (xl restart <vmname> / xl destroy <vmname>) the VM to recover it's state and the following error messages were logged at the console:

============================================================================
=========

libxl: error: libxl_exec.c:129:libxl_report_child_exitstatus:
/etc/xen/scripts/block remove [25271] died due to fatal signal Segmentation fault
libxl: error: libxl_device.c:1080:device_backend_callback: unable to remove device with path /local/domain/0/backend/vif/2/0
libxl: error: libxl.c:1647:devices_destroy_cb: libxl__devices_destroy failed for 2

============================================================================
=========

After which the physical system hung, then the physical system restarted with nothing else logged and everything came back OK & operational including the VM that crashed.

Further details (xl dmesg, xl info) attached.

Best regards,

Quoted 8 lines

Alex Braunegg

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by Wei Liu
#5 lore raw
Quoted 11 lines

-----Original Message-----
From: Alex Braunegg [mailto:[email protected]]
Sent: 28 December 2017 19:32
To: 'Michael Collins' <[email protected]>; 'Juergen Gross' <[email protected]>; [email protected]
Cc: Paul Durrant <[email protected]>; Wei Liu <[email protected]>
Subject: RE: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen- netback/netback.c:430!

Hi Mike,

Quoted 8 lines

Thanks for the confirmation on that. Since the last crash I was having them daily until I downgraded back to kernel 4.4 and Xen 4.6 where stability resumed. Zero crashes since 24th December.

@Paul, Wei,

Can we get this investigated? It appears that this is a stability blocker for Xen releases on newer kernels.

The only mildly suspicious thing I can see in netback is:

commit cc8737a5fe9051b7fa052b08c57ddb9f539c389a

Author: Willem de Bruijn <[email protected]>
Date:   Fri Aug 25 13:10:43 2017 -0400

xen-netback: update ubuf_info initialization to anonymous union

The xen driver initializes struct ubuf_info fields using designated initializers. I recently moved these fields inside a nested anonymous struct inside an anonymous union. I had missed this use case.

This breaks compilation of xen-netback with older compilers. >From kbuild bot with gcc-4.4.7:

drivers/net//xen-netback/interface.c: In function
'xenvif_init_queue':
>> drivers/net//xen-netback/interface.c:554: error: unknown field 'ctx' specified in initializer >> drivers/net//xen-netback/interface.c:554: warning: missing braces around initializer
drivers/net//xen-netback/interface.c:554: warning: (near initialization for '(anonymous).<anonymous>')
>> drivers/net//xen-netback/interface.c:554: warning: initialization makes integer from pointer without a cast >> drivers/net//xen-netback/interface.c:555: error: unknown field 'desc' specified in initializer

Add double braces around the designated initializers to match their nested position in the struct. After this, compilation succeeds again.

Fixes 4ab6c99d99bb ("sock: MSG_ZEROCOPY notification coalescing")

...and it's only mildly suspicious since netback uses the ubuf_info structure and stores the pending_idx value used by xenvif_grant_handle_reset() (which is the function calling BUG()) in the desc field; I can't spot anything wrong with the patch as such. It could be that the cause is external to netback.

How easy is it to trigger this? I'm assuming, from the original description, that I can probably trigger it by forcibly terminating a running domain and then trying to restart it.

Paul

Quoted 307 lines

Best regards,

Alex

-----Original Message-----
From: Michael Collins [mailto:[email protected]]
Sent: Friday, 29 December 2017 5:05 AM
To: Alex Braunegg; 'Juergen Gross'; [email protected]
Cc: 'Paul Durrant'; 'Wei Liu'
Subject: Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen- netback/netback.c:430!

Alex,

I saw this same issue when running a kernel 4.13+, switched
back to 4.11 and the problem has not resurfaced. I would like to understand the root cause of this issue.

Mike

Quoted 9 lines · Alex Braunegg

Hi all,

Another crash this morning:

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x3a

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E) sunrpc(E) ipmi_si(E) ipmi_msghandler(E) k10temp(E) zfs(POE) zcommon(POE) znvpair(POE) icp(POE) spl(OE) zavl(POE) zunicode(POE) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E) ahci(E) libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

Quoted 1 line
CPU: 0 PID: 14238 Comm: vif2.0-q0-deall Tainted: P           OE   4.14.6-

1.el6.x86_64 #1

Quoted 10 lines
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013
task: ffff880059e255c0 task.stack: ffffc90001f64000
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc90001f67c68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90001f55000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc90001f67e98 R08: 0000000000000372 R09: 0000000000000373
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90001f5e730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007f92865d29a0(0000) GS:ffff88007f400000(0000)

knlGS:0000000000000000

Quoted 13 lines
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000006209c000 CR4: 0000000000000660
Call Trace:
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  ? error_exit+0x5/0x20
  ? __update_load_avg_cfs_rq+0x176/0x180
  ? xen_mc_flush+0x87/0x120
  ? xen_load_sp0+0x84/0xa0
  ? __switch_to+0x1c1/0x360
  ? finish_task_switch+0x78/0x240
  ? __schedule+0x192/0x496
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_lock_irqsave+0x1a/0x3c
Quoted 8 lines
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
  ? do_wait_intr+0x80/0x80
  ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
  kthread+0x106/0x140
  ? kthread_destroy_worker+0x60/0x60
  ret_from_fork+0x25/0x30
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48 c7 c6

10 2b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 c9 06 e1 <0f> 0b 0f 0b 48 8b 53 20 89 c1 48 c7 c6 48 2b 55 a0 31 c0 45 31

Quoted 1 line
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:

ffffc90001f67c68

Quoted 8 lines
---[ end trace 130de0b7e39d0eea ]---

Best regards,

Alex

Quoted 6 lines

-----Original Message-----
From: Juergen Gross [mailto:[email protected]]
Sent: Friday, 22 December 2017 5:47 PM
To: Alex Braunegg; [email protected]
Cc: Wei Liu; Paul Durrant
Subject: Re: [Xen-devel] [BUG] kernel bug encountered at

drivers/net/xen-netback/netback.c:430!

Quoted 11 lines · Alex Braunegg
Quoted 3 lines

Hi all,

Experienced the same issue again today:

Ccing the maintainers.

Juergen

Quoted 1 line

==========================================================
==================

Quoted 8 lines
Quoted 8 lines

=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x2f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E)

sunrpc(E)

Quoted 1 line
Quoted 1 line

ipmi_si(E) ipmi_msghandler(E) k10temp(E) zfs(POE) zcommon(POE)

znvpair(POE)

Quoted 3 lines
Quoted 3 lines

icp(POE) spl(OE) zavl(POE) zunicode(POE) tpm_infineon(E) sp5100_tco(E) i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E)

ahci(E)

Quoted 5 lines
Quoted 5 lines

libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 12636 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013

task: ffff880062518000 task.stack: ffffc90004f88000

Quoted 8 lines
Quoted 8 lines
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc90004f8bc68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90000fcd000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc90004f8be98 R08: 000000000000037d R09: 000000000000037e
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90000fd6730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007f40c63639a0(0000) GS:ffff88007f400000(0000)

knlGS:0000000000000000

Quoted 20 lines
Quoted 20 lines
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000006375f000 CR4: 0000000000000660
Call Trace:
  ? error_exit+0x5/0x20
  ? __update_load_avg_cfs_rq+0x176/0x180
  ? xen_mc_flush+0x87/0x120
  ? xen_load_sp0+0x84/0xa0
  ? __switch_to+0x1c1/0x360
  ? finish_task_switch+0x78/0x240
  ? __schedule+0x192/0x496
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
  ? do_wait_intr+0x80/0x80
  ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
  kthread+0x106/0x140
  ? kthread_destroy_worker+0x60/0x60
  ? kthread_destroy_worker+0x60/0x60
  ret_from_fork+0x25/0x30
Quoted 8 lines
Quoted 8 lines
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 5b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 99 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 5b 55 a0 31 c0 45 31
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc90004f8bc68
---[ end trace 010682c76619a1bd ]---

==========================================================
==================

Quoted 13 lines
Quoted 13 lines

=========

Best regards,

Alex

-----Original Message-----
From: Alex Braunegg [mailto:[email protected]]
Sent: Thursday, 21 December 2017 8:04 AM
To: '[email protected]'
Subject: [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

Quoted 3 lines
Quoted 3 lines

Hi all,

I experienced the following bug whilst using a Xen VM. What happened

was

Quoted 1 line
Quoted 1 line

that this morning a single Xen VM suddenly terminated without cause

with the

Quoted 4 lines
Quoted 4 lines

following being logged in dmesg.

Only 1 VM experienced an issue (out of 2 which were running), the other remained up and fully functional until I attempted to restart the crashed

VM

Quoted 6 lines
Quoted 6 lines

which triggered the kernel bug.

Kernel: 4.14.6
Xen: 4.8.2

==========================================================
==================

Quoted 8 lines
Quoted 8 lines

=========

vif vif-2-0 vif2.0: Trying to unmap invalid handle! pending_idx: 0x3f

------------[ cut here ]------------
kernel BUG at drivers/net/xen-netback/netback.c:430!
invalid opcode: 0000 [#1] SMP
Modules linked in: xt_physdev(E) iptable_filter(E) ip_tables(E)

xen_netback(E) nfsd(E) lockd(E) grace(E) nfs_acl(E) auth_rpcgss(E)

sunrpc(E)

Quoted 1 line
Quoted 1 line

ipmi_si(E) ipmi_msghandler(E) zfs(POE) zcommon(POE) znvpair(POE)

icp(POE)

Quoted 1 line
Quoted 1 line

spl(OE) zavl(POE) zunicode(POE) k10temp(E) tpm_infineon(E)

sp5100_tco(E)

Quoted 2 lines
Quoted 2 lines

i2c_piix4(E) i2c_core(E) ohci_pci(E) ohci_hcd(E) tg3(E) ptp(E) pps_core(E) sg(E) raid1(E) sd_mod(E) ata_generic(E) pata_acpi(E) pata_atiixp(E)

ahci(E)

Quoted 5 lines
Quoted 5 lines

libahci(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) dax(E)

CPU: 0 PID: 13163 Comm: vif2.0-q0-deall Tainted: P           OE
4.14.6-1.el6.x86_64 #1
Hardware name: HP ProLiant MicroServer, BIOS O41     10/01/2013

task: ffff8800595cc980 task.stack: ffffc900028e0000

Quoted 8 lines
Quoted 8 lines
RIP: e030:xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback]
RSP: e02b:ffffc900028e3c68 EFLAGS: 00010292
RAX: 0000000000000045 RBX: ffffc90002969000 RCX: 0000000000000000
RDX: ffff88007f4146e8 RSI: ffff88007f40db38 RDI: ffff88007f40db38
RBP: ffffc900028e3e98 R08: 000000000000037b R09: 000000000000037c
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc90002972730
R13: 0000160000000000 R14: aaaaaaaaaaaaaaab R15: ffffc9000099bbe8
FS:  00007fee260ff9a0(0000) GS:ffff88007f400000(0000)

knlGS:0000000000000000

Quoted 20 lines
Quoted 20 lines
CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 0000000062815000 CR4: 0000000000000660
Call Trace:
  ? error_exit+0x5/0x20
  ? __update_load_avg_cfs_rq+0x176/0x180
  ? xen_mc_flush+0x87/0x120
  ? xen_load_sp0+0x84/0xa0
  ? __switch_to+0x1c1/0x360
  ? finish_task_switch+0x78/0x240
  ? __schedule+0x192/0x496
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_lock_irqsave+0x1a/0x3c
  ? _raw_spin_unlock_irqrestore+0x11/0x20
  xenvif_dealloc_kthread+0x68/0xf0 [xen_netback]
  ? do_wait_intr+0x80/0x80
  ? xenvif_map_frontend_data_rings+0xe0/0xe0 [xen_netback]
  kthread+0x106/0x140
  ? kthread_destroy_worker+0x60/0x60
  ? kthread_destroy_worker+0x60/0x60
  ret_from_fork+0x25/0x30
Quoted 8 lines
Quoted 8 lines
Code: 89 df 49 83 c4 02 e8 e5 f5 ff ff 4d 39 ec 75 e8 eb a2 48 8b 43 20 48
c7 c6 10 3b 55 a0 48 8b b8 20 03 00 00 31 c0 e8 85 b9 06 e1 <0f> 0b 0f 0b 48
8b 53 20 89 c1 48 c7 c6 48 3b 55 a0 31 c0 45 31
RIP: xenvif_tx_dealloc_action+0x1bb/0x230 [xen_netback] RSP:
ffffc900028e3c68
---[ end trace 7d827dae67002ffc ]---

==========================================================
==================

Quoted 5 lines
Quoted 5 lines

=========

The section of relevant kernel code is:

==========================================================
==================

Quoted 3 lines
Quoted 3 lines

=========

static inline void xenvif_grant_handle_reset(struct xenvif_queue

*queue,

Quoted 11 lines
Quoted 11 lines

u16 pending_idx)

{
         if (unlikely(queue->grant_tx_handle[pending_idx] ==
                      NETBACK_INVALID_HANDLE)) {
                 netdev_err(queue->vif->dev,
                            "Trying to unmap invalid handle! pending_idx:
0x%x\n",
                            pending_idx);
                 BUG();
         }
         queue->grant_tx_handle[pending_idx] =

NETBACK_INVALID_HANDLE;

Quoted 3 lines
Quoted 3 lines

}

==========================================================
==================

Quoted 4 lines
Quoted 4 lines

=========

In an attempt to recover from this situation I restarted / destroyed (xl restart <vmname> / xl destroy <vmname>) the VM to recover it's state

and the

Quoted 3 lines
Quoted 3 lines

following error messages were logged at the console:

==========================================================
==================

Quoted 4 lines
Quoted 4 lines

=========

libxl: error: libxl_exec.c:129:libxl_report_child_exitstatus:
/etc/xen/scripts/block remove [25271] died due to fatal signal

Segmentation

Quoted 2 lines
Quoted 2 lines

fault
libxl: error: libxl_device.c:1080:device_backend_callback: unable to

remove

Quoted 5 lines
Quoted 5 lines

device with path /local/domain/0/backend/vif/2/0
libxl: error: libxl.c:1647:devices_destroy_cb: libxl__devices_destroy failed for 2

Quoted 26 lines

==========================================================
==================

Quoted 4 lines
Quoted 4 lines

=========

After which the physical system hung, then the physical system restarted with nothing else logged and everything came back OK & operational

including

Quoted 19 lines
Quoted 6 lines

the VM that crashed.

Further details (xl dmesg, xl info) attached.

Best regards,

Quoted 8 lines

Alex Braunegg

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#6 lore raw
Quoted 1 line

How easy is it to trigger this? I'm assuming, from the original description, that I can probably trigger it by forcibly terminating a running domain and then trying to restart it.

For me the trigger was just having 2 VM's running and then within 24 hr's one would crash with the debug data sent to console / dmesg. I didn’t have to do anything special to trigger it - nor did I try / attempt to trigger it.

When attempting to restart the crashed VM (using xl) - that’s when I got the additional xl messages & the server rebooted.

Quoted 2 lines

This breaks compilation of xen-netback with older compilers.

Quoted 1 line

From kbuild bot with gcc-4.4.7:

My Xen version (and all packages other packages including the kernel) are built / rebuilt using gcc 4.6.2 so I don’t think I am hitting this gcc issue that the patch fixed.

Best regards,

Alex

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#7 lore raw
In reply to Paul Durrant

## Paul Durrant ([email protected]):

Quoted 3 lines

How easy is it to trigger this? I'm assuming, from the original description, that I can probably trigger it by forcibly terminating a running domain and then trying to restart it.

As Alex said: in the "common cases" (like his and mine) it seems to be enough to run a few DomUs and just wait a little (no special load required) - with my 10 domains, the bg triggers in a few minutes ( https://lists.xenproject.org/archives/html/xen-devel/2017-12/msg01516.html
is my report of the issue - I didn't spot Alex' report).
The order of event here is:
- boot Dom0
- xl create a few DomUs (all recent Linux, all builder=hvm in my setup, each VM has exactly one virtual network interface, all bridged onto the one ethernet interface on the Dom0 which carries all traffic to the Dom0 and the DomUs)
- after a few minutes, the Dom0 kernel logs the BUG() in question
- shortly after (not immediately! - may take even some more minutes) the DomU behind the vif reported in the BUG becomes unresponsive:
no network traffic, no reaction on the virtual console, no message in syslog).
- trying to xl destroy the unresponsive domain (or trying to do a normal shutdown on one of the other domains) results in the corrupted state documented in my earlier report (see link).

In my case this "cannot" be an issue with an old gcc - Debian 9 ships with "gcc (Debian 6.3.0-18) 6.3.0 20170516" (but beware of new bugs, who knows?).

I could try a new kernel (KPTI, yay!) with that "mildly suspicious" commit cc8737a5fe9051b7fa052b08c57ddb9f539c389a reverted on the weekend and report back (just to rule that out - like you, I don't really believe that this is the cause).
For the record, I'm still running 4.13.16 on the Dom0 (that's the last working Dom0 kernel).

Regards,
Christoph

Signature · 6 lines
Spare Space

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#8 lore raw
Quoted 41 lines

-----Original Message-----
From: Christoph Moench-Tegeder [mailto:[email protected]]
Sent: 03 January 2018 20:34
To: Paul Durrant <[email protected]>
Cc: 'Alex Braunegg' <[email protected]>; 'Michael Collins' <[email protected]>; 'Juergen Gross' <[email protected]>; xen- [email protected]; Wei Liu <[email protected]>
Subject: Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen- netback/netback.c:430!

## Paul Durrant ([email protected]):

Quoted 3 lines

How easy is it to trigger this? I'm assuming, from the original description, that I can probably trigger it by forcibly terminating a running domain and then trying to restart it.

As Alex said: in the "common cases" (like his and mine) it seems to be enough to run a few DomUs and just wait a little (no special load required) - with my 10 domains, the bg triggers in a few minutes ( https://lists.xenproject.org/archives/html/xen-devel/2017-
12/msg01516.html
is my report of the issue - I didn't spot Alex' report).
The order of event here is:
- boot Dom0
- xl create a few DomUs (all recent Linux, all builder=hvm in my setup, each VM has exactly one virtual network interface, all bridged onto the one ethernet interface on the Dom0 which carries all traffic to the Dom0 and the DomUs)
- after a few minutes, the Dom0 kernel logs the BUG() in question
- shortly after (not immediately! - may take even some more minutes) the DomU behind the vif reported in the BUG becomes unresponsive:
no network traffic, no reaction on the virtual console, no message in syslog).
- trying to xl destroy the unresponsive domain (or trying to do a normal shutdown on one of the other domains) results in the corrupted state documented in my earlier report (see link).

In my case this "cannot" be an issue with an old gcc - Debian 9 ships with "gcc (Debian 6.3.0-18) 6.3.0 20170516" (but beware of new bugs, who knows?).

Quoted 6 lines

I could try a new kernel (KPTI, yay!) with that "mildly suspicious" commit cc8737a5fe9051b7fa052b08c57ddb9f539c389a reverted on the weekend and report back (just to rule that out - like you, I don't really believe that this is the cause).
For the record, I'm still running 4.13.16 on the Dom0 (that's the last working Dom0 kernel).

Thanks. Well, that's the only netback commit that's in master but not in 4.13.16 so it would be useful to conclusively rule that out as a cause.

Cheers,

Paul

Quoted 6 lines

Regards,
Christoph

--
Spare Space

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#9 lore raw

## Paul Durrant ([email protected]):

Quoted 9 lines
Quoted 6 lines

I could try a new kernel (KPTI, yay!) with that "mildly suspicious" commit cc8737a5fe9051b7fa052b08c57ddb9f539c389a reverted on the weekend and report back (just to rule that out - like you, I don't really believe that this is the cause).
For the record, I'm still running 4.13.16 on the Dom0 (that's the last working Dom0 kernel).

Thanks. Well, that's the only netback commit that's in master but not in 4.13.16 so it would be useful to conclusively rule that out as a cause.

Funny thing: with that commit reverted, I'm running 4.14.12 on my Dom0. That's holding much longer than any 4.4 kernel on that host before. That's interesing, as the crashing code looks more correct (at least for me and some compiler...), and the change is rather small.

Regards,
Christoph

Signature · 6 lines
Spare Space

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#10 lore raw
Quoted 20 lines

-----Original Message-----
From: 'Christoph Moench-Tegeder' [mailto:[email protected]]
Sent: 07 January 2018 22:19
To: Paul Durrant <[email protected]>
Cc: 'Michael Collins' <[email protected]>; 'Juergen Gross' <[email protected]>; Wei Liu <[email protected]>; 'Alex Braunegg' <[email protected]>; [email protected]
Subject: Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen- netback/netback.c:430!

## Paul Durrant ([email protected]):

Quoted 2 lines
Quoted 2 lines

I could try a new kernel (KPTI, yay!) with that "mildly suspicious" commit cc8737a5fe9051b7fa052b08c57ddb9f539c389a reverted on the weekend

and

Quoted 5 lines
Quoted 4 lines

report back (just to rule that out - like you, I don't really believe that this is the cause).
For the record, I'm still running 4.13.16 on the Dom0 (that's the last working Dom0 kernel).

Quoted 8 lines
Quoted 2 lines

Thanks. Well, that's the only netback commit that's in master but not in 4.13.16 so it would be useful to conclusively rule that out as a cause.

Funny thing: with that commit reverted, I'm running 4.14.12 on my Dom0. That's holding much longer than any 4.4 kernel on that host before. That's interesing, as the crashing code looks more correct (at least for me and some compiler...), and the change is rather small.

Yes, that is very strange. Thanks for the info.

Cheers,

Paul

Quoted 5 lines

Regards,
Christoph

--
Spare Space

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#11 lore raw

I finally have a reliable repro and and it's trivial...

Just try to copy a large file out of a Windows VM to an SMB share (using PV drivers in the VM). Dom0 goes bang pretty much immediately. I get another BUG too on another CPU...

[ 1062.422497] ------------[ cut here ]------------
[ 1062.422510] kernel BUG at drivers/net/xen-netback/netback.c:1225!
[ 1062.422518] invalid opcode: 0000 [#2] SMP
[ 1062.422522] Modules linked in: xt_physdev br_netfilter iptable_filter tun nfsv3 nfs_acl rpcsec_gss_krbl
[ 1062.422618]  ahci libahci ehci_pci libata ehci_hcd tg3 megaraid_sas ptp usbcore pps_core scsi_mod libpy
[ 1062.422636] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D W       4.14.0-rc5+ #13
[ 1062.422642] Hardware name: Dell Inc. PowerEdge R730/0H21J3, BIOS 1.5.4 10/002/2015
[ 1062.422649] task: ffffffff81c10480 task.stack: ffffffff81c00000
[ 1062.422659] RIP: 10000e030:xenvif_zerocopy_callback+0x7e/0xc0 [xen_netback]
[ 1062.422666] RSP: e02b:ffff88200e403d28 EFLAGS: 00010012
[ 1062.422672] RAX: 0000000000000240 RBX: ffffc90048a5a260 RCX: 0000000000000100
[ 1062.422678] RDX: 0000000000000540 RSI: ffffc90048a58420 RDI: 0000000000000039
[ 1062.422684] RBP: ffff88200e403d48 R08: 0000000000000000 R09: 0000000000000000
[ 1062.422691] R10: 0000000000000040 R11: ffff881feea1b268 R12: ffffc90048a63810
[ 1062.422697] R13: 0000000000000001 R14: ffffc90048a578e0 R15: ffff882002da4900
[ 1062.422714] FS:  0000000000000000(0000) GS:ffff88200e400000(0000) knlGS:0000000000000000
[ 1062.422721] CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1062.422726] CR2: 00005615b0a0e000 CR3: 0000001fc96c4000 CR4: 0000000000042660
[ 1062.422734] Call Trace:
[ 1062.422738]  <IRQ>
[ 1062.422746]  skb_release_data+0xe4/0x110
[ 1062.422753]  skb_release_all+0x24/0x30
[ 1062.422758]  consume_skb+0x2c/0x90
[ 1062.422765]  __dev_kfree_skb_any+0x2f/0x40
[ 1062.422776]  tg3_poll_work+0x265/0xf20 [tg3]
[ 1062.422783]  ? xenvif_tx_action+0x758/0x8e0 [xen_netback]
[ 1062.422791]  ? __enqueue_entity+0x5c/0x60
[ 1062.422797]  ? enqueue_entity+0x113/0x7b0
[ 1062.422806]  ? tg3_msi_1shot+0x52/0x60 [tg3]
[ 1062.422814]  tg3_poll+0x7e/0x420 [tg3]
[ 1062.422821]  net_rx_action+0x268/0x3e0
[ 1062.422829]  __do_softirq+0x104/0x28f
[ 1062.422837]  irq_exit+0xb6/0xc0
[ 1062.422843]  xen_evtchn_do_upcall+0x30/0x40
[ 1062.422850]  xen_do_hypervisor_callback+0x29/0x40
[ 1062.422855]  </IRQ>

So, I can now start to investigate.

Cheers,

Paul
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#12 lore raw

I have tracked down the problem to multiple calls to the zerocopy callback for the same ubuf_info. I am not sure exactly which patch introduced the issue but my suspicion is that it was one of the the MSG_ZEROCOPY series (see https://marc.info/?l=linux-netdev&m=149807997726733&w=2).
I have a candidate patch to netback to make use of the ubuf_info ref count to handle the multiple callbacks and that certainly fixes the issue for me. I'll post this shortly recommending a backport to stable.

Paul
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#13 lore raw
Quoted 11 lines

-----Original Message-----
From: Xen-devel [mailto:[email protected]] On Behalf Of Paul Durrant
Sent: 10 January 2018 12:52
To: 'Christoph Moench-Tegeder' <[email protected]>
Cc: 'Michael Collins' <[email protected]>; 'Juergen Gross' <[email protected]>; Wei Liu <[email protected]>; 'Alex Braunegg' <[email protected]>; [email protected]
Subject: Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen- netback/netback.c:430!

Quoted 8 lines

I have tracked down the problem to multiple calls to the zerocopy callback for the same ubuf_info. I am not sure exactly which patch introduced the issue but my suspicion is that it was one of the the MSG_ZEROCOPY series (see
https://marc.info/?l=linux-netdev&m=149807997726733&w=2).
I have a candidate patch to netback to make use of the ubuf_info ref count to handle the multiple callbacks and that certainly fixes the issue for me. I'll post this shortly recommending a backport to stable.

Actually no need... The underlying issue was really a bug and has been fixed in 4.14.11. See https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.14.13&id=17155ea827b2fd81330a442ed56d0edafd9969e1

Paul
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#14 lore raw

## Paul Durrant ([email protected]):

Quoted 2 lines

Actually no need... The underlying issue was really a bug and has been fixed in 4.14.11.

Oh. That explains why reverting the other patch "fixed" the problem - I had skipped 4.14.10 and 4.14.11 - and the problem has gone away independently of that.
Cool, I'll try vanilla 4.14.13 really soon now (once I'm home...)

Thanks for the investigation,
Christoph

Signature · 6 lines
Spare Space.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel