Bug #96509 Missing library on Solaris 11.3
Submitted: 12 Aug 2019 12:39 Modified: 13 Aug 2019 23:11
Reporter: Brad Viviano Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.0.17 OS:Solaris (11.3)
Assigned to: MySQL Verification Team CPU Architecture:SPARC (T5-2)

[12 Aug 2019 12:39] Brad Viviano
Description:
We just downloaded the 8.0.17 community version tar.gz for Solaris SPARC to get access to newer client libraries then the 5.5 release that is available via the "pkg" repositories provided by Oracle.

When attempting to use the mysql binary, I get the following error:

root@hostname:/opt/src/mysql-8.0.17-solaris11-sparc-64bit/bin# ./mysql
ld.so.1: mysql: fatal: libstatomic.so.1: open failed: No such file or directory
Killed

The only similar discussion I found to this was on BUG ID 91735

https://bugs.mysql.com/bug.php?id=91735

But there was no clear resolution, other then to install the developer tools.  

We don't have a license for developer studio as we're not trying to compile MySQL, just use the MySQL.com provided binaries for Solaris.

Any attempt to locate the missing libstatomic.so.1 package via "pkg search" comes up with nothing and it doesn't seem to be included in the tar.gz file downloaded from mysql.com.

If the Solaris version of MySQL 8 requires libstatomic.so.1 and it is only available to people with a DevStudio license, then that library should be included in the package/tar.gz.

How to repeat:
Download latest tar.gz bundle for Solaris from mysql.com

Extract it on any system that doesn't have the DevStudio compilers installed

Attempt to run "bin/mysql --version"

Suggested fix:
Three options:

1) If possible, remove the dependency on libstatomic.so.1 in the pre-compiled binaries.

2) If libstatomic.so.1 is actually available via a runtime package that doesn't require a license for DevStudio and can be installed via "pkg", then clearly document that someplace as a dependency in the README.

3) Provide libstatomic.so.1 in the "lib" directory of the distribution.
[12 Aug 2019 13:10] Brad Viviano
Found this link on Oracle.com:

https://docs.oracle.com/cd/E60778_01/html/E60746/gqhbq.html

"Oracle Developer Studio 12.5 compilers support atomics with a new runtime library called libstatomic.so. This library is bundled with the Oracle Developer Studio release, and is not included in Oracle Solaris or Oracle Linux."

"The bundled atomics library libstatomic.so is fully supported as a part of the Oracle Developer Studio product. You can deploy an application that uses the library, but you need to include the library unless the application will run on a system where Oracle Developer Studio is installed."

Can someone on the mysql.com side please provide the libstatomic.so.1 library and make sure to include it in future releases.  This is clearly something I as an end user, without access to Developer Studio, can not resolve myself.
[13 Aug 2019 5:54] MySQL Verification Team
Hi,

Here: https://docs.oracle.com/cd/E60778_01/html/E60743/gozsu.html 

you can see how to install only the runtime libraries. Have you tried it? As far as I know the libstatomic.so is part of the run-time package.

all best
Bogdan
[13 Aug 2019 11:01] Brad Viviano
As detailed in my opening case notes, I went through all the linked documents from BUG ID 91735 before opening my case.  My organization has a platinum level support contract with Oracle on Solaris, but we have no licenses for Developer Studio, we are end users of the OS, not developers.

As a standard Solaris user with OS support I do not appear to have access to anything Developer Studio Related:

root@onyx9:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F https://pkg.oracle.com/solaris/support/

root@onyx9:~# pkg install --accept developerstudio-125/library/c++-libs \
> developerstudio-125/library/c-libs \
> developerstudio-125/library/f90-libs \
> developerstudio-125/library/math-libs \
> developerstudio-125/library/perflib \
> developerstudio-125/library/studio-gccrt 

pkg install: The following pattern(s) did not match any allowable packages.  Try
using a different matching pattern, or refreshing publisher information:

        developerstudio-125/library/c++-libs
        developerstudio-125/library/c-libs
        developerstudio-125/library/perflib
        developerstudio-125/library/f90-libs
        developerstudio-125/library/studio-gccrt
        developerstudio-125/library/math-libs

root@onyx9:~# pkg set-publisher \
> -k /var/pkg/ssl/pkg.oracle.com.key.pem \
> -c /var/pkg/ssl/pkg.oracle.com.certificate.pem \
> -G '*' -g https://pkg.oracle.com/solarisstudio/release solarisstudio
pkg set-publisher: Could not refresh the catalog for solarisstudio
   
https protocol error: code: 401 reason: Unauthorized
URL: 'https://pkg.oracle.com/solarisstudio/release/solarisstudio/catalog/1/catalog.attrs';

I did install system/library/studio-runtime, but it doesn't appear to contain any actual files:

root@onyx9:~# pkg contents system/library/studio-runtime
pkg: This package delivers no filesystem content, but may contain metadata. Use
the -o option to specify fields other than 'path', or use the -m option to show
the raw package manifests.

root@onyx9:~# pkg contents -m system/library/studio-runtime
set name=pkg.fmri value=pkg://solaris/system/library/studio-runtime@0.5.11,5.11-0.175.3.3.0.2.0:20151117T031646Z
set name=variant.arch value=i386 value=sparc
set name=info.classification value=org.opensolaris.category.2008:Development/C value=org.opensolaris.category.2008:Development/C++ value=org.opensolaris.category.2008:Development/Fortran value="org.opensolaris.category.2008:Meta Packages/Group Packages"
set name=pkg.description value="Runtime support libraries for applications built using Oracle Solaris Studio"
set name=pkg.summary value="Runtime Support For Oracle Solaris Studio"
set name=org.opensolaris.consolidation value=sunpro
depend fmri=system/library/sunperf type=group
depend fmri=consolidation/sunpro/sunpro-incorporation type=require
depend fmri=system/library/openmp type=group
depend fmri=system/library/mmheap type=group
depend fmri=system/library/fortran-runtime type=group
depend fmri=system/library/c++-runtime type=group
depend fmri=system/library/math type=group
license 88b54f56ea4cf5d88abe8b1009bf27a3ab578420 chash=ab74fd1d75d69ad9aeb0604911e5ffba5ac41f8b license=sunpro.license pkg.csize=120 pkg.size=111
set name=com.oracle.service.bugid value=15655869 value=19337921 value=19859511 value=21044319 value=21473136 value=21473418 value=21804190 value=21827672 value=21828659 value=21869309 value=21877883 value=21878193 value=21933616 value=22018506
signature 235c7674d821032ae3eeda280c7837d1f1f4fdb5 algorithm=rsa-sha256 chain="8e422c1bb80b05f08f7a849f3d7ae90a976e048e 754665e03bd28ef63b05a416073eb6d649624781" chain.chashes="083e40bb50e6964834ebfd3c66b8720b46028068 f85dabbb0d56b37de3c3de98663dd8f27a12ff8e" chain.csizes="1273 1326" chain.sizes="1773 2061" chash=05654e46fc5cac3b9b9bd11c39512bc92bc85089 pkg.csize=1281 pkg.size=1753 value=147620d229d4cc02c3f2ed9398011e82995a45edd37459ff298aef94a60d5a0a074c02e260870ee5b6c0e5fe4d5039d033a913e65a9ad6105e8204054d8e01349d80d2fab94939b4b4450837827d20b06107a4cd13323d8d8d07cd326b6559f950ba1a8a41410889f448087b6cc4745b50a81ca47c5b95b01559548dee114d9b7f3e4e414251d3869eb4677acf0d6d90f7249bfcc8a98ee0f264971245f135c0d05b23d6d4a811e98bccf23a87e918de9a6c906c0e8281639661c41d490909f8646fec07e2c7e03a36bcfc436a0803873b88fd450a07d0e677041be5363dba8cc9bb035d4cc5fe62a6acede58e83ec3e79ed2be3f24be58d37d653609486ed10 version=0

root@onyx9:~# pkg list 'system/library/*runtime*'
NAME (PUBLISHER)                                  VERSION                    IFO
system/library/bison-runtime                      3.0.4-0.175.3.35.0.2.0     i--
system/library/c++-runtime                        0.5.11-0.175.3.35.0.4.0    i--
system/library/fortran-runtime                    0.5.11-0.175.3.27.0.3.0    i--
system/library/gcc-3-runtime                      3.4.3-0.175.3.0.0.30.0     i--
system/library/gcc-45-runtime                     4.5.2-0.175.3.0.0.30.0     i--
system/library/gcc/gcc-c++-runtime                7.3.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-c++-runtime-48             4.8.2-0.175.3.0.0.30.0     i--
system/library/gcc/gcc-c++-runtime-5              5.4.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-c++-runtime-7              7.3.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-c-runtime                  7.3.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-c-runtime-48               4.8.2-0.175.3.0.0.30.0     i--
system/library/gcc/gcc-c-runtime-5                5.4.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-c-runtime-7                7.3.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-gfortran-runtime           7.3.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-gfortran-runtime-48        4.8.2-0.175.3.0.0.30.0     i--
system/library/gcc/gcc-gfortran-runtime-5         5.4.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-gfortran-runtime-7         7.3.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-gobjc-runtime              7.3.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-gobjc-runtime-48           4.8.2-0.175.3.0.0.30.0     i--
system/library/gcc/gcc-gobjc-runtime-5            5.4.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-gobjc-runtime-7            7.3.0-0.175.3.34.0.1.0     i--
system/library/gcc/gcc-runtime                    7.3.0-0.175.3.34.0.1.0     i--
system/library/studio-runtime                     0.5.11-0.175.3.3.0.2.0     i--

root@onyx9:~# pkg contents system/library/c++-runtime
PATH
usr/include/demangle.h
usr/lib/libC.so.5
usr/lib/libCrun.so.1
usr/lib/libCrunG3.so.1
usr/lib/libCstd.so.1
usr/lib/libExbridge.so
usr/lib/libExbridge.so.1
usr/lib/libdemangle.so
usr/lib/libdemangle.so.1
usr/lib/libiostream.so.1
usr/lib/sparcv9/libCrun.so.1
usr/lib/sparcv9/libCrunG3.so.1
usr/lib/sparcv9/libCstd.so.1
usr/lib/sparcv9/libdemangle.so
usr/lib/sparcv9/libdemangle.so.1
usr/lib/sparcv9/libiostream.so.1

root@onyx9:~# pkg contents system/library/fortran-runtime
PATH
usr/lib/libfsu.so
usr/lib/libfsu.so.1
usr/lib/libfsu_db.so
usr/lib/libfsu_db.so.1
usr/lib/sparcv9/libfsu.so
usr/lib/sparcv9/libfsu.so.1
usr/lib/sparcv9/libfsu_db.so
usr/lib/sparcv9/libfsu_db.so.1
usr/lib/studio/libfsu.so
usr/lib/studio/libfsu.so.1
usr/lib/studio/libfsu_db.so
usr/lib/studio/libfsu_db.so.1
usr/lib/studio/sparcv9/libfsu.so
usr/lib/studio/sparcv9/libfsu.so.1
usr/lib/studio/sparcv9/libfsu_db.so
usr/lib/studio/sparcv9/libfsu_db.so.1

root@onyx9:~# find /usr -name 'libstatomic*'
root@onyx9:~# find /lib -name 'libstatomic*'
root@onyx9:~# find /opt -name 'libstatomic*'
root@onyx9:~# 

If there is an alternate repository or specific package I need to add to get the libstatomic.so.1 library, it isn't clearly documented anywhere on mysql.com or Oracle MOS.

The only KB article I could find, which I linked in my last comment, said that libstatomic.so.1 is ONLY available from the developer studio package and needs to be provided by the author of the software, it is not something that is available to end users of Oracle Solaris or Oracle Linux.
[13 Aug 2019 18:16] MySQL Verification Team
Hi,

I apologize, I seen other documents are linked but did not notice you already visited a document explaining how to install runtime only.

Now this:

[quote]
> root@onyx9:~# pkg install --accept developerstudio-125/library/c++-libs \
> > developerstudio-125/library/c-libs \
> > developerstudio-125/library/f90-libs \
> > developerstudio-125/library/math-libs \
> > developerstudio-125/library/perflib \
> > developerstudio-125/library/studio-gccrt 
> 
> pkg install: The following pattern(s) did not match any allowable packages.  Try
> using a different matching pattern, or refreshing publisher information:
[/quote]

is a problem. It's not how it should work.
I need to check with my colleagues why is this happening and how to solve this problem.

Thanks for your patience
Bogdan
[13 Aug 2019 19:26] MySQL Verification Team
Hi,

We believe you miss some steps in the procedure to get access to pkg.oracle.com/solarisstudio/release.

When you go to https://pkg-register.oracle.com/register/repos/
What status you see for "Oracle Studio" ? (should say: Access granted) 

Did you follow the full procedure for adding the repo?

I know that you run the pkg set-publisher but did you get the access and keys from https://pkg-register.oracle.com/register/repos/ first?

******************************
1:
Create a directory in /var/pkg to store the key and certificate you downloaded from pkg-register.oracle.com.

% mkdir -m 0775 -p /var/pkg/ssl

2:
Copy the key and certificate into the directory.

% cp -i download-directory/pkg.oracle.com.key.pem /var/pkg/ssl
% cp -i download-directory/pkg.oracle.com.certificate.pem /var/pkg/ssl

3:
Add the Oracle Developer Studio publisher.

% pkg set-publisher \
-k /var/pkg/ssl/pkg.oracle.com.key.pem \
-c /var/pkg/ssl/pkg.oracle.com.certificate.pem \
-G '*' -g https://pkg.oracle.com/solarisstudio/release solarisstudio
******************************

So if you don't see you have access granted please login to https://pkg-register.oracle.com/ and request access to "Oracle Studio" and download the  pkg.oracle.com.key.pem and pkg.oracle.com.certificate.pem from the certificate page.

libstatomic.so.1 is in package:
developer/developerstudio-126/library/c-libs

# pkg contents developer/developerstudio-126/library/c-libs
PATH
opt/developerstudio12.6
opt/developerstudio12.6/lib
opt/developerstudio12.6/lib/compilers
opt/developerstudio12.6/lib/compilers/atomic
opt/developerstudio12.6/lib/compilers/atomic/libstatomic.so
opt/developerstudio12.6/lib/compilers/atomic/libstatomic.so.1
opt/developerstudio12.6/lib/compilers/atomic/sparcv9
opt/developerstudio12.6/lib/compilers/atomic/sparcv9/libstatomic.so
opt/developerstudio12.6/lib/compilers/atomic/sparcv9/libstatomic.so.1

Please let me know if you did all this and if it worked or if it failed - where. 

thanks
Bogdan
[13 Aug 2019 23:11] MySQL Verification Team
If you still have issues another option is to download the tarfile from:
https://www.oracle.com/tools/developerstudio/downloads/developer-studio-v126-tarfile-downl...

and untar so path will be  /opt/developerstudio12.6/

It looks like the tarfile contains all libraries

# bunzip2 -c OracleDeveloperStudio12.6-solaris-sparc-bin.tar.bz2 |tar ft -|grep libstatomic
OracleDeveloperStudio12.6-solaris-sparc-bin/developerstudio12.6/lib/compilers/atomic/libstatomic.so
OracleDeveloperStudio12.6-solaris-sparc-bin/developerstudio12.6/lib/compilers/atomic/sparcv9/libstatomic.so.1
OracleDeveloperStudio12.6-solaris-sparc-bin/developerstudio12.6/lib/compilers/atomic/sparcv9/libstatomic.so
OracleDeveloperStudio12.6-solaris-sparc-bin/developerstudio12.6/lib/compilers/atomic/libstatomic.so.1
[1 Jun 2020 7:48] Mateen Ahmed
Hi

after installing developerstudio getting below such errors

 ./isql -v MYSQL
ld.so.1: isql: fatal: relocation error: file /usr/local/odbc/lib/libmyodbc8w.so: symbol newlocale: referenced symbol not found
Killed
[17 Sep 2020 9:56] Muhammad Ali Bukhari
Hi,

I have similar problem of accessing/login to mysql after installing mysql package for solaris:-

# Executing postinstall script.
ld.so.1: mysqld: fatal: libstatomic.so.1: open failed: No such file or directory
/var/sadm/pkg/mysql/install/postinstall: line 96: 1942: Killed

Installation of <mysql> was successful.

mysql -u root -p
ld.so.1: mysql: fatal: libstatomic.so.1: open failed: No such file or directory

Anybody can help please?

Regards,

Ali B