AIX Open Source

 View Only

 sqlite 3.49.2-1 breaks python2.7

Art Colvig's profile image
Art Colvig posted Fri June 27, 2025 05:38 PM

Multiple systems across both 7.2.& 7.3 as soon as I update from sqlite.ppc 3.45.3-1 to 3.49.2-1 python 2.7 starts failing with 

Could not load program python:
Symbol resolution failed for /opt/freeware/lib/libpython2.7.so because:
        Symbol _GLOBAL__AIXI_libsqlite3_so (number 219) is not exported from dependent
          module /usr/lib/libsqlite3.so.
        Symbol _GLOBAL__AIXD_libsqlite3_so (number 220) is not exported from dependent
          module /usr/lib/libsqlite3.so.
Examine .loader section symbols with the 'dump -Tv' command.

python-2.7.18-4.ppc

I understand that 2.7 is deprecated but we are still migrating old scripts off of it.

@Aditya Kamath

explicitly setting libpath to point to /opt/freeware/lib has the same result.

 python
Could not load program python:
Symbol resolution failed for /opt/freeware/lib/libpython2.7.so because:
        Symbol _GLOBAL__AIXI_libsqlite3_so (number 219) is not exported from dependent
          module /usr/lib/libsqlite3.so.
        Symbol _GLOBAL__AIXD_libsqlite3_so (number 220) is not exported from dependent
          module /usr/lib/libsqlite3.so.
Examine .loader section symbols with the 'dump -Tv' command.

@Aditya Kamath

I found and removed an old sqlite that was in the old location and reinstalled sqlite

 dnf reinstall sqlite
Last metadata expiration check: 0:02:10 ago on Mon Jun 30 10:02:43 2025.
Dependencies resolved.
================================================================================================================================================================================================================
 Package                                          Architecture                                  Version                                             Repository                                             Size
================================================================================================================================================================================================================
Reinstalling:
 sqlite                                           ppc                                           3.49.2-1                                            AIX_Toolbox                                           6.7 M

Transaction Summary
================================================================================================================================================================================================================

Total size: 6.7 M
Installed size: 23 M
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] sqlite-3.49.2-1.aix7.1.ppc.rpm: Already downloaded
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                        1/1
  Reinstalling     : sqlite-3.49.2-1.ppc                                                                                                                                                                    1/2
  Cleanup          : sqlite-3.49.2-1.ppc                                                                                                                                                                    2/2
  Verifying        : sqlite-3.49.2-1.ppc                                                                                                                                                                    1/2
  Verifying        : sqlite-3.49.2-1.ppc                                                                                                                                                                    2/2

Reinstalled:
  sqlite-3.49.2-1.ppc

Complete!
> python
Could not load program python:
        Dependent module libsqlite3.so could not be loaded.
Could not load module libsqlite3.so.
System error: No such file or directory

> ls -l libsql*
-rw-r--r--    1 root     system     13513494 Jun  3 13:01 libsqlite3.a
lrwxrwxrwx    1 root     system           20 Jun 30 10:04 libsqlite3.so@ -> libsqlite3.so.3.49.2

>dnf whatprovides '*/libsqlite3.so.3.49.2'
Last metadata expiration check: 0:09:09 ago on Mon Jun 30 10:02:43 2025.
Error: No Matches found

I tried removing the symlink between libsqlite3.so and libsqlite3.so.3.49.2 and running a dnf reinstall on sqlite and it came right back with no libsqlite3.so.3.49.2 anywhere on the system and no dnf packages providing it.....  is there a new rpm.rte that provides libsqlite3.so.3.49.2?

Aditya Kamath's profile image
Aditya Kamath

@Art Colvig

Hi,

So, as we can see, the symbol _GLOBAL__AIXD_libsqlite3_so is coming from libsqlite library in /opt/freeware/lib and not /usr/lib
# dump -Tov /opt/freeware/lib/libsqlite3.so | grep _GLOBAL__AIXD_libsqlite3_so
[87]    0x20019490    .data      EXP     DS   Ldef        [noIMid] _GLOBAL__AIXD_libsqlite3_so

So we need to get your application to link to the /opt/freeware/lib one than the library in /usr/lib.

Did you try export LIBPATH=/opt/freeware/lib and check?

Art Colvig's profile image
Art Colvig

@Aditya Kamath

I found and removed an old sqlite that was in the old location and reinstalled sqlite

 dnf reinstall sqlite
Last metadata expiration check: 0:02:10 ago on Mon Jun 30 10:02:43 2025.
Dependencies resolved.
================================================================================================================================================================================================================
 Package                                          Architecture                                  Version                                             Repository                                             Size
================================================================================================================================================================================================================
Reinstalling:
 sqlite                                           ppc                                           3.49.2-1                                            AIX_Toolbox                                           6.7 M

Transaction Summary
================================================================================================================================================================================================================

Total size: 6.7 M
Installed size: 23 M
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] sqlite-3.49.2-1.aix7.1.ppc.rpm: Already downloaded
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                        1/1
  Reinstalling     : sqlite-3.49.2-1.ppc                                                                                                                                                                    1/2
  Cleanup          : sqlite-3.49.2-1.ppc                                                                                                                                                                    2/2
  Verifying        : sqlite-3.49.2-1.ppc                                                                                                                                                                    1/2
  Verifying        : sqlite-3.49.2-1.ppc                                                                                                                                                                    2/2

Reinstalled:
  sqlite-3.49.2-1.ppc

Complete!
> python
Could not load program python:
        Dependent module libsqlite3.so could not be loaded.
Could not load module libsqlite3.so.
System error: No such file or directory

> ls -l libsql*
-rw-r--r--    1 root     system     13513494 Jun  3 13:01 libsqlite3.a
lrwxrwxrwx    1 root     system           20 Jun 30 10:04 libsqlite3.so@ -> libsqlite3.so.3.49.2

>dnf whatprovides '*/libsqlite3.so.3.49.2'
Last metadata expiration check: 0:09:09 ago on Mon Jun 30 10:02:43 2025.
Error: No Matches found

I tried removing the symlink between libsqlite3.so and libsqlite3.so.3.49.2 and running a dnf reinstall on sqlite and it came right back with no libsqlite3.so.3.49.2 anywhere on the system and no dnf packages providing it.....  is there a new rpm.rte that provides libsqlite3.so.3.49.2?

Aditya Kamath's profile image
Aditya Kamath

@Art Colvig

Hi,

Yes. It from the rpm.rte.

# lslpp -f rpm.rte
  Fileset               File
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  rpm.rte 4.15.1.1013  ...

   /usr/opt/rpm/lib/libsqlite3.so

...

# ls -l /usr/lib/libsqlite3.so
lrwxrwxrwx 1 root system 30 Aug 19  2024 /usr/lib/libsqlite3.so -> /usr/opt/rpm/lib/libsqlite3.so

# ldd /opt/freeware/lib/libpython2.7.so 
/opt/freeware/lib/libpython2.7.so needs:
         /usr/lib/libdl.a(shr.o)
         /opt/freeware/lib/libexpat.a(libexpat.so.1)
         /opt/freeware/lib/libffi.a(libffi.so.6)
         /opt/freeware/lib/libncurses.so
         /usr/lib/libsqlite3.so
         /usr/lib/libpthreads.a(shr_comm.o)
         /usr/lib/libpthreads.a(shr_xpg5.o)
         /usr/lib/libc.a(shr.o)
         /usr/lib/librtl.a(shr.o)
         /opt/freeware/lib/libgcc_s.a(shr.o)
         /unix
         /usr/lib/libcrypt.a(shr.o)

Can you check why this is not there in your system. If you see ldd output it needs it. If you have it, it will fix the issue. You can run the above commands and it must show as above from my LPAR.

Art Colvig's profile image
Art Colvig

@Aditya Kamath it looks like you are running an older rpm.rte.  Did something break in .1015 & .1016  I updated to .1016 to see if that would help.

>  ls -l |grep rpm.rte
-rw-r-----    1 root     system     48297984 Jul 11 10:11 rpm.rte.4.15.1.1016

> lslpp -f rpm.rte | grep libsql
                        /usr/opt/rpm/lib/libsqlite3.so
                        /usr/opt/rpm/lib/libsqlite3.a
> ls -l /usr/lib/libsqlite3.so
lrwxrwxrwx    1 root     system           30 Jul 11 10:23 /usr/lib/libsqlite3.so@ -> /usr/opt/rpm/lib/libsqlite3.so*
>  ldd /opt/freeware/lib/libpython2.7.so
/opt/freeware/lib/libpython2.7.so needs:
         /usr/lib/libdl.a(shr.o)
         /opt/freeware/lib/libexpat.a(libexpat.so.1)
         /opt/freeware/lib/libffi.a(libffi.so.6)
         /opt/freeware/lib/libncurses.so
         /opt/freeware/lib/libsqlite3.so
         /usr/lib/libpthreads.a(shr_comm.o)
         /usr/lib/libpthreads.a(shr_xpg5.o)
         /usr/lib/libc.a(shr.o)
         /usr/lib/librtl.a(shr.o)
         /opt/freeware/lib/libgcc_s.a(shr.o)
         /unix
         /usr/lib/libcrypt.a(shr.o)

Aditya Kamath's profile image
Aditya Kamath

@Art Colvig

I spent some time on this issue. So here is my finding.

# python2.7
exec(): 0509-036 Cannot load program python2.7 because of the following errors:
        0509-130 Symbol resolution failed for /opt/freeware/lib/libpython2.7.so because:
        0509-136   Symbol _GLOBAL__AIXI_libsqlite3_so (number 219) is not exported from
                   dependent module /usr/opt/rpm/lib/libsqlite3.so.
        0509-136   Symbol _GLOBAL__AIXD_libsqlite3_so (number 220) is not exported from
                   dependent module /usr/opt/rpm/lib/libsqlite3.so.
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.

This is the issue I also reproduced. You see, the problem is the latest SQLite does not have the libsqlite3 soft link well set, and hence it picked up /usr/lib/libsqlite3.so which will not have those two missing symbols.

After this I did a dnf downgrade sqlite

Then things worked since the older toolbox sqlite has that library with soft links intact.

# python2.7
Python 2.7.18 (default, Dec 15 2022, 05:12:43) 
[GCC 8.3.0] on aix6
Type "help", "copyright", "credits" or "license" for more information.

I would strongly recommend moving to Python 3. For now try this fix.

Regards,


>>> 

Joachim Tresoor's profile image
Joachim Tresoor

I have a similar problem with Subversion:

$ svn
exec(): 0509-036 Cannot load program svn because of the following errors:
        0509-150   Dependent module /usr/lib/libsqlite3.so could not be loaded.
        0509-022 Cannot load module /usr/lib/libsqlite3.so.
        0509-026 System error: Cannot run a file that does not have a valid format.

I can confirm that downgrading to sqlite-3.45.3-1 fixes it, but that's not a good long term solution from a security perspective. The old svn works with /opt/freeware/lib64/libsqlite3.so, and after the upgrade this becomes a link to a file that doesn't exist: /opt/freeware/lib64/libsqlite3.so@ -> libsqlite3.so.3.49.2

Can we get a new version of sqlite which contains a correct libsqlite3.so.3.49.2 so the link works? Or a correct /opt/freeware/lib64/libsqlite3.so that is not a link?