Ubuntu 编译软件时死机

Cat*_*Man 5 swap freeze ram make

我安装了具有 16GB RAM 和 20GB 加密交换空间的 Xubunut16.04。

当我开始一个大型编译时

 configure
 make -j
Run Code Online (Sandbox Code Playgroud)

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

  • 所有核心都达到 100%
  • 内存在大约 20 秒内达到 100%
  • 交换显示保持为零。一旦内存达到 100%,整个电脑就会冻结。我无法通过键盘/鼠标做任何事情。我无法到达另一个航站楼。我无法从另一台电脑通过 ssh 登录。HDD 灯亮并且磁盘正在旋转。

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

我在论坛上阅读了很多内容,找到了有关 Swap 和 cypttab 的提示。从命令中我可以在开始编译之前检查一切都很好。

  • 交换设置只是标准默认设置。命令的UUID与andblkid的内容一致/etc/fstabetc/cypttab
  • 交换似乎已开启

    swapon --show
    NAME..... TYPE.... SIZE USED PRIO
    /dev/sm-0 分区 15.2G 0B ..... -1

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

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

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

sudo nano 
vm.swappiness 40
vm.min_free_kbyptes=240000
Run Code Online (Sandbox Code Playgroud)

这是崩溃的系统日志部分

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            
Run Code Online (Sandbox Code Playgroud)

[...]

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

Cat*_*Man 4

我找到了一种防止系统崩溃的方法(见下文)。但我希望有另一种方法,因为上面的帖子意味着一个简单的用户态命令“make -j”可能会导致整个电脑崩溃。Linux 这样的安全操作系统怎么可能无法阻止这种情况发生呢?

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

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

也许有人可以解释为什么它有效。

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