Bug 1792059 - Python 3.9: undefined symbol: Py_GetArgcArgv in setproctitle
Summary: Python 3.9: undefined symbol: Py_GetArgcArgv in setproctitle
Alias: None
Product: Fedora
Classification: Fedora
Component: python3.9
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:0ef67e0dfdb9185e0416980b118...
: 1846570 (view as bug list)
Depends On:
Blocks: PYTHON39
TreeView+ depends on / blocked
Reported: 2020-01-16 23:12 UTC by Miro Hrončok
Modified: 2020-06-12 06:06 UTC (History)
12 users (show)

Fixed In Version: python3.9-3.9.0~b3-1.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-06-11 16:40:41 UTC
Type: Bug

Attachments (Terms of Use)
Patch to address Py_GetArgcArgv undefined symbol (309 bytes, text/plain)
2020-05-31 20:38 UTC, leigh scott
no flags Details

System ID Private Priority Status Summary Last Updated
Github DonnchaC onionbalance issues 74 0 None closed Onionbalance fails with stem 1.8.0 2020-07-09 12:50:56 UTC

Description Miro Hrončok 2020-01-16 23:12:58 UTC
python-onionbalance fails to build with Python 3.9.0a2.

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/sphinxcontrib/autoprogram.py", line 120, in import_object
    mod = __import__(module_name)
  File "/builddir/build/BUILD/onionbalance-0.1.8/onionbalance/manager.py", line 15, in <module>
    from setproctitle import setproctitle  # pylint: disable=no-name-in-module
ImportError: /usr/lib64/python3.9/site-packages/setproctitle.cpython-39-x86_64-linux-gnu.so: undefined symbol: Py_GetArgcArgv

No idea where is that coming from.

For the build logs, see:

For all our attempts to build python-onionbalance with Python 3.9, see:

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Marcel Haerry 2020-01-18 12:28:31 UTC
I think the issue is that python-stem 1.8.0 got into rawhide and onionbalance is not compatible with that version.

Issue has been reported upstream a few days ago: https://github.com/DonnchaC/onionbalance/issues/74

I am not sure how fast onionbalance will pick up python-stem >= 1.8, but it was a long anticipated release to support onion services v3.

Comment 2 Marcel Haerry 2020-01-18 12:29:56 UTC
Well rereading the error, it might really be a python 3.9 issue, but still it won't work with python-stem >= 1.8, which is also part of rawhide now.

Comment 3 Ben Cotton 2020-02-11 17:33:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 4 Miro Hrončok 2020-05-25 13:01:48 UTC
This comment is mass posted to all bugs blocking the Python 3.9 tracker, sorry if it is not 100 % relevant. When in doubt, please ask.

The Python 3.9 rebuild is in progress in a Koji side tag.

If you fix this bug, please don't rebuild the package in regular rawhide, but do it in the side tag with:

    $ fedpkg build --target=f33-python

The rebuild is progressing slowly and it is possible this package won't have all the required build dependencies yet. If that's the case, please just leave the fix committed and pushed and we will eventually rebuild it for you.

You are not asked to go and try rebuild all the missing dependencies yourself. If you know there is a bootstrap loop in the dependencies, let me know and we can untangle it together.

If you want to test your fix or reproduce the failure, you can still use the Copr repo mentioned in the initial comment of this bug: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Comment 5 Miro Hrončok 2020-05-29 07:11:42 UTC
Python 3.9 update: The f33-python side tag is currently being merged.

New builds in f33-python are no longer possible, but python3 is not yet updated to Python 3.9 in rawhide. You can check when Python is Python 3.9 with:

    $ koji wait-repo f33-build --build python3.9-3.9.0~b1-3.fc3

And build the packages normally after that.

Comment 6 leigh scott 2020-05-31 07:39:27 UTC
Importing setproctitle with an undefined symbol

[leigh@leigh ~]$ cinnamon-settings
Traceback (most recent call last):
  File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 16, in <module>
    from setproctitle import setproctitle
ImportError: /usr/lib64/python3.9/site-packages/setproctitle.cpython-39-x86_64-linux-gnu.so: undefined symbol: Py_GetArgcArgv
[leigh@leigh ~]$ rpm -qf /usr/lib64/python3.9/site-packages/setproctitle.cpython-39-x86_64-linux-gnu.so
[leigh@leigh ~]$

Comment 7 leigh scott 2020-05-31 08:31:05 UTC
[leigh@leigh setproctitle-1.1.10]$ python
Python 3.9.0b1 (default, May 21 2020, 00:00:00) 
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setproctitle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib64/python3.9/site-packages/setproctitle.cpython-39-x86_64-linux-gnu.so: undefined symbol: Py_GetArgcArgv

Comment 8 leigh scott 2020-05-31 20:38:57 UTC
Created attachment 1693956 [details]
Patch to address Py_GetArgcArgv undefined symbol

Patch  attached addresses the ' undefined symbol: Py_GetArgcArgv in setproctitle' issue.

List of affected packages


Comment 9 Pavel Raiskup 2020-06-05 14:16:08 UTC
On F32:
$ readelf -a /usr/lib64/libpython3.*.so* | grep GetArg
  1358: 00000000000c631e    20 FUNC    GLOBAL DEFAULT   11 Py_GetArgcArgv
  1358: 00000000000c631e    20 FUNC    GLOBAL DEFAULT   11 Py_GetArgcArgv

There's no such symbol on F33.  Miro, could you check if it is expected?

Comment 10 Miro Hrončok 2020-06-05 14:44:08 UTC
As far as I understand this, Py_GetArgcArgv is not an API, neither it ever was. However, I am not an expert here. Petr?

Comment 11 Victor Stinner 2020-06-05 15:33:31 UTC
I guess that Py_GetArgcArgv() was intended to be exported. It was exported in Python 3.8, but it is no longer exported in Python 3.9.

Python 3.9 is now built with -fvisibility=hidden and so symbols which are not exported explicitly are no longer exported.

I suggest you to open an issue upstream. It looks like a regression, not a deliberate choice. Py_GetArgcArgv() is defined but not used in CPython. It's not documented. It's not exported explicitly in header files.

Comment 12 Pavel Raiskup 2020-06-08 05:25:22 UTC
setproctitle upstream report:

Comment 13 Victor Stinner 2020-06-08 13:22:59 UTC
I created an issue on Python upstream:

Comment 14 Pavel Raiskup 2020-06-09 10:16:58 UTC
Should this be switched against Python component?

Comment 15 Petr Viktorin 2020-06-09 11:04:50 UTC
> Should this be switched against Python component?

Sure. It's correct, but IMO unnecessary: all relevant humans are aware of the issue, and I don't think any relevant automation checks that field.

Meanwhile, Python 3.9b2 (which should fix this) is out upstream, and should get in Fedora after some testing. And after the current outage (Fedora datacenter move).

Comment 17 Victor Stinner 2020-06-10 12:43:07 UTC
I checked: Python 3.9.0b3 includes my fix to export Py_GetArgcArgv() function.

Comment 18 Victor Stinner 2020-06-11 12:33:37 UTC
> https://src.fedoraproject.org/rpms/python3.9/pull-request/12

Merged into the master branch.

Comment 19 Miro Hrončok 2020-06-11 12:46:23 UTC
But not built yet.

Comment 20 leigh scott 2020-06-12 06:06:22 UTC
*** Bug 1846570 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.