Bug 254112

Summary: Linuxulator: glibc's 2.33 with glibc-hwcaps distros breaks compat
Product: Base System Reporter: JavaShin <javashin1986>
Component: kernAssignee: Edward Tomasz Napierala <trasz>
Status: Closed FIXED    
Severity: Affects Only Me CC: dchagin, emaste, trasz
Priority: ---    
Version: Unspecified   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 247219    
Attachments:
Description Flags
ktrace none

Description JavaShin 2021-03-07 20:01:34 UTC
Created attachment 223072 [details]
ktrace

[root@hellbox /compat/suse]# chroot . /bin/bash
/bin/bash: error while loading shared libraries: libreadline.so.8: cannot stat shared object: Invalid argument


Freebsd Verison : 
FreeBSD hellbox 13.0-RC1 FreeBSD 13.0-RC1 #0 releng/13.0-n244639-60e8939aa85: Fri Mar  5 05:01:01 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

Steps to reproduce download a linux container of
Comment 1 JavaShin 2021-03-07 20:11:27 UTC
https://us.images.linuxcontainers.org/images/

Opensuse Tumbleweed And ArchLinux Tested Happens The Same Glibc Version 2.33

On Debian Sid Works Fine Like CentOS C7.

(*) Continue

- mkdir /compat/distro (suse)
- download the rootfs of the distro.
- move to /compat/distro and unpack.

- set fstab with 

devfs           /compat/suse/dev      devfs           rw,late                      0       0
tmpfs           /compat/suse/dev/shm  tmpfs           rw,late,size=1g,mode=1777    0       0
fdescfs         /compat/suse/dev/fd   fdescfs         rw,late,linrdlnk             0       0
linprocfs       /compat/suse/proc     linprocfs       rw,late                      0       0
linsysfs        /compat/suse/sys      linsysfs        rw,late                      0       0

mount /compat/suse/dev ; mount /compat/suse/dev/shm ; mount /compat/suse/dev/fd ; mount /compat/suse/proc ; mount /compat/suse/sys ; cp /etc/resolv.conf etc/resolv.conf ; chroot /compat/suse/ /bin/bash

Error.
/bin/bash: error while loading shared libraries: libreadline.so.8: cannot stat shared object: Invalid argument

Glibc 2.33 incompatibility hwcaps  .

Success. with any distro without glibc 2.33
Comment 2 Edward Tomasz Napierala freebsd_committer freebsd_triage 2021-03-11 12:50:29 UTC
Looks like it's caused by the lack of AT_EMPTY_PATH support for Linux fstatat(2).  The quick and dirty fix is at https://reviews.freebsd.org/D28192.  This also seems to require bumping the kernel version to 4.4.
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-04-16 07:57:22 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=4b45c2bb83a1d7aded0c424d65595cc576760dc7

commit 4b45c2bb83a1d7aded0c424d65595cc576760dc7
Author:     Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2021-04-16 07:52:59 +0000
Commit:     Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2021-04-16 07:56:19 +0000

    linux: make fstatat(2) handle AT_EMPTY_PATH

    Without it, Qt5 apps from Focal fail to start, being unable to load
    their plugins.  It's also necessary for glibc 2.33, as found in recent
    Arch snapshots.

    PR:             254112
    Reviewed By:    kib
    Sponsored by:   The FreeBSD Foundation, EPSRC
    Differential Revision:  https://reviews.freebsd.org/D28192

 sys/compat/linux/linux_stats.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-04-19 11:10:40 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=156da725d3ef6bbafdb0389aada57cf268f44b1e

commit 156da725d3ef6bbafdb0389aada57cf268f44b1e
Author:     Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2021-04-19 10:37:47 +0000
Commit:     Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2021-04-19 10:37:58 +0000

    linux(4): bump osrelease to 4.4.0.

    This is required for the current Arch Linux binaries to work.

    PR:             254112
    Reviewed By:    emaste
    Sponsored By:   EPSRC
    Differential Revision:  https://reviews.freebsd.org/D29218

 sys/compat/linux/linux_mib.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2022-02-17 10:56:02 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8e4ef1c3a3d93811b65be448fb4650786a66a430

commit 8e4ef1c3a3d93811b65be448fb4650786a66a430
Author:     Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2021-04-16 07:52:59 +0000
Commit:     Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2022-02-13 21:06:37 +0000

    linux: make fstatat(2) handle AT_EMPTY_PATH

    Without it, Qt5 apps from Focal fail to start, being unable to load
    their plugins.  It's also necessary for glibc 2.33, as found in recent
    Arch snapshots.

    PR:             254112
    Reviewed By:    kib
    Sponsored by:   The FreeBSD Foundation, EPSRC
    Differential Revision:  https://reviews.freebsd.org/D28192

    (cherry picked from commit 4b45c2bb83a1d7aded0c424d65595cc576760dc7)

 sys/compat/linux/linux_stats.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-06-17 19:42:16 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e226a45a661ac1a44c2afe64b27bc13fee480f6e

commit e226a45a661ac1a44c2afe64b27bc13fee480f6e
Author:     Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2021-04-19 10:37:47 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-17 19:35:42 +0000

    linux(4): bump osrelease to 4.4.0.

    This is required for the current Arch Linux binaries to work.

    PR:             254112
    Reviewed By:    emaste
    Sponsored By:   EPSRC
    Differential Revision:  https://reviews.freebsd.org/D29218

    (cherry picked from commit 156da725d3ef6bbafdb0389aada57cf268f44b1e)

 sys/compat/linux/linux_mib.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 7 Dmitry Chagin freebsd_committer freebsd_triage 2022-07-06 11:07:34 UTC
in stable/13