Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 942912 - dev-lang/php-8.2.24 fails to build with 1 GB of RAM
Summary: dev-lang/php-8.2.24 fails to build with 1 GB of RAM
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-05 09:54 UTC by jlm
Modified: 2024-11-07 18:54 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
compile log (build.log,210.41 KB, text/x-log)
2024-11-05 09:54 UTC, jlm
Details
emerge --info output (emerge.info.txt,5.30 KB, text/plain)
2024-11-05 09:55 UTC, jlm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jlm 2024-11-05 09:54:06 UTC
Created attachment 907942 [details]
compile log

Hi,
I have an obscure 100% reproductible compile issue on my docker image....

ESC[01mESC[Kx86_64-pc-linux-gnu-cc:ESC[mESC[K ESC[01;31mESC[Kfatal error: ESC[mESC[KKilled signal terminated program cc1
compilation terminated.
make: *** [Makefile:698: ext/fileinfo/libmagic/apprentice.lo] Error 1
make: Leaving directory '/var/tmp/portage/dev-lang/php-8.2.24/work/sapis-build/cli'
 ESC[31;01m*ESC[0m ERROR: dev-lang/php-8.2.24::gentoo failed (compile phase):

but looking at the log show no more... why cc1 got terminated? don't know... but it reproduce each time

best regards
Comment 1 jlm 2024-11-05 09:55:55 UTC
Created attachment 907943 [details]
emerge --info output
Comment 2 Mike Gilbert gentoo-dev 2024-11-05 20:17:18 UTC
Check dmesg for any relevant messages.
Comment 3 jlm 2024-11-06 08:11:01 UTC
[32785.512822] systemd-journald[243]: Under memory pressure, flushing caches.
[32787.645992] systemd-journald[243]: Under memory pressure, flushing caches.
[32893.244728] systemd-journald[243]: Under memory pressure, flushing caches.
[32895.378012] systemd-journald[243]: Under memory pressure, flushing caches.
[32923.418669] docker0: port 1(vethca82a3d) entered blocking state
[32923.418676] docker0: port 1(vethca82a3d) entered disabled state
[32923.418691] vethca82a3d: entered allmulticast mode
[32923.418737] vethca82a3d: entered promiscuous mode
[32933.507498] eth0: renamed from veth1e267f5
[32933.508412] docker0: port 1(vethca82a3d) entered blocking state
[32933.508420] docker0: port 1(vethca82a3d) entered forwarding state
[33735.049507] systemd-journald[243]: Under memory pressure, flushing caches.
[33745.950294] cc1 invoked oom-killer: gfp_mask=0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), order=0, oom_score_adj=0
[33745.950309] CPU: 0 UID: 250 PID: 70700 Comm: cc1 Not tainted 6.11.2-arch1-1 #1 6667b52d0e7397e7c0c02157894d188bad0541b5
[33745.950316] Hardware name: OpenStack Foundation OpenStack Compute, BIOS 4.15.4-pre 02/01/2022
[33745.950319] Call Trace:
[33745.950322]  <TASK>
[33745.950326]  dump_stack_lvl+0x5d/0x80
[33745.950337]  dump_header+0x44/0x18d
[33745.950346]  oom_kill_process.cold+0x8/0x8a
[33745.950352]  out_of_memory+0x209/0x500
[33745.950360]  __alloc_pages_slowpath.constprop.0+0xb0a/0xd70
[33745.950366]  __alloc_pages_noprof+0x321/0x350
[33745.950371]  alloc_pages_mpol_noprof+0xd7/0x1c0
[33745.950379]  folio_alloc_mpol_noprof+0x14/0x30
[33745.950384]  vma_alloc_folio_noprof+0x69/0xb0
[33745.950390]  do_anonymous_page+0x33f/0x870
[33745.950395]  ? __pte_offset_map+0x1b/0x180
[33745.950402]  __handle_mm_fault+0xbe7/0x1030
[33745.950406]  ? call_timer_fn+0x27/0x120
[33745.950414]  handle_mm_fault+0xe2/0x2c0
[33745.950418]  do_user_addr_fault+0x217/0x620
[33745.950426]  exc_page_fault+0x81/0x190
[33745.950430]  asm_exc_page_fault+0x26/0x30
[33745.950436] RIP: 0033:0x1b075cf
[33745.950459] Code: 00 00 00 48 89 45 68 77 72 8b 4d 60 49 89 c4 89 c8 83 c1 01 48 c1 e0 05 49 01 c4 4c 89 23 48 8b 55 68 66 0f 6f 14 24 89 4d 60 <0f> 11 14 02 66 0f 6f 5c 24 10 0f 11 5c 02 10 48 8b 03 e9 e5 fe ff
[33745.950462] RSP: 002b:00007ffd6d00f090 EFLAGS: 00010206
[33745.950467] RAX: 0000000005277000 RBX: 0000703d8d625f50 RCX: 0000000000293b81
[33745.950470] RDX: 0000703d85600000 RSI: 0000703d8d600010 RDI: 0000000000000000
[33745.950473] RBP: 0000703dc2382000 R08: 0000000000000000 R09: 0000000000000b6e
[33745.950475] R10: 0000000000ab4c68 R11: 0000703d86877040 R12: 0000703d8a877000
[33745.950477] R13: 0000000000000000 R14: 0000000051471f62 R15: 0000000041c57990
[33745.950483]  </TASK>
[33745.950484] Mem-Info:
[33745.950486] active_anon:84626 inactive_anon:75792 isolated_anon:0
                active_file:3882 inactive_file:11678 isolated_file:0
                unevictable:384 dirty:188 writeback:141
                slab_reclaimable:9261 slab_unreclaimable:13093
                mapped:6077 shmem:400 pagetables:2209
                sec_pagetables:0 bounce:0
                kernel_misc_reclaimable:0
                free:18831 free_pcp:0 free_cma:0
[33745.950495] Node 0 active_anon:338504kB inactive_anon:303168kB active_file:15528kB inactive_file:46712kB unevictable:1536kB isolated(anon):0kB isolated(file):0kB mapped:24308kB dirty:752kB writeback:564kB shmem:1600kB shmem_thp:0kB shmem_pmdmapped:0kB anon_thp:57344kB writeback_tmp:0kB kernel_stack:4768kB pagetables:8836kB sec_pagetables:0kB all_unreclaimable? no
[33745.950502] Node 0 DMA free:788kB boost:2048kB min:2764kB low:2940kB high:3116kB reserved_highatomic:0KB active_anon:4824kB inactive_anon:6880kB active_file:676kB inactive_file:632kB unevictable:0kB writepending:8kB present:15992kB managed:15360kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
[33745.950511] lowmem_reserve[]: 0 924 0 0 0
[33745.950517] Node 0 DMA32 free:74536kB boost:95660kB min:139996kB low:151080kB high:162164kB reserved_highatomic:0KB active_anon:333680kB inactive_anon:296288kB active_file:14852kB inactive_file:46080kB unevictable:1536kB writepending:1308kB present:1023996kB managed:954376kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
[33745.950524] lowmem_reserve[]: 0 0 0 0 0
[33745.950529] Node 0 DMA: 15*4kB (UM) 11*8kB (M) 34*16kB (UM) 1*32kB (M) 1*64kB (M) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 788kB
[33745.950548] Node 0 DMA32: 3635*4kB (UME) 2417*8kB (UME) 1113*16kB (UME) 431*32kB (UME) 106*64kB (UM) 4*128kB (M) 3*256kB (M) 2*512kB (M) 0*1024kB 0*2048kB 0*4096kB = 74564kB
[33745.950569] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
[33745.950572] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[33745.950574] 29848 total pagecache pages
[33745.950576] 13826 pages in swap cache
[33745.950577] Free swap  = 0kB
[33745.950578] Total swap = 524284kB
[33745.950580] 259997 pages RAM
[33745.950581] 0 pages HighMem/MovableOnly
[33745.950582] 17563 pages reserved
[33745.950583] 0 pages cma reserved
[33745.950585] 0 pages hwpoisoned
[33745.950586] Tasks state (memory values in pages):
[33745.950587] [  pid  ]   uid  tgid total_vm      rss rss_anon rss_file rss_shmem pgtables_bytes swapents oom_score_adj name
[33745.950592] [    243]     0   243    27051     2241       64     2175         2   253952      192          -250 systemd-journal
[33745.950600] [    283]     0   283     3572     1080       32     1048         0    69632      192             0 systemd-userdbd
[33745.950605] [    300]     0   300     8466     1204       32     1172         0    90112      608         -1000 systemd-udevd
[33745.950609] [    360]   977   360     5276     1405        0     1405         0    94208      608             0 systemd-resolve
[33745.950613] [    361]   976   361    22258     1187       32     1155         0    86016      192             0 systemd-timesyn
[33745.950617] [    386]    81   386     1792      505       14      491         0    53248      160          -900 dbus-broker-lau
[33745.950622] [    388]     0   388     3724     1270       64     1206         0    73728      192             0 systemd-homed
[33745.950625] [    389]    81   389     1156      637       71      566         0    49152      128          -900 dbus-broker
[33745.950630] [    390]     0   390     3786     1306       64     1242         0    73728      192             0 systemd-logind
[33745.950633] [    398]   980   398     4869     1363       64     1299         0    77824      224             0 systemd-network
[33745.950637] [    408]     0   408     3910      976       32      912        32    73728      512             0 httpd
[33745.950641] [    409]     0   409    65374      951       45      906         0   180224     1824             0 php-fpm
[33745.950645] [    415]     0   415   430727     3727     1601     2126         0   245760     1152          -999 containerd
[33745.950649] [    416]    33   416   190507      890       39      816        35   327680     1408             0 httpd
[33745.950653] [    417]    33   417   190508     1037       71      931        35   323584     1216             0 httpd
[33745.950657] [    418]    33   418   190512     1282      135     1109        38   327680     1280             0 httpd
[33745.950661] [    509]    33   509    65374      411       25      386         0   143360     1856             0 php-fpm
[33745.950665] [    510]    33   510    65374      411       25      386         0   143360     1856             0 php-fpm
[33745.950668] [    550]     0   550   480313     1257      467      790         0   405504     5312          -500 dockerd
[33745.950673] [    553]   969   553     5441      876       32      844         0    81920      672             0 openvpn
[33745.950677] [    559]     0   559     1793      472        0      472         0    49152       32             0 agetty
[33745.950680] [    560]     0   560     1697      459        0      459         0    53248       32             0 agetty
[33745.950684] [    562]     0   562     1697      487        0      487         0    49152       32             0 agetty
[33745.950687] [    582]   969   582     5184      299       25      274         0    69632      416             0 openvpn
[33745.950691] [    802]     0   802     1689      539       32      507         0    57344      160             0 crond
[33745.950695] [    804]     0   804     2033      893       64      829         0    61440      192         -1000 sshd
[33745.950699] [    851]    33   851   190305      824       39      749        36   327680     1024             0 httpd
[33745.950702] [  17765]     0 17765     3634     1137       32     1105         0    73728      384             0 sshd-session
[33745.950706] [  17771]  1000 17771     4773     1472       32     1440         0    81920      448           100 systemd
[33745.950710] [  17773]  1000 17773     5144      456       23      433         0    77824      416           100 (sd-pam)
[33745.950714] [  17780]  1000 17780     3610      819       50      769         0    73728      384             0 sshd-session
[33745.950717] [  17782]  1000 17782     1962      482        0      482         0    53248      160             0 bash
[33745.950721] [  17804]  1000 17804     1689      504       32      472         0    49152       32             0 screen
[33745.950724] [  17805]  1000 17805     1755      454       97      357         0    49152       64             0 screen
[33745.950728] [  17806]  1000 17806     1929      500        0      500         0    45056      160             0 bash
[33745.950731] [  27734]     0 27734     3634     1143       32     1111         0    73728      352             0 sshd-session
[33745.950735] [  27737]  1000 27737     3634      846       67      779         0    73728      384             0 sshd-session
[33745.950738] [  27738]  1000 27738     1962      482        0      482         0    61440      160             0 bash
[33745.950742] [  27747]  1000 27747     4560      756        0      756         0    77824      288             0 sudo
[33745.950745] [  27749]  1000 27749     4560      294       19      275         0    69632      288             0 sudo
[33745.950749] [  27750]     0 27750     2482      646        0      646         0    53248       96             0 su
[33745.950753] [  27752]     0 27752     1929      467        0      467         0    45056      160             0 bash
[33745.950756] [  27981]     0 27981     2572      382       23      359         0    57344      192             0 lxc-start
[33745.950760] [  27982]     0 27982      626       72        0       72         0    45056        0             0 init
[33745.950764] [  28335]     0 28335     1178       27        0       27         0    49152       96             0 login
[33745.950768] [  28337]     0 28337     1230        4        0        4         0    57344      128             0 bash
[33745.950771] [  32477]     0 32477   461264      568       21      547         0   286720     3264          -900 snapd
[33745.950775] [  35121]  1000 35121   442270      437       44      393         0   241664     2368             0 docker
[33745.950779] [  35151]     0 35151   309499      709      690       19         0   118784      768          -998 containerd-shim
[33745.950783] [  35175]     0 35175     1107       27        0       27         0    57344      128             0 bash
[33745.950787] [  35247]     0 35247    84851     1120      907      213         0   274432    22656             0 emerge
[33745.950791] [  56151]     0 56151    60419      196        0      196         0    65536     1504             0 python3.12
[33745.950795] [  56152]     0 56152    60420      198        0      198         0    69632     1504             0 python3.12
[33745.950799] [  56155]   250 56155      630       15        0       15         0    49152       32             0 sandbox
[33745.950802] [  56156]   250 56156    58818       36        0       36         0    65536     1024             0 bash
[33745.950806] [  56177]   250 56177    58861       51       21       30         0    65536     1056             0 bash
[33745.950810] [  56179]   250 56179    58090       34        0       34         0    53248      288             0 bash
[33745.950813] [  56181]   250 56181    58777       59       13       46         0    61440     1312             0 make
[33745.950816] [  59273]     0 59273     3708     1254       64     1190         0    69632      160             0 systemd-userwor
[33745.950820] [  63914]     0 63914     3708     1215       64     1151         0    73728      160             0 systemd-userwor
[33745.950824] [  70529]   250 70529    58320       28        0       28         0    53248      512             0 sh
[33745.950827] [  70699]   250 70699    57959       33        0       33         0    45056       96             0 x86_64-pc-linux
[33745.950830] [  70700]   250 70700   302075   141860   141238      622         0  1871872    73600             0 cc1
[33745.950834] [  70701]   250 70701    58279       25        0       25         0    65536      160             0 as
[33745.950837] [  70720]     0 70720     3708     1326      160     1166         0    77824       64             0 systemd-userwor
[33745.950841] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=docker-9ca714a70e27cb2ae74620d14eb557504373b22b9105d98286b83cd8b116472b.scope,mems_allowed=0,global_oom,task_memcg=/system.slice/docker-9ca714a70e27cb2ae74620d14eb557504373b22b9105d98286b83cd8b116472b.scope,task=cc1,pid=70700,uid=250
[33745.950865] Out of memory: Killed process 70700 (cc1) total-vm:1208300kB, anon-rss:564952kB, file-rss:2488kB, shmem-rss:0kB, UID:250 pgtables:1828kB oom_score_adj:0                                                                                             
[36421.748400] systemd-journald[243]: Under memory pressure, flushing caches.
[36423.881652] systemd-journald[243]: Under memory pressure, flushing caches.
Comment 4 jlm 2024-11-06 08:11:51 UTC
# cat /proc/meminfo 
MemTotal:         969736 kB
MemFree:           90744 kB
MemAvailable:     639492 kB
Buffers:               8 kB
Cached:           659084 kB
SwapCached:        42936 kB
Active:           359144 kB
Inactive:         372620 kB
Active(anon):      52988 kB
Inactive(anon):    21512 kB
Active(file):     306156 kB
Inactive(file):   351108 kB
Unevictable:        1536 kB
Mlocked:               0 kB
SwapTotal:        524284 kB
SwapFree:         423720 kB
Zswap:             11236 kB
Zswapped:          37048 kB
Dirty:               212 kB
Writeback:             0 kB
AnonPages:         58744 kB
Mapped:           165640 kB
Shmem:              1828 kB
KReclaimable:      38380 kB
Slab:              85604 kB
SReclaimable:      38380 kB
SUnreclaim:        47224 kB
KernelStack:        4572 kB
PageTables:         6256 kB
SecPageTables:         0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1009152 kB
Committed_AS:    1977756 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       23224 kB
VmallocChunk:          0 kB
Percpu:              480 kB
HardwareCorrupted:     0 kB
AnonHugePages:      6144 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:     47104 kB
FilePmdMapped:     45056 kB
CmaTotal:              0 kB
CmaFree:               0 kB
Unaccepted:            0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:      114684 kB
DirectMap2M:      925696 kB
DirectMap1G:           0 kB
[root@dolce-energy arch]# cat /proc/swaps 
Filename                                Type            Size            Used            Priority
/swap/swapfile                          file            524284          100564          -2
Comment 5 jlm 2024-11-06 08:19:52 UTC
ok so it got killed by out of memory... I thought it was enough memory there is about 1G mem + 500M swap....

maybe add a mem check to avoid begin the build if not enough memory? I'm surprised that php compilation takes that much memory
Comment 6 Michael Orlitzky gentoo-dev 2024-11-07 18:54:40 UTC
There's a big array in the bundled libmagic that causes the high RAM usage. It was actually fixed in March but it looks like they're targeting PHP 8.4 (coming soon) with it:

  https://github.com/php/php-src/commit/bcd3eec4