[Bookworm] PHP 8.2 fails with "Illegal instruction" on ARMv6

Bug #2012833 reported by MichaIng
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Raspbian
Fix Released
Undecided
Unassigned

Bug Description

On Raspbian Bookworm, any invocation of PHP 8.2 fails on ARMv6 RPi models:

# php -v
Illegal instruction

# journalctl -u php8.2-fpm
Mar 26 20:41:06 DietPi systemd[1]: Starting php8.2-fpm.service - The PHP 8.2 FastCGI Process Manager...
Mar 26 20:41:06 DietPi systemd[1]: php8.2-fpm.service: Main process exited, code=killed, status=4/ILL
Mar 26 20:41:06 DietPi systemd[1]: php8.2-fpm.service: Failed with result 'signal'.
Mar 26 20:41:06 DietPi systemd[1]: Failed to start php8.2-fpm.service - The PHP 8.2 FastCGI Process Manager.

It seems to be something in the PHP core, since disabling all modules does not change something. Let me know of some more details, a strace or something like this helps, but probably it is a known issue from earlier PHP versions, requiring some patch for ARMv6.

Best regards,

Micha

Tags: bookworm php
Revision history for this message
MichaIng (michaing) wrote :
Download full text (21.9 KiB)

The issue persists. The binaries btw work well on ARMv7 or QEMU containers (which emulate ARMv7 as well), so it must be some limitation with the ARMv6 instruction set, respectively wrong build flags.

Here a strace from the call, which is not too long:

```
root@Zero:~# php -v
Illegal instruction
root@Zero:~# strace php -v
execve("/usr/bin/php", ["php", "-v"], 0xbe88ade4 /* 13 vars */) = 0
brk(NULL) = 0x104f000
access("/etc/ld.so.preload", R_OK) = 0
openat(AT_FDCWD, "/etc/ld.so.preload", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=54, ...}) = 0
mmap2(NULL, 54, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0xb6f07000
close(3) = 0
readlink("/proc/self/exe", "/usr/bin/php8.2", 4096) = 15
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libarmmem-v6l.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\250\3\0\0004\0\0\0"..., 512) = 512
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=9512, ...}) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f05000
mmap2(NULL, 139308, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ee2000
mmap2(0xb6ef0000, 73772, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0xb6ef0000
munmap(0xb6ee2000, 57344) = 0
munmap(0xb6f03000, 4140) = 0
mprotect(0xb6ef2000, 61440, PROT_NONE) = 0
mmap2(0xb6f01000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0xb6f01000
close(3) = 0
munmap(0xb6f07000, 54) = 0
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=10999, ...}) = 0
mmap2(NULL, 10999, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6eed000
close(3) = 0
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libm.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"..., 512) = 512
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=284116, ...}) = 0
mmap2(NULL, 286828, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6ea6000
mmap2(0xb6eeb000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x44000) = 0xb6eeb000
close(3) = 0
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libxml2.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"..., 512) = 512
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS|STATX_MNT_I...

Revision history for this message
Yannik (yannik-5) wrote :

I can confirm this issue. php8.2-fpm on raspbian bookworm is currently in a non-usable state due to this.

Revision history for this message
Armin Kunaschik (armin-kunaschik) wrote :

I ran into this issue when I updated a Raspberry Pi 1 with pihole installed to bookworm.

Revision history for this message
chatchai jantaraprim (chatchai-j) wrote :

I also got the same problem, after upgrade raspbain pi 1 from bullseye to bookworm.

root@pi01:/usr/bin# php -v
Illegal instruction

Revision history for this message
peter green (plugwash) wrote :

I'm working on it now, I think I know the cause (indeed a wrong build flag). I now need to build and test the results of changing said build flag.

Revision history for this message
peter green (plugwash) wrote :

The fix is now built and tested and should be making it's way to the public repos soon.

Revision history for this message
MichaIng (michaing) wrote :

Many thanks for the fix, we got already news from our users that it is working now!

peter green (plugwash)
Changed in raspbian:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.