Skip to content

{Compiling PHP 8.3.1 on RHEL9.3 } {BUG} - cc: fatal error: Killed signal terminated program cc1 #13038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MrDkVV opened this issue Dec 27, 2023 · 9 comments

Comments

@MrDkVV
Copy link

MrDkVV commented Dec 27, 2023

Description

The following steps used to reproduce:

1. Clean server install of RHEL9
2. yum groupinstall "Development Tools"
3. yum install libxml2-devel sqlite-devel
4. ./buildconf
5. ./configure
6. make -j4    <-- failure here

step6.txt

Resulted in this output:

cc: fatal error: Killed signal terminated program cc1
compilation terminated.
make: *** [Makefile:849: ext/fileinfo/libmagic/apprentice.lo] Error 1
make: *** Waiting for unfinished jobs....

But I expected this output instead:

Complete Success ...

PHP Version

php 8.3.1 (downloaded as tar.gz)

Operating System

RHEL 9.3

@MrDkVV
Copy link
Author

MrDkVV commented Dec 27, 2023

Next step would be to make install:

[root@rhel9 php-8.3.1]# make install

[root@rhel9 php-8.3.1]# make install
ext/opcache/minilua /var/tmp/php-8.3.1/ext/opcache/jit/dynasm/dynasm.lua  -D X64=1 -o ext/opcache/jit/zend_jit_x86.c /var/tmp/php-8.3.1/ext/opcache/jit/zend_jit_x86.dasc
/bin/sh /var/tmp/php-8.3.1/libtool --silent --preserve-dup-deps --tag CC --mode=compile cc -Iext/opcache/ -I/var/tmp/php-8.3.1/ext/opcache/ -I/var/tmp/php-8.3.1/include -I/var/tmp/php-8.3.1/main -I/var/tmp/php-8.3.1 -I/var/tmp/php-8.3.1/ext/date/lib -I/usr/include/libxml2 -I/var/tmp/php-8.3.1/TSRM -I/var/tmp/php-8.3.1/Zend  -D_GNU_SOURCE  -fno-common -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS    -Wno-implicit-fallthrough -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DZEND_COMPILE_DL_EXT=1 -c /var/tmp/php-8.3.1/ext/opcache/jit/zend_jit.c -o ext/opcache/jit/zend_jit.lo  -MMD -MF ext/opcache/jit/zend_jit.dep -MT ext/opcache/jit/zend_jit.lo
/bin/sh /var/tmp/php-8.3.1/libtool --silent --preserve-dup-deps --tag CC --mode=link cc -shared -I/var/tmp/php-8.3.1/include -I/var/tmp/php-8.3.1/main -I/var/tmp/php-8.3.1 -I/var/tmp/php-8.3.1/ext/date/lib -I/usr/include/libxml2 -I/var/tmp/php-8.3.1/TSRM -I/var/tmp/php-8.3.1/Zend  -D_GNU_SOURCE  -fno-common -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS     -o ext/opcache/opcache.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/php-8.3.1/modules  ext/opcache/ZendAccelerator.lo ext/opcache/zend_accelerator_blacklist.lo ext/opcache/zend_accelerator_debug.lo ext/opcache/zend_accelerator_hash.lo ext/opcache/zend_accelerator_module.lo ext/opcache/zend_persist.lo ext/opcache/zend_persist_calc.lo ext/opcache/zend_file_cache.lo ext/opcache/zend_shared_alloc.lo ext/opcache/zend_accelerator_util_funcs.lo ext/opcache/shared_alloc_shm.lo ext/opcache/shared_alloc_mmap.lo ext/opcache/shared_alloc_posix.lo ext/opcache/jit/zend_jit.lo ext/opcache/jit/zend_jit_gdb.lo ext/opcache/jit/zend_jit_vm_helpers.lo -lrt
/bin/sh /var/tmp/php-8.3.1/libtool --silent --preserve-dup-deps --tag CC --mode=install cp ext/opcache/opcache.la /var/tmp/php-8.3.1/modules
/bin/sh /var/tmp/php-8.3.1/libtool --silent --preserve-dup-deps --tag CC --mode=compile cc -Iext/fileinfo/ -I/var/tmp/php-8.3.1/ext/fileinfo/ -I/var/tmp/php-8.3.1/include -I/var/tmp/php-8.3.1/main -I/var/tmp/php-8.3.1 -I/var/tmp/php-8.3.1/ext/date/lib -I/usr/include/libxml2 -I/var/tmp/php-8.3.1/TSRM -I/var/tmp/php-8.3.1/Zend  -D_GNU_SOURCE  -fno-common -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS   -I/var/tmp/php-8.3.1/ext/fileinfo/libmagic -c /var/tmp/php-8.3.1/ext/fileinfo/libmagic/apprentice.c -o ext/fileinfo/libmagic/apprentice.lo  -MMD -MF ext/fileinfo/libmagic/apprentice.dep -MT ext/fileinfo/libmagic/apprentice.lo

Also fails with

cc: fatal error: Killed signal terminated program cc1
compilation terminated.
make: *** [Makefile:849: ext/fileinfo/libmagic/apprentice.lo] Error 1

@MrDkVV
Copy link
Author

MrDkVV commented Dec 27, 2023

( i'm no expert, please ensure to provide exact steps to any additional data collection needed. )

@MrDkVV MrDkVV changed the title {Compiling - BUG} - {RHEL9} - cc: fatal error: Killed signal terminated program cc1 {Compiling PHP 8.3.1 on RHEL9 } {BUG} - cc: fatal error: Killed signal terminated program cc1 Dec 27, 2023
@MrDkVV MrDkVV changed the title {Compiling PHP 8.3.1 on RHEL9 } {BUG} - cc: fatal error: Killed signal terminated program cc1 {Compiling PHP 8.3.1 on RHEL9.3 } {BUG} - cc: fatal error: Killed signal terminated program cc1 Dec 27, 2023
@nielsdos
Copy link
Member

nielsdos commented Dec 27, 2023

Since it gets killed while compiling the fileinfo extension, I think you're running into an out-of-memory issue.
Can you confirm whether you hit an out-of-memory condition during compilation?
If so, then this is related: #10422

@MrDkVV
Copy link
Author

MrDkVV commented Dec 27, 2023 via email

@nielsdos
Copy link
Member

How much RAM is in your system.
I also expect something to show up in your dmesg if it's killed by out-of-memory, e.g. dmesg -T | egrep -i 'killed process'.

@crrodriguez
Copy link
Contributor

Your toolchain is using more memory than expected.. this is not a PHP issue.
The most practical/cheaper solution is to add more RAM.
The hard route is to analyze what exactly in the compiler is first using excessive resources and if that is fixable or just have to deal with it.

@MrDkVV
Copy link
Author

MrDkVV commented Jan 4, 2024 via email

@devnexen
Copy link
Member

devnexen commented Jan 9, 2024

Do you need to compile from source or would remi collet's RPM repository works out fine ?

@nielsdos
Copy link
Member

Should be fixed now on master as #65106 is fixed now and this was a duplicate of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants