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

Bug #2038916 reported by Paul Dooley
148
This bug affects 29 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 ]

Revision history for this message
luca (llucax) wrote (last edit ):

Hi, I'm also affected by this, and rebuilding the package worked.

It seems super silly that this is still open when it is as easy as a rebuild to fix. This issue should be very high priority as it renders the package completely unusable.

In case people want to build the package instead of compiling manually:

```
docker run --rm -ti -v /tmp:/tmp ubuntu:23.10
sed -i 's/# deb-src/deb-src/' /etc/apt/sources.list
apt update
apt install -y dpkg-dev devscripts nano
apt build-dep -y php-apcu
apt source php-apcu
cd php-apcu-5.1.22+4.0.11/ # replace with the version you are using
dch --local local
# ENTER
# Write something in the changelog, like "Fix https://bugs.launchpad.net/ubuntu/+source/php-apcu/+bug/2038916".
# Ctrl-x y ENTER
debuild -us -uc
cp ../*.deb /tmp
exit
```

Now you have the deb files in /tmp. If you are building on the same machine as where you want to install it, you don't need docker, but you'll install a lot of development packages in the process.

Revision history for this message
Stian Skjelstad (mywave) wrote :

After upgrade to Ubuntu 23.10, php8.2-apcu 5.1.22+4.0.11-2build1, this affected me too

Revision history for this message
Craig Wayman (waymo) wrote :

ahhhh, Comment #4 M.B. you've solved my issue that has been lingering for months. Many thanks!

Craig

Revision history for this message
Rgpublic (rgpublic) wrote :

I really wonder why stuff like this isn't fixed for such a long time. Ubuntu wants to be a server distro. PHP - like it or not - is the most important server language. Many major CMS's use APCu for caching etc. This stuff doesn't work, isn't caught by any testing, ends up in the distro and is then ignored for months. Why?

Revision history for this message
Mikko Haiku (haiksu) wrote :

Thanks comment #4!

Revision history for this message
Morten Kjeldgaard (mok0) wrote :

Thanks comment #4, it works. Why hasn't this bug been fixed?

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.