Ubuntu 在编译软件时冻结

Ubuntu 在编译软件时冻结

我安装了 Xubunut16.04,配备 16GB RAM 和 20GB 加密交换空间。

当我开始用

 configure
 make -j

在终端中,我可以在面板负载监视器中看到

  • 所有核心都达到 100%
  • 内存在大约 20 秒内达到 100%
  • Swap 显示仍为零。一旦内存达到 100%,整个 PC 就会冻结。我无法通过键盘/鼠标执行任何操作。我无法进入另一个终端。我无法从另一台 PC 通过 ssh 登录。HDD 灯亮起,磁盘正在旋转。

我每次都能重现这种情况。我已经等了 5 个小时,但没有任何变化(它没有撤销)。我需要进行硬重置。

我在论坛上读了很多东西,找到了关于 Swap 和 cypttab 的提示。从命令中,我在开始编译之前可以检查一切正常。

  • Swap 设置只是标准默认设置。命令的 UUID和的blkid内容/etc/fstab一致etc/cypttab
  • 交换似乎已打开

    swapon --show
    名称.....类型....大小使用优先级
    /dev/sm-0 分区 15.2G 0B ..... -1

由于 PC 处于空闲状态,USED=0B 似乎没问题。不知道 PRIO=-1 是否可行。

  • cryptsetup 似乎正在工作 cryptsetup status cryptswap1 /dev/nmapper/cryptswap1 处于活动状态并正在使用 [...]

我尝试设置 vm.min_free_kbyptes 和 vm.swappiness 的值

sudo nano 
vm.swappiness 40
vm.min_free_kbyptes=240000

这是崩溃的系统日志部分

Sep 18 09:54:40 ford2 rtkit-daemon[1668]: Demoted 4 threads.
Sep 18 09:54:40 ford2 rtkit-daemon[1668]: The canary thread is apparently starving. Taking action.
Sep 18 09:54:40 ford2 rtkit-daemon[1668]: Demoting known real-time threads.
Sep 18 09:54:40 ford2 rtkit-daemon[1668]: Successfully demoted thread 1994 of process 1959 (n/a).
Sep 18 09:54:40 ford2 rtkit-daemon[1668]: Successfully demoted thread 1993 of process 1959 (n/a).
Sep 18 09:54:42 ford2 rtkit-daemon[1668]: Successfully demoted thread 1992 of process 1959 (n/a).
Sep 18 09:54:42 ford2 rtkit-daemon[1668]: Successfully demoted thread 1959 of process 1959 (n/a).
Sep 18 09:54:42 ford2 rtkit-daemon[1668]: Demoted 4 threads.
Sep 18 09:55:57 ford2 rtkit-daemon[1668]: The canary thread is apparently starving. Taking action.
Sep 18 09:55:57 ford2 rtkit-daemon[1668]: Demoting known real-time threads.
Sep 18 09:55:58 ford2 rtkit-daemon[1668]: Successfully demoted thread 1994 of process 1959 (n/a).
Sep 18 09:56:02 ford2 rtkit-daemon[1668]: Successfully demoted thread 1993 of process 1959 (n/a).
Sep 18 09:56:05 ford2 rtkit-daemon[1668]: Successfully demoted thread 1992 of process 1959 (n/a).
Sep 18 09:56:05 ford2 rtkit-daemon[1668]: Successfully demoted thread 1959 of process 1959 (n/a).
Sep 18 09:56:05 ford2 rtkit-daemon[1668]: Demoted 4 threads.
Sep 18 09:56:58 ford2 rtkit-daemon[1668]: The canary thread is apparently starving. Taking action.
Sep 18 09:57:23 ford2 rtkit-daemon[1668]: Demoting known real-time threads.
Sep 18 09:57:23 ford2 rtkit-daemon[1668]: Successfully demoted thread 1994 of process 1959 (n/a).
Sep 18 09:57:24 ford2 rtkit-daemon[1668]: Successfully demoted thread 1993 of process 1959 (n/a).
Sep 18 09:57:25 ford2 rtkit-daemon[1668]: Successfully demoted thread 1992 of process 1959 (n/a).
Sep 18 09:57:26 ford2 rtkit-daemon[1668]: Successfully demoted thread 1959 of process 1959 (n/a).
Sep 18 09:57:26 ford2 rtkit-daemon[1668]: Demoted 4 threads.
Sep 18 09:57:27 ford2 rtkit-daemon[1668]: The canary thread is apparently starving. Taking action.
Sep 18 09:58:12 ford2 kernel: [56168.624667] light-locker invoked oom-killer: gfp_mask=0x24201ca, order=0, oom_score_adj=0
Sep 18 09:58:12 ford2 kernel: [56168.624675] light-locker cpuset=/ mems_allowed=0
Sep 18 09:58:12 ford2 kernel: [56168.624687] CPU: 3 PID: 1966 Comm: light-locker Not tainted 4.4.0-124-generic #148-Ubuntu
Sep 18 09:58:12 ford2 kernel: [56168.624695]  0000000000000286 fed8977dd0b815dd ffff88021f0a39f8 ffffffff813ffb53
Sep 18 09:58:12 ford2 kernel: [56168.624701]  ffff88021f0a3bb0 ffff8800cabd9980 ffff88021f0a3a68 ffffffff8120febe
Sep 18 09:58:12 ford2 kernel: [56168.624706]  0000000000000015 0000000000000000 ffff8800cdce8540 ffff8800cb060cc0
Sep 18 09:58:12 ford2 kernel: [56168.624711] Call Trace:
Sep 18 09:58:12 ford2 kernel: [56168.624723]  [<ffffffff813ffb53>] dump_stack+0x63/0x90
Sep 18 09:58:12 ford2 kernel: [56168.624731]  [<ffffffff8120febe>] dump_header+0x5a/0x1c5
Sep 18 09:58:12 ford2 kernel: [56168.624738]  [<ffffffff81397b74>] ? apparmor_capable+0xc4/0x1b0
Sep 18 09:58:12 ford2 kernel: [56168.624744]  [<ffffffff81196512>] oom_kill_process+0x202/0x3c0
Sep 18 09:58:12 ford2 kernel: [56168.624751]  [<ffffffff81196939>] out_of_memory+0x219/0x460
Sep 18 09:58:12 ford2 kernel: [56168.624758]  [<ffffffff8119c985>] __alloc_pages_slowpath.constprop.88+0x965/0xb00
Sep 18 09:58:12 ford2 kernel: [56168.624764]  [<ffffffff8119cda8>] __alloc_pages_nodemask+0x288/0x2a0
Sep 18 09:58:12 ford2 kernel: [56168.624772]  [<ffffffff811e699c>] alloc_pages_current+0x8c/0x110
Sep 18 09:58:12 ford2 kernel: [56168.624777]  [<ffffffff81192a2b>] __page_cache_alloc+0xab/0xc0
Sep 18 09:58:12 ford2 kernel: [56168.624781]  [<ffffffff81194fb0>] filemap_fault+0x150/0x400
Sep 18 09:58:12 ford2 kernel: [56168.624787]  [<ffffffff812a80a6>] ext4_filemap_fault+0x36/0x50
Sep 18 09:58:12 ford2 kernel: [56168.624792]  [<ffffffff811c1c66>] __do_fault+0x56/0xf0
Sep 18 09:58:12 ford2 kernel: [56168.624797]  [<ffffffff811c5a55>] handle_mm_fault+0xfa5/0x1820
Sep 18 09:58:12 ford2 kernel: [56168.624803]  [<ffffffff8106c7a1>] __do_page_fault+0x1a1/0x410
Sep 18 09:58:12 ford2 kernel: [56168.624808]  [<ffffffff8106ca32>] do_page_fault+0x22/0x30
Sep 18 09:58:12 ford2 kernel: [56168.624814]  [<ffffffff81852158>] page_fault+0x28/0x30
Sep 18 09:58:12 ford2 kernel: [56168.624849] Mem-Info:
Sep 18 09:58:12 ford2 kernel: [56168.624861] active_anon:1647527 inactive_anon:296577 isolated_anon:0
Sep 18 09:58:12 ford2 kernel: [56168.624861]  active_file:1668 inactive_file:1450 isolated_file:0
Sep 18 09:58:12 ford2 kernel: [56168.624861]  unevictable:57 dirty:0 writeback:19 unstable:0
Sep 18 09:58:17 ford2 kernel: [56168.624861]  slab_reclaimable:7188 slab_unreclaimable:11454
Sep 18 09:58:17 ford2 kernel: [56168.624861]  mapped:2157 shmem:1828 pagetables:29068 bounce:0
Sep 18 09:58:17 ford2 kernel: [56168.624861]  free:25993 free_pcp:780 free_cma:0
Sep 18 09:58:17 ford2 kernel: [56168.624870] Node 0 DMA free:15864kB min:132kB low:164kB high:196kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15992kB managed:15904kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:8kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
Sep 18 09:58:17 ford2 kernel: [56168.624883] lowmem_reserve[]: 0 3128 7863 7863 7863
Sep 18 09:58:26 ford2 kernel: [56168.624889] Node 0 DMA32 free:45676kB min:26832kB low:33540kB high:40248kB active_anon:2633248kB inactive_anon:526780kB active_file:412kB inactive_file:816kB unevictable:116kB isolated(anon):0kB isolated(file):0kB present:3391040kB managed:3310296kB mlocked:116kB dirty:0kB writeback:16kB mapped:852kB shmem:924kB slab_reclaimable:10092kB slab_unreclaimable:17304kB kernel_stack:6368kB pagetables:46868kB unstable:0kB bounce:0kB free_pcp:1888kB local_pcp:124kB free_cma:0kB writeback_tmp:0kB pages_scanned:7516 all_unreclaimable? yes
Sep 18 09:58:26 ford2 kernel: [56168.624902] lowmem_reserve[]: 0 0 4734 4734 4734
Sep 18 09:58:26 ford2 kernel: [56168.624907] Node 0 Normal free:42432kB min:40612kB low:50764kB high:60916kB active_anon:3956860kB inactive_anon:659528kB active_file:6260kB inactive_file:4984kB unevictable:112kB isolated(anon):0kB isolated(file):0kB present:4980736kB managed:4848744kB mlocked:112kB dirty:0kB writeback:60kB mapped:7776kB shmem:6388kB slab_reclaimable:18660kB slab_unreclaimable:28504kB kernel_stack:10384kB pagetables:69404kB unstable:0kB bounce:0kB free_pcp:1232kB local_pcp:140kB free_cma:0kB writeback_tmp:0kB pages_scanned:227604 all_unreclaimable? yes
Sep 18 09:58:26 ford2 kernel: [56168.624919] lowmem_reserve[]: 0 0 0 0 0
Sep 18 09:58:26 ford2 kernel: [56168.624924] Node 0 DMA: 0*4kB 1*8kB (U) 1*16kB (U) 1*32kB (U) 1*64kB (U) 1*128kB (U) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB (M) = 15864kB
Sep 18 09:58:30 ford2 kernel: [56168.624946] Node 0 DMA32: 401*4kB (UE) 645*8kB (UME) 536*16kB (UME) 212*32kB (UME) 48*64kB (UME) 20*128kB (UME) 16*256kB (UE) 5*512kB (UE) 1*1024kB (E) 1*2048kB (M) 2*4096kB (U) = 45676kB
Sep 18 09:58:30 ford2 kernel: [56168.624970] Node 0 Normal: 772*4kB (UMEH) 1090*8kB (UMEH) 830*16kB (UMEH) 234*32kB (UMEH) 66*64kB (UEH) 22*128kB (UMEH) 7*256kB (UME) 2*512kB (EH) 0*1024kB 0*2048kB 0*4096kB = 42432kB
Sep 18 09:58:30 ford2 kernel: [56168.624994] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
Sep 18 09:58:30 ford2 kernel: [56168.624998] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
Sep 18 09:58:30 ford2 kernel: [56168.625000] 7717 total pagecache pages
Sep 18 09:58:35 ford2 kernel: [56168.625003] 2702 pages in swap cache
Sep 18 09:58:35 ford2 kernel: [56168.625007] Swap cache stats: add 14088781, delete 14086079, find 3056376/5582411
Sep 18 09:58:35 ford2 kernel: [56168.625009] Free swap  = 0kB
Sep 18 09:58:35 ford2 kernel: [56168.625011] Total swap = 20510716kB
Sep 18 09:58:35 ford2 kernel: [56168.625014] 2096942 pages RAM
Sep 18 09:58:38 ford2 kernel: [56168.625016] 0 pages HighMem/MovableOnly
Sep 18 09:58:38 ford2 kernel: [56168.625019] 53206 pages reserved
Sep 18 09:58:38 ford2 kernel: [56168.625021] 0 pages cma reserved
Sep 18 09:58:38 ford2 kernel: [56168.625023] 0 pages hwpoisoned
Sep 18 09:58:38 ford2 kernel: [56168.625025] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name
Sep 18 09:58:38 ford2 kernel: [56168.625046] [ 1059]     0  1059    69355       99      38       3      112             0 accounts-daemon
Sep 18 09:58:48 ford2 kernel: [56168.625052] [ 1062]     0  1062   103381       67      68       3      387             0 ModemManager
Sep 18 09:58:48 ford2 kernel: [56168.625077] [ 1104]     0  1104     1099        0       8       3       50             0 acpid
Sep 18 09:58:55 ford2 kernel: [56168.625083] [ 1106]   111  1106    11195       27      27       3       68             0 avahi-daemon
Sep 18 09:58:55 ford2 kernel: [56168.625088] [ 1107]     0  1107    23850            

[...]

Sep 18 10:00:44 ford2 kernel: [56168.627949] [ 3801]  1000  3801     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.627954] [ 3803]  1000  3803    48520    11667      93       3    21663             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.627959] [ 3804]  1000  3804     2441        0      11       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.627964] [ 3805]  1000  3805     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.627969] [ 3806]  1000  3806     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.627975] [ 3807]  1000  3807    46475     8719      89       3    22246             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.627980] [ 3808]  1000  3808    48535    11847      91       4    21548             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.627985] [ 3809]  1000  3809     2441        0      11       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.627990] [ 3810]  1000  3810     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.627995] [ 3811]  1000  3811     1127        0       9       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628001] [ 3812]  1000  3812    48022    11486      92       3    21376             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628006] [ 3813]  1000  3813     2441        0      10       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628011] [ 3814]  1000  3814     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628017] [ 3815]  1000  3815    48533    11461      92       3    21706             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628022] [ 3816]  1000  3816     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628027] [ 3817]  1000  3817     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628032] [ 3818]  1000  3818    58765    15503     109       3    27247             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628038] [ 3819]  1000  3819     2441        0      10       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628043] [ 3820]  1000  3820     1127        0       7       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628048] [ 3821]  1000  3821     2441        0      10       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628173] [ 3846]  1000  3846     2441        0      11       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628179] [ 3848]  1000  3848    47513     9847      91       3    22204             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628184] [ 3849]  1000  3849     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628189] [ 3850]  1000  3850    48672    11175      92       3    22321             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628194] [ 3851]  1000  3851     1127        0       8       3       28             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628199] [ 3852]  1000  3852     1127        0       8       3       28             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628205] [ 3854]  1000  3854     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628210] [ 3855]  1000  3855    48538    11944      91       3    21768             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628215] [ 3856]  1000  3856     2441        0       9       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628221] [ 3857]  1000  3857    47512    10124      90       3    22093             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628241] [ 3864]  1000  3864    46486     9017      87       3    22082             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628247] [ 3865]  1000  3865    47509    10419      89       3    21974             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628252] [ 3867]  1000  3867    46997     9688      88       4    22206             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628257] [ 3868]  1000  3868     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628262] [ 3869]  1000  3869     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628268] [ 3874]  1000  3874     2441        0      10       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628273] [ 3876]  1000  3876     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628278] [ 3877]  1000  3877    49072    12189      95       4    21509             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628283] [ 3880]  1000  3880     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628288] [ 3882]  1000  3882    46479     9303      88       4    22071             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628294] [ 3883]  1000  3883     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628299] [ 3884]  1000  3884     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628304] [ 3886]  1000  3886     2441        0      10       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628310] [ 3887]  1000  3887    49075    12341      93       3    21515             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628315] [ 3888]  1000  3888     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628320] [ 3889]  1000  3889     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628325] [ 3891]  1000  3891    48010    10615      92       3    22011             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628331] [ 3893]  1000  3893     2440        0      10       3       44             0 gcc
Sep 18 10:00:44 ford2 kernel: [56168.628336] [ 3894]  1000  3894    48033    10792      92       3    21894             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628341] [ 3896]  1000  3896     1127        0       8       3       28             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628346] [ 3897]  1000  3897    21198     2969      44       4     6286             0 cc1
Sep 18 10:00:44 ford2 kernel: [56168.628351] [ 3898]  1000  3898     1127        0       8       4       28             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628357] [ 3900]  1000  3900     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628362] [ 3901]  1000  3901     1127        0       7       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628367] [ 3903]  1000  3903     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628373] [ 3905]  1000  3905    47073    11599      88       3    19226             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628378] [ 3906]  1000  3906     1127        0       8       3       28             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628383] [ 3907]  1000  3907     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628388] [ 3908]  1000  3908     1127        0       9       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628394] [ 3909]  1000  3909    47026    11122      87       3    19366             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628399] [ 3911]  1000  3911     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628404] [ 3912]  1000  3912    46519     9958      84       3    19861             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628409] [ 3913]  1000  3913     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628414] [ 3915]  1000  3915    46539    10833      86       3    19522             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628420] [ 3919]  1000  3919    59286     8869     111       4    33738             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628425] [ 3952]  1000  3952     1127        0       9       3       28             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628430] [ 3956]  1000  3956     1127        0       8       4       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628436] [ 3957]  1000  3957     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628441] [ 3960]  1000  3960     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628446] [ 3966]  1000  3966    59283     9602     113       3    33248             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628452] [ 3967]  1000  3967    59289     9509     111       3    33594             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628457] [ 3982]  1000  3982     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628462] [ 3984]  1000  3984     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628468] [ 3986]  1000  3986     1127        0       7       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628473] [ 3987]  1000  3987     2441        0      10       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628478] [ 3990]  1000  3990     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628483] [ 3992]  1000  3992     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628488] [ 3993]  1000  3993     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628494] [ 3994]  1000  3994    59285     9008     111       3    33644             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628499] [ 3996]  1000  3996     2441        0      10       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628504] [ 3999]  1000  3999    59301     9391     109       3    33475             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628510] [ 4001]  1000  4001    59281     8959     112       4    33768             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628515] [ 4004]  1000  4004     1127        0       9       3       28             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628520] [ 4005]  1000  4005    58777     8739     111       4    33915             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628526] [ 4011]  1000  4011     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628531] [ 4015]  1000  4015    58757     9086     109       3    33590             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628536] [ 4019]  1000  4019     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628542] [ 4025]  1000  4025     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628547] [ 4028]  1000  4028     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628552] [ 4029]  1000  4029    59811    11133     113       3    31966             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628558] [ 4032]  1000  4032     2441        0      10       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628563] [ 4036]  1000  4036    58770     8511     109       3    33979             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628568] [ 4039]  1000  4039     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628573] [ 4041]  1000  4041     2441        0      10       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628579] [ 4042]  1000  4042     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628584] [ 4045]  1000  4045    58779     8157     110       3    34222             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628589] [ 4046]  1000  4046     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628595] [ 4051]  1000  4051    59295     9425     109       3    33478             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628616] [ 4298]  1000  4298     1127        0       8       3       28             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628621] [ 4304]  1000  4304     2441        0      10       3       46             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628626] [ 4308]  1000  4308    48101    12883      89       3    18580             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628632] [ 4443]  1000  4443     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628637] [ 4446]  1000  4446     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628642] [ 4453]  1000  4453    57042    23488     105       3    17021             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628647] [ 4463]  1000  4463     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628652] [ 4464]  1000  4464     2441        0      11       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628658] [ 4465]  1000  4465    48102    13613      86       3    18375             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628663] [ 4490]  1000  4490     1127        0       8       3       29             0 bk-deps
Sep 18 10:00:44 ford2 kernel: [56168.628668] [ 4501]  1000  4501     2441        0      10       3       45             0 g++
Sep 18 10:00:44 ford2 kernel: [56168.628674] [ 4553]  1000  4553    67589    36699     126       3    14622             0 cc1plus
Sep 18 10:00:44 ford2 kernel: [56168.628679] [ 5426]     0  5426    10959      256      22       3      391             0 systemd-journal
Sep 18 10:00:44 ford2 kernel: [56168.628685] [ 6503]     0  6503   131354     2703     140       3        8             0 Xorg
Sep 18 10:00:44 ford2 kernel: [56168.628691] [ 6670]     0  6670     7160      104      19       3        0             0 systemd-logind
Sep 18 10:00:44 ford2 kernel: [56168.628697] [ 6672]     0  6672    11199      225      22       3        1         -1000 systemd-udevd
Sep 18 10:00:44 ford2 kernel: [56168.628702] [ 6693]  1000  6693    27988     4938      59       3        2             0 apt-check
Sep 18 10:00:44 ford2 kernel: [56168.628708] [ 6806]     0  6806     4317       47      14       3        0             0 anacron
Sep 18 10:00:44 ford2 kernel: [56168.628714] [ 6841]     0  6841     1126       17       8       3        0             0 sh
Sep 18 10:00:44 ford2 kernel: [56168.628719] [ 6842]     0  6842     1091       26       8       3        0             0 run-parts
Sep 18 10:00:44 ford2 kernel: [56168.628725] [ 7108]   121  7108    16869      111      25       3        0             0 pickup
Sep 18 10:00:44 ford2 kernel: [56168.628730] [ 7149]     0  7149     3513       53      12       3        0             0 mlocate
Sep 18 10:00:44 ford2 kernel: [56168.628736] [ 7158]     0  7158     3265       22      12       3        0             0 flock
Sep 18 10:00:44 ford2 kernel: [56168.628741] [ 7159]     0  7159     2209       48      10       3        0             0 updatedb.mlocat
Sep 18 10:00:44 ford2 kernel: [56168.628747] [ 7176]     0  7176    61164      233      54       3        0             0 lightdm
Sep 18 10:00:44 ford2 kernel: [56168.628752] [ 7215]   108  7215     1126       17       8       3        0             0 lightdm-greeter
Sep 18 10:00:44 ford2 kernel: [56168.628758] [ 7222]   108  7222     1549       10       7       3        0             0 dbus-launch
Sep 18 10:00:44 ford2 kernel: [56168.628762] Out of memory: Kill process 4553 (cc1plus) score 7 or sacrifice child
Sep 18 10:00:44 ford2 kernel: [56168.628777] Killed process 4553 (cc1plus) total-vm:270356kB, anon-rss:146796kB, file-rss:0kB
Sep 18 10:13:17 ford2 rtkit-daemon[1668]: Demoting known real-time threads.
Sep 18 10:18:09 ford2 kernel: [57377.534222] apport invoked oom-killer: gfp_mask=0x24201ca, order=0, oom_score_adj=0
Sep 18 10:18:22 ford2 kernel: [57377.534231] apport cpuset=/ mems_allowed=0
Sep 18 10:18:22 ford2 kernel: [57377.534242] CPU: 3 PID: 7237 Comm: apport Not tainted 4.4.0-124-generic #148-Ubuntu
Sep 18 10:18:22 ford2 kernel: [57377.534251]  0000000000000286 23f3f2bd8e876696 ffff88009fac79f8 ffffffff813ffb53
Sep 18 10:18:22 ford2 kernel: [57377.534257]  ffff88009fac7bb0 ffff8801de91a640 ffff88009fac7a68 ffffffff8120febe
Sep 18 10:18:22 ford2 kernel: [57377.534262]  0000000000000015 0000000000000000 ffff8800cdce8540 ffff8800cb060cc0
Sep 18 10:18:22 ford2 kernel: [57377.534267] Call Trace:
Sep 18 10:18:22 ford2 kernel: [57377.534279]  [<ffffffff813ffb53>] dump_stack+0x63/0x90
Sep 18 10:18:22 ford2 kernel: [57377.534287]  [<ffffffff8120febe>] dump_header+0x5a/0x1c5
Sep 18 10:18:22 ford2 kernel: [57377.534294]  [<ffffffff81397b74>] ? apparmor_capable+0xc4/0x1b0
Sep 18 10:18:22 ford2 kernel: [57377.534301]  [<ffffffff81196512>] oom_kill_process+0x202/0x3c0
Sep 18 10:18:22 ford2 kernel: [57377.534306]  [<ffffffff81196939>] out_of_memory+0x219/0x460
Sep 18 10:18:22 ford2 kernel: [57377.534313]  [<ffffffff8119c985>] __alloc_pages_slowpath.constprop.88+0x965/0xb00
Sep 18 10:18:22 ford2 kernel: [57377.534320]  [<ffffffff8119cda8>] __alloc_pages_nodemask+0x288/0x2a0

我该怎么办?Ubuntu 安装这么容易崩溃,这正常吗?使用用户权限崩溃?

答案1

我找到了一种防止系统崩溃的方法(见下文)。但我希望还有其他方法,因为上面的帖子意味着一个简单的用户空间命令“make -j”就可能导致整个 PC 崩溃。为什么像 Linux 这样安全的操作系统却无法防止这种情况发生?

当我执行以下操作时系统不会崩溃:

  1. 从文本控制台编译(ctrl-alt-f1)
  2. 将变量 TEMPDIR 更改为磁盘上的路径
mkdir /home/username/tmp
export TEMPDIR=home/username/tmp

也许有人可以解释为什么这样做有效。

[更新]:它能工作,但只是有点。当使用例如“make -j4”时,系统速度会快得多,因为在运行无限作业时,所有这些缓存、任务终止都被省略了。运行上述更改后,系统不会崩溃,但对于其他用户或同一用户的其他终端来说,系统会严重停滞。

相关内容