php8.2-apcu fails with " undefined symbol: php_strlcpy"

Bug #2038916 reported by Paul Dooley
100
This bug affects 20 people
Affects Status Importance Assigned to Milestone
php-apcu (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

After upgrading to php8.2 with mantic, php8.2-apcu fails with:

PHP Warning: PHP Startup: Unable to load dynamic library 'apcu.so' (tried: /usr/lib/php/20220829/apcu.so (/usr/lib/php/20220829/apcu.so: undefined symbol: php_strlcpy)

Versions:

php-apcu: 5.1.22+4.0.11-2build1
linux: 6.5.0-1005-raspi

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in php-apcu (Ubuntu):
status: New → Confirmed
Revision history for this message
Joseph Yasi (joe-yasi) wrote :

I rebuilt the debian package locally from the debian source and it works now. It looks like this just needs a rebuild.

Revision history for this message
Matthias Nagel (nagmat84) wrote :

Could you post the necessary commands to locally rebuild the package here? I would like to use that workaround as a temporary fix, too.

What happens when the bug is fixed in the repository and a new version comes out? Does apt upgrade to the new package from the repository automatically or does apt keep using the locally build and installed package version? Do I have write an reminder to myself to explicitly switch back to the repository version in the future?

Revision history for this message
M.B. (republique) wrote :

@Matthias Nagel (and interested parties): This worked for me:
#### rebuild php-apcu.so
mkdir apcu
cd apcu
git clone -b ubuntu/mantic https://git.launchpad.net/ubuntu/+source/php-apcu
ls -l
cd php-apcu/apcu-5.1.22
phpize
./configure --enable-apcu
make
make test
### as root
cp modules/apcu.so /usr/lib/php/20220829/
php -version
PHP 8.2.10-2ubuntu1 (cli) (built: Sep 5 2023 14:37:47) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.10, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.10-2ubuntu1, Copyright (c), by Zend Technologies
## works !

Revision history for this message
Bart Groeneveld (bartavi) wrote :

I followed the instructions from @republique, and everything works again for me. Thanks!

One comment though: the size of apcu.so went from 131 KB to 431 KB. So 300 KB extra. Is that to be expected?

In general, I can only hope Ubuntu will push an official rebuild.

Revision history for this message
M.B. (republique) wrote (last edit ):

@bartavi: thanks for pointing out the difference in size!
Keep in mind this is nothing but a temporary fix! The real update is expected (urgently) from Ubuntu.
If due to memory restrictions you need a smaller version, you might want to strip the unneeded symbols from the binary file:

## strip unneeded symbols from apcu.so
### as root
## if you are running apapche2 stop it before proceeding (probably same with nginx)
systemctl stop apache2
cd /usr/lib/php/20220829/
cp apcu.so apcu.so.backup
strip --strip-unneeded ./apcu.so
## to be safe reboot the system !
## if everything is ok you can remove the .backup copy

## sizes are back to normal
ls -l /usr/lib/php/20220829/apcu.so
-rw-r--r-- 1 root root 84K Nov 8 09:57 apcu.so

Revision history for this message
pugelarouge (pugelarouge) wrote :

I had exact same issue with php8.2-oauth
[ https://bugs.launchpad.net/ubuntu/+source/php-oauth/+bug/2043151 ]

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.