You are not logged in.

#1 2013-06-22 15:12:34

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

sudo from zsh causes 100 % CPU usage on Arch in Virtualbox [SOLVED]

Just today I attempted to update a virtualized Arch box via `sudo pacman -Syu` and noticed the process seemed to hang.  When I inspected the dmesg on the vbox, I found thousand of lines like below. 

*Note that I can switch users to root and do anything, but when I use sudo to invoke any command, the following happens.
*Note that if I switch to bash and try `sudo pacman -Syu` the operation completes successfully without this explosion of zsh processes.
*Zshell outside of the VM works as expected.

Thoughts are welcomed.  Bug against zsh?  virtualbox? 

...
[   47.614429] [ 1771]  1000  1771     2736      175       7     1238             0 zsh
[   47.614432] [ 1772]  1000  1772     2737      175       7     1238             0 zsh
[   47.614436] [ 1773]  1000  1773     2738      185       7     1238             0 zsh
[   47.614440] [ 1774]  1000  1774     2739      247       7     1238             0 zsh
[   47.614443] [ 1775]  1000  1775     2740      259       7     1238             0 zsh
[   47.614447] [ 1776]  1000  1776     2741      260       7     1238             0 zsh
[   47.614451] [ 1777]  1000  1777     2742      260       7     1238             0 zsh
[   47.614454] [ 1778]  1000  1778     2744      262       7     1238             0 zsh
[   47.614458] [ 1779]  1000  1779     2744      227       7     1238             0 zsh
[   47.614462] Out of memory: Kill process 1778 (zsh) score 5 or sacrifice child
[   47.614554] Killed process 1779 (zsh) total-vm:10976kB, anon-rss:728kB, file-rss:180kB
[   51.056605] zsh invoked oom-killer: gfp_mask=0x2084d0, order=0, oom_score_adj=0
[   51.056612] zsh cpuset=/ mems_allowed=0
[   51.056617] Pid: 1793, comm: zsh Tainted: G           O 3.9.7-1-ARCH #1
[   51.056620] Call Trace:
[   51.056631]  [<c1406b58>] dump_header.isra.10+0x76/0x1d3
[   51.056639]  [<c140a7ad>] ? mutex_unlock+0xd/0x10
[   51.056652]  [<c103f5b8>] ? put_online_cpus+0x48/0x70
[   51.056660]  [<c10baaa0>] ? rcu_oom_notify+0xc0/0xe0
[   51.056667]  [<c10f520b>] oom_kill_process+0x1db/0x310
[   51.056732]  [<c104720c>] ? has_ns_capability_noaudit+0x2c/0x40
[   51.056739]  [<c1047234>] ? has_capability_noaudit+0x14/0x20
[   51.056746]  [<c10f5702>] out_of_memory+0x222/0x260
[   51.056753]  [<c10f989e>] __alloc_pages_nodemask+0x83e/0x850
[   51.056761]  [<c1032aa4>] pte_alloc_one+0x24/0x50
[   51.056770]  [<c111354c>] __pte_alloc+0x1c/0x110
[   51.056777]  [<c1114fb2>] copy_pte_range+0x362/0x450
[   51.056784]  [<c1115187>] copy_page_range+0xe7/0x1f0
[   51.056792]  [<c1039b6b>] dup_mm+0x29b/0x500
[   51.056799]  [<c103ae1d>] copy_process.part.29+0x101d/0x1110
[   51.056806]  [<c103afe5>] do_fork+0x95/0x320
[   51.056814]  [<c120fa08>] ? copy_to_user+0x28/0x40
[   51.056821]  [<c103b335>] sys_clone+0x25/0x30
[   51.056828]  [<c141318d>] sysenter_do_call+0x12/0x28
[   51.056832] Mem-Info:
[   51.056835] DMA per-cpu:
[   51.056839] CPU    0: hi:    0, btch:   1 usd:   0
[   51.056842] CPU    1: hi:    0, btch:   1 usd:   0
[   51.056846] Normal per-cpu:
[   51.056849] CPU    0: hi:  186, btch:  31 usd:  57
[   51.056852] CPU    1: hi:  186, btch:  31 usd:  99
[   51.056857] active_anon:2921 inactive_anon:3039 isolated_anon:0
 active_file:44 inactive_file:119 isolated_file:0
 unevictable:0 dirty:0 writeback:3022 unstable:0
 free:1171 slab_reclaimable:1259 slab_unreclaimable:110282
 mapped:52 shmem:2 pagetables:5274 bounce:0
 free_cma:0
[   51.056863] DMA free:2000kB min:88kB low:108kB high:132kB active_anon:360kB inactive_anon:584kB active_file:0kB inactive_file:20kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15992kB managed:15916kB mlocked:0kB dirty:0kB writeback:580kB mapped:24kB shmem:4kB slab_reclaimable:0kB slab_unreclaimable:12340kB kernel_stack:136kB pagetables:372kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:1806 all_unreclaimable? yes
[   51.056867] lowmem_reserve[]: 0 479 479 479
[   51.056873] Normal free:2684kB min:2752kB low:3440kB high:4128kB active_anon:11324kB inactive_anon:11572kB active_file:176kB inactive_file:456kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:507840kB managed:490856kB mlocked:0kB dirty:0kB writeback:11508kB mapped:184kB shmem:4kB slab_reclaimable:5036kB slab_unreclaimable:428788kB kernel_stack:6552kB pagetables:20724kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:36802 all_unreclaimable? yes
[   51.056876] lowmem_reserve[]: 0 0 0 0
[   51.056881] DMA: 0*4kB 0*8kB 1*16kB (R) 0*32kB 1*64kB (R) 1*128kB (R) 1*256kB (R) 1*512kB (R) 1*1024kB (R) 0*2048kB 0*4096kB = 2000kB
[   51.056888] Normal: 653*4kB (M) 9*8kB (M) 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 2684kB
[   51.056894] 3441 total pagecache pages
[   51.056898] 3242 pages in swap cache
[   51.056901] Swap cache stats: add 36468, delete 33226, find 743/1091
[   51.056904] Free swap  = 393092kB
[   51.056907] Total swap = 511996kB
[   51.057316] 131055 pages RAM
[   51.057319] 0 pages HighMem
[   51.057322] 3272 pages reserved
[   51.057325] 273092 pages shared
[   51.057328] 124964 pages non-shared
[   51.057331] [ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
[   51.057337] [   92]     0    92     7371        0      11       61             0 systemd-journal
[   51.057341] [  110]     0   110     2693        1       5      115         -1000 systemd-udevd
[   51.057345] [  246]     0   246     3052        8       7       95             0 VBoxService
[   51.057349] [  247]     0   247     1199        1       5      131             0 crond
[   51.057353] [  249]     0   249      839        0       4       53             0 systemd-logind
[   51.057357] [  250]    81   250      750       29       4       26          -900 dbus-daemon
[   51.057360] [  266]     0   266      961       58       4       64             0 login
[   51.057364] [  315]    87   315     1362       11       5       85             0 ntpd
[   51.057368] [  389]     0   389     3304        0       7     2617             0 pgld
[   51.057371] [  401]     0   401      988        1       5      152             0 pglcmd.wd
[   51.057375] [  408]     0   408      542        0       4       14             0 sleep
[   51.057379] [  426]  1000   426    14200       52      15      358             0 lxpanel
[   51.057383] [  427]  1000   427    20660       66      18      363             0 pcmanfm
[   51.057387] [  447]  1000   447     1450        0       4       60             0 menu-cached
[   51.057390] [  451]  1000   451     2182       35       6      100             0 VBoxClient
[   51.057394] [  460]  1000   460     2191       25       5      110             0 VBoxClient
[   51.057398] [  464]  1000   464     1918       25       5      106             0 VBoxClient
[   51.057402] [  468]  1000   468     2627       44       7      116             0 VBoxClient
[   51.057405] [  469]     0   469     2545        0       6      162             0 sshd
[   51.057409] [  476]  1000   476     2578        0       6      165             0 sshd
[   51.057413] [  478]  1000   478     1769        7       6      423             0 zsh
[   51.057416] [ 1037]  1000  1037     1769        6       6      423             0 zsh
...

Last edited by graysky (2013-06-30 01:22:26)

Offline

#2 2013-06-29 14:25:00

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: sudo from zsh causes 100 % CPU usage on Arch in Virtualbox [SOLVED]

Spun-up a brand new vbox running x86_64 and am seeing the same problem.  Is anyone else using zsh in a vbox experiencing this?

Offline

#3 2013-06-29 15:32:36

cju
Member
Registered: 2013-06-23
Posts: 194

Re: sudo from zsh causes 100 % CPU usage on Arch in Virtualbox [SOLVED]

Also running zsh in a vbox and nope, I can't confirm this, my dmesg's pretty virgin when it comes to the time after the boot up… I also tried a bunch of commands and didn't experience any hangs at all.

Offline

#4 2013-06-29 17:15:53

Thme
Member
From: Raleigh NC
Registered: 2012-01-22
Posts: 105

Re: sudo from zsh causes 100 % CPU usage on Arch in Virtualbox [SOLVED]

What's your VMs configuration Look like?

 VBoxManage showvminfo "VMNAME"

Also is there anything in the vbox.log for those VMs?
I'm not an expert on Vbox but it sounds like It could either be related to zsh and how it manages memory or to how Vbox manages access to your hardware. What kinda virtualization support do you have enabled on your hardware and in virtualbox?. This might help explain why one persons VM doesn't have this issue and another does(just a guess). Also have you tried downgrading zsh or sudo only to see if it's directy related to a recent package update? Not sure how useful this is...


"Hidden are the ways for those who pass by, for light is perished and darkness comes into being." Nephthys:
Ancient Egyptian Coffin Texts

Offline

#5 2013-06-29 17:24:55

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,725

Re: sudo from zsh causes 100 % CPU usage on Arch in Virtualbox [SOLVED]

Graysky,

Windows 7 host running Arch Linux x86_x64 guest with zsh in urxvt on ObenBox.  Cannot duplicate.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#6 2013-06-30 01:22:07

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: sudo from zsh causes 100 % CPU usage on Arch in Virtualbox [SOLVED]

Thanks for the replies, all.  Turns out one of my functions in ~/.functions got corrupted somehow.  Junk characters inside an if then statement.  Once I corrected it, everything behaves normally.

Offline

Board footer

Powered by FluxBB