Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] libpcre2-8.so.0: cannot open shared object file
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20580

PostPosted: Fri Feb 03, 2023 3:31 am    Post subject: [solved] libpcre2-8.so.0: cannot open shared object file Reply with quote

Solution:
Update from dev-libs/libpcre2-10.42 to dev-libs/libpcre2-10.42-r1
See sam_'s post for an explanation.
Long term fix (for me) will be to update my initrd.

--- Original post below this line ---

I've triaged the issue by manually creating a link, however I'd like to understand what happened if possible, and find a proper solution.
Code:
lrwxrwxrwx 1 root root 19 Feb  2 13:26 /lib64/libpcre2-8.so.0 -> libpcre2-posix.so.3


The error occurred after updates, which included libpcre2 (from dev-libs/libpcre2-10.40-r1.tbz2 to dev-libs/libpcre2-10.42).

This part seems unrelated, however for completeness, I also uninstalled dev-libs/libpcre-8.45-r1. Depclean had been indicating this could be uninstalled for a while. Being suspicios, I delayed doing so until after today's updates.

After the updates, removing that package, and rebooting, the following error was output on the console 17 times:
Code:
grep: error while loading shared libraries: libpcre2-8.so.0: cannot open shared object file: No such file or directory
The boot process didn't complete correctly / normally. Whatever "resets" screen resolution didn't occur, and no wireless network interface was listed.

Reinstalling the binary package libpcre-8.45-r1 didn't help. I then manually created the symlink.

Using "ebuild install", neither libpcre nor libpcre2 image directories contain the missing file (/lib64/libpcre2-8.so.0):
libpcre:
$ ls -lv libpcre-8.45-r1/image/lib64/
total 472
lrwxrwxrwx 1 root root     17 Feb  2 19:43 libpcre.so.1 -> libpcre.so.1.2.13
-rwxr-xr-x 1 root root 481496 Feb  2 19:43 libpcre.so.1.2.13
previous libpcre2:
$ ls -lv libpcre2-10.40-r1/image/lib64/
total 16
lrwxrwxrwx 1 root root    23 Feb  2 19:46 libpcre2-posix.so.3 -> libpcre2-posix.so.3.0.2
-rwxr-xr-x 1 root root 14392 Feb  2 19:46 libpcre2-posix.so.3.0.2
current libpcre2:
$ ls -lv libpcre2-10.42/image/lib64/
total 16
lrwxrwxrwx 1 root root    23 Feb  2 19:48 libpcre2-posix.so.3 -> libpcre2-posix.so.3.0.4
-rwxr-xr-x 1 root root 14392 Feb  2 19:48 libpcre2-posix.so.3.0.4


objdump does reference the file in question, although no directories are specified:
Code:
# objdump -p /bin/grep |grep libpcre
  NEEDED               libpcre2-8.so.0
ldd:
Code:
$ ldd /bin/grep
        linux-vdso.so.1 (0x00007ffeeed2b000)
        libpcre2-8.so.0 => /usr/lib64/libpcre2-8.so.0 (0x00007f9e10de5000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f9e10c15000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9e10ecd000)
The /usr/lib64 files do exist:
Code:
$ ls -lv /usr/lib64/libpcre2-8.so*
lrwxrwxrwx 1 root root     20 Jan 28 22:46 /usr/lib64/libpcre2-8.so -> libpcre2-8.so.0.11.2*
lrwxrwxrwx 1 root root     20 Jan 28 22:46 /usr/lib64/libpcre2-8.so.0 -> libpcre2-8.so.0.11.2*
-rwxr-xr-x 1 root root 637560 Jan 28 22:46 /usr/lib64/libpcre2-8.so.0.11.2*


emerge --info: https://bpa.st/6OEPC
_________________
Quis separabit? Quo animo?


Last edited by pjp on Thu Feb 16, 2023 3:27 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9867
Location: almost Mile High in the USA

PostPosted: Fri Feb 03, 2023 3:47 am    Post subject: Reply with quote

I really hope this isn't something to do with merged /usr - since the library is in /usr and grep is in /bin ... ?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20580

PostPosted: Fri Feb 03, 2023 5:13 am    Post subject: Reply with quote

I have no idea. The previous version, libpcre2-10.40-r1, was installed on Dec 14 and it didn't have any problems. However, it too doesn't show a file in /lib64/ (per ebuild install)

I guess if it were related to usr merge, it would seem to be an issue outside of the package itself, unless 10.40-r1 was changed without a revision bump.

Having thought through that to respond, I see why you're concerned.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2090

PostPosted: Fri Feb 03, 2023 6:13 am    Post subject: Reply with quote

Please keep in mind that if your boot setup relies on split-usr with a separate /usr partition without an initramfs, nobody is really testing this anymore, and you should migrate to either one partition, or use an initramfs. grep is in /bin or so and requires its libraries to be available in /lib* in such a setup, as /usr doesn't exist yet.

None of this is related to merged-usr, only in that merged-usr requires non-split-usr.

I summarise the situation in bug 868306, in particular at https://bugs.gentoo.org/868306#c10.

As for what broke for you:

  • <sys-apps/grep-3.8 used dev-libs/libpcre
  • >=sys-apps/grep-3.8 starts to use dev-libs/libpcre2
  • dev-libs/libpcre[split-usr] installs libpcre to /lib* and puts a linker script in /usr/lib*.
  • dev-libs/libpcre2[split-usr] installs only libpcre2-posix to lib/* and puts a linker script in /usr/lib*. It does not put libpcre2 in there.


This is therefore a bug in the dev-libs/libpcre2 handling of USE=split-usr (which refers to the very specific setup I mention at the start of this reply, it is not the same thing as "not merged-usr") that I'll fix now.

But I strongly advise you read that bug I linked in detail and see why it's not sustainable to keep using your current setup, if I've understood it correctly. Given nobody is testing it properly and the reasons I laid out in that bug, it'd probably be worth exploring a news item for this and declaring it unsupported from some point on, rather than quasi-unsupported like it is now.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20580

PostPosted: Fri Feb 03, 2023 5:38 pm    Post subject: Reply with quote

Thanks, that's more or less it. The only difference being that I have a broken initramfs.

I've been able to exit from the recovery shell with the boot process completing normally. That allowed me to ignore the problem and not have to re-learn how initramfs works.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum