-
Notifications
You must be signed in to change notification settings - Fork 50
Description
We have noticed a problem with the new glibc package version 2.17-326.0.5.el7_9 recently published in Oracle Linux Yum repository: timestamp of the package is June 13, 2023 on the https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/index.html page.
When jemalloc.so library is preloaded, then process crashes in glibc's get_nprocs function. This is reproducible with jemalloc version 3.6.0-1.el7 available from ol7_developer_EPEL repository, as well with custom build of jemalloc version 4.2.0 we use in our environment.
This is easy to reproduce with a basic Oracle Linux 7 container image.
First prepare a recent Oracle Linux 7 container image with latest updates and jemalloc installed:
$ cat Dockerfile
FROM container-registry.oracle.com/os/oraclelinux:7
RUN yum -y clean all && yum -y upgrade
RUN yum -y install oracle-epel-release-el7 && yum -y install jemalloc
Then run a shell in the container and execute any command with jemalloc library preloaded: it would immediately crash:
# LD_PRELOAD=/usr/lib64/libjemalloc.so.1 /usr/bin/true
Segmentation fault (core dumped)
Stacktrace of the crash:
(gdb) bt
#0 0x00007f954ed6e0a4 in get_nprocs () from /lib64/libc.so.6
#1 0x00007f954ed38d1c in sysconf () from /lib64/libc.so.6
#2 0x00007f954f043970 in malloc_init_hard () from /usr/lib64/libjemalloc.so.1
#3 0x00007f954f0450bd in malloc () from /usr/lib64/libjemalloc.so.1
#4 0x00007f954ecfdb8a in strdup () from /lib64/libc.so.6
#5 0x00007f954ea5bec1 in __nptl_tunables_init () from /lib64/libpthread.so.0
#6 0x00007f954ea5bd77 in __pthread_initialize_minimal_internal () from /lib64/libpthread.so.0
#7 0x00007f954ea5a4f1 in _init () from /lib64/libpthread.so.0
#8 0x0000000000000000 in ?? ()
When the glibc package is downgraded to latest known working version 2.17-326.0.3.el7_9, the crash is not reproducible anymore.
We believe it has to do this recent update introducing call to __nptl_tunables_init in nptl/nptl-init.c source file. This change is mentioned in glibc.spec file from the source RPM provided by Oracle at https://oss.oracle.com/ol7/SRPMS-updates/ :
* Fri Apr 21 2023 Cupertino Miranda <cupertino.miranda@oracle.com> - 2.17-326.0.5
- OraBug 35318841 Glibc tunable to disable huge pages on pthread_create stacks
Reviewed-by: Jose E. Marchesi <jose.marchesi@oracle.com>
There is no such problem with Red Hat Enterprise Linux 7, and CentOS 7. Oracle Linux 8 does not seem to be affected either.
We believe its preloading should not lead to crash in glibc library. We do not want to stop using jemalloc library.
It seems also that other users of Linux Oracle 7 are going to hit the same problem as soon as they apply the latest updates.