Skip to content

Can't build 3.13b2 on Ubuntu: test test_sqlite3 failed #120191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RobH123 opened this issue Jun 7, 2024 · 14 comments
Closed

Can't build 3.13b2 on Ubuntu: test test_sqlite3 failed #120191

RobH123 opened this issue Jun 7, 2024 · 14 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@RobH123
Copy link

RobH123 commented Jun 7, 2024

Bug report

Bug description:

After successfully running ./configure --enable-optimizations on Ubuntu 24.04 (with these lines perhaps relevant):

...
checking for decimal libmpdec machine... uint128
checking for sqlite3 >= 3.15.2... yes
checking for sqlite3.h... yes
checking for sqlite3_bind_double in -lsqlite3... yes
checking for sqlite3_column_decltype in -lsqlite3... yes
checking for sqlite3_column_double in -lsqlite3... yes
checking for sqlite3_complete in -lsqlite3... yes
checking for sqlite3_progress_handler in -lsqlite3... yes
checking for sqlite3_result_double in -lsqlite3... yes
checking for sqlite3_set_authorizer in -lsqlite3... yes
checking for sqlite3_trace_v2 in -lsqlite3... yes
checking for sqlite3_value_double in -lsqlite3... yes
checking for sqlite3_load_extension in -lsqlite3... yes
checking for sqlite3_serialize in -lsqlite3... yes
checking for --enable-loadable-sqlite-extensions... no
checking for tcl >= 8.5.12 tk >= 8.5.12... yes
...
checking for stdlib extension module readline... yes
checking for stdlib extension module _sqlite3... yes
checking for stdlib extension module _tkinter... yes
...
config.status: creating pyconfig.h
configure: creating Modules/Setup.local
configure: creating Makefile

Then make -s -j4

...
0:00:45 load avg: 8.53 [36/44] test_set
0:00:50 load avg: 8.41 [37/44] test_sqlite3
test test_sqlite3 failed
0:00:50 load avg: 8.41 [38/44] test_statistics -- test_sqlite3 failed (4 errors)
0:00:57 load avg: 7.89 [39/44] test_str
0:00:58 load avg: 7.89 [40/44] test_struct
0:00:59 load avg: 7.89 [41/44] test_tabnanny
0:01:00 load avg: 7.89 [42/44] test_time
0:01:02 load avg: 7.74 [43/44] test_xml_etree
0:01:03 load avg: 7.74 [44/44] test_xml_etree_c

Total duration: 1 min 4 sec
Total tests: run=9,203 skipped=177
Total test files: run=44/44 failed=1
Result: FAILURE
make: *** [Makefile:892: profile-run-stamp] Error 2

dpkg -l | grep sqlite3

ii  libaprutil1-dbd-sqlite3:amd64                               1.6.3-1.1ubuntu7                            amd64        Apache Portable Runtime Utility Library - SQLite3 Driver
ii  libsqlite3-0:amd64                                          3.45.1-1ubuntu2                             amd64        SQLite 3 shared library
ii  libsqlite3-dev:amd64                                        3.45.1-1ubuntu2                             amd64        SQLite 3 development files
ii  sqlite3                                                     3.45.1-1ubuntu2                             amd64        Command line interface for SQLite 3

Not sure where to look next? (Can't see anything relevant on the issue tracker.)

(I had the same problem last month with beta1, but hoped beta2 might help me get 3.13 running for testing.)

CPython versions tested on:

3.13

Operating systems tested on:

Linux

@RobH123 RobH123 added the type-bug An unexpected behavior, bug, or error label Jun 7, 2024
@mcepl
Copy link
Contributor

mcepl commented Jun 7, 2024 via email

@RobH123
Copy link
Author

RobH123 commented Jun 7, 2024

Thanks for looking at this @mcepl.

...
test_win_sum_int (test.test_sqlite3.test_userfunctions.WindowFunctionTests.test_win_sum_int) ... ok

======================================================================
ERROR: test_open_undecodable_uri (test.test_sqlite3.test_dbapi.OpenTests.test_open_undecodable_uri)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/robert/Downloads/Python-3.13.0b2/Lib/test/test_sqlite3/test_dbapi.py", line 729, in test_open_undecodable_uri
    with contextlib.closing(sqlite.connect(uri, uri=True)) as cx:
                            ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
sqlite3.OperationalError: unable to open database file

======================================================================
ERROR: test_open_undecodable_uri (test.test_sqlite3.test_dbapi.OpenTests.test_open_undecodable_uri)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/robert/Downloads/Python-3.13.0b2/Lib/test/support/os_helper.py", line 345, in unlink
    _unlink(filename)
    ~~~~~~~^^^^^^^^^^
OSError: [Errno 84] Invalid or incomplete multibyte or wide character: b'@test_195094_tmp\xe7w\xf0'

======================================================================
ERROR: test_open_with_undecodable_path (test.test_sqlite3.test_dbapi.OpenTests.test_open_with_undecodable_path)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/robert/Downloads/Python-3.13.0b2/Lib/test/test_sqlite3/test_dbapi.py", line 682, in test_open_with_undecodable_path
    with contextlib.closing(sqlite.connect(path)) as cx:
                            ~~~~~~~~~~~~~~^^^^^^
sqlite3.OperationalError: unable to open database file

======================================================================
ERROR: test_open_with_undecodable_path (test.test_sqlite3.test_dbapi.OpenTests.test_open_with_undecodable_path)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/robert/Downloads/Python-3.13.0b2/Lib/test/support/os_helper.py", line 345, in unlink
    _unlink(filename)
    ~~~~~~~^^^^^^^^^^
OSError: [Errno 84] Invalid or incomplete multibyte or wide character: b'@test_195094_tmp\xe7w\xf0'

----------------------------------------------------------------------
Ran 481 tests in 0.517s

FAILED (errors=4, skipped=4)
test test_sqlite3 failed
test_sqlite3 failed (4 errors)

== Tests result: FAILURE ==

1 test failed:
    test_sqlite3

Total duration: 689 ms
Total tests: run=481 skipped=4
Total test files: run=1/1 failed=1
Result: FAILURE
Sat 08:25:~/Downloads/Python-3.13.0b2$ ll Lib/test/test_sqlite3/
...
-rw-r--r--  1 robert robert 74629 Jun  6 02:46 test_dbapi.py
...```

@mcepl
Copy link
Contributor

mcepl commented Jun 8, 2024

Probably completely wrong question. What did you get when running this?

$ ./python -c 'import sys; print(sys.maxunicode > 0xffff)'

@RobH123
Copy link
Author

RobH123 commented Jun 8, 2024

True (and if I print sys.maxunicode it's 1114111 or 0x10FFFF).

Oh, and dumb me hadn't even realised at first that I'm actually running python3.13 for these commands. (I'm guessing that it's the unoptimised version???)

@Zheaoli
Copy link
Contributor

Zheaoli commented Jun 8, 2024

----------------------------------------------------------------------
Ran 480 tests in 0.625s

OK (skipped=4)
Warning -- files was modified by test_sqlite3
Warning --   Before: []
Warning --   After:  ['gmon.out']
test_sqlite3 failed (env changed)

== Tests result: SUCCESS ==

1 test altered the execution environment (env changed):
    test_sqlite3

Total duration: 1.2 sec
Total tests: run=480 skipped=4
Total test files: run=1/1 env_changed=1
Result: SUCCESS

╭─   manjusaka@manjusaka-garuda   ~/Documents/projects/cpython                                                                                                                                                                                                        main ?9   21:29:47 
╰─ sqlite3 --version
3.46.0 2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebalt1 (64-bit)

Could not reproduce the issue on main branch

@RobH123
Copy link
Author

RobH123 commented Jun 8, 2024

Oh. Do you install sqlite3 from a ppa? (I have 3.45.1 on Ubuntu Noble 24.04, you have 3.46). My Ubuntu has been upgraded every six months for almost five years, so possibly some compatibility thing makes my system not identical to a new install??? Any ideas what else I could possibly look for @Zheaoli? I guess I could try to figure out how to build 3.13 in Docker or something??? Otherwise I'll just have to wait for the eventual release to reach Ubuntu 24.10. (Never had problems building betas before.)

@vstinner
Copy link
Member

vstinner commented Jun 11, 2024

Can you run the following commands and copy/paste the output?

$ ./python
>>> from test.support import os_helper
>>> os_helper.TESTFN_UNDECODABLE
b'@test_950535_tmp\xe7w\xf0'

>>> import sys
>>> sys.getfilesystemencoding()
'utf-8'
>>> sys.getfilesystemencodeerrors()
'surrogateescape'

>>> import locale
>>> locale.getencoding()
'UTF-8'

>>> import sqlite3
>>> sqlite3.sqlite_version
'3.45.1'
>>> sqlite3.sqlite_version_info
(3, 45, 1)

@RobH123
Copy link
Author

RobH123 commented Jun 11, 2024

Python 3.13.0b2 (main, Jun 7 2024, 14:59:58) [GCC 13.2.0] on linux

b'@test_4030379_tmp\xe7w\xf0'

'utf-8'
'surrogateescape'

'UTF-8'

'3.45.1'
(3, 45, 1)

Thanks @vstinner. (Without the optimisations, 3.13 is about half the speed of 3.12 in my applications.)

@erlend-aasland
Copy link
Contributor

@RobH123 can you try the RC and check if your issue still persists?

@satmandu
Copy link

satmandu commented Oct 9, 2024

@RobH123 Do you have a zfs rpool on your system?

And if so, what does zfs get utf8only,normalization rpool give you?

This is what I see on my system:

zfs get utf8only,normalization rpool
NAME   PROPERTY       VALUE          SOURCE
rpool  utf8only       on             -
rpool  normalization  formD          -

@RobH123
Copy link
Author

RobH123 commented Oct 9, 2024

Yes, I have zfs rpool and output of query is identical to yours @satmandu.

@RobH123
Copy link
Author

RobH123 commented Oct 10, 2024

@satmandu Does that mean you understand the problem? The test only fails for users with ZFS (which is probably quite a low percentage of Ubuntu users)? Are you able to give a brief explanation please.

@satmandu
Copy link

@satmandu Does that mean you understand the problem? The test only fails for users with ZFS (which is probably quite a low percentage of Ubuntu users)? Are you able to give a brief explanation please.

See #81765 (comment)

@erlend-aasland
Copy link
Contributor

Let's keep the ZFS test issues in #81765; closing this as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

6 participants