weechat python.so not linked against libpython3 (undefined symbol: _Py_NoneStruct)

Bug #1866065 reported by Paulo Flabiano Smorigo
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
weechat (Ubuntu)
Fix Released
Undecided
TJ

Bug Description

I updated to focal this week and weechat fails to load python plugins. It shows the following message:

Error: unable to load plugin "/usr/lib/x86_64-linux-gnu/weechat/plugins/python.so":
/usr/lib/x86_64-linux-gnu/weechat/plugins/python.so: undefined symbol: _Py_NoneStruct

There was an update yesterday but it doesn't fixed this problem.

Tags: patch

CVE References

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in weechat (Ubuntu):
status: New → Confirmed
Revision history for this message
David Britton (dpb) wrote :
Revision history for this message
David Britton (dpb) wrote :

Appears this works around it on up to date focal:

  LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libpython3.8.so weechat

I'm guessing something messed up in the linking of the python.so that ships with weechat-python

Revision history for this message
Marcelo Cerri (mhcerri) wrote :

I had to use `LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libpython3.8.so.1 weechat` instead but the workaround worked to me.

Revision history for this message
TJ (tj) wrote :

The problem here is the build isn't linking against libpython3

$ ldd /usr/lib/x86_64-linux-gnu/weechat/plugins/python.so
        linux-vdso.so.1 (0x00007ffd8eb94000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1ae4b37000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1ae4d83000)

summary: - weechat can't load python plugins (undefined symbol: _Py_NoneStruct)
+ weechat python.so not linked against libpython3 (undefined symbol:
+ _Py_NoneStruct)
Revision history for this message
TJ (tj) wrote :

This is a partial cherry-pick of 76c6f52e8 but modified to remove the earlier FreeBSD modifications introduced in 5c8ac69f7.

The problem was that the python3.8 pkgconfig moved the libdir variable from python3.8 to python3.8-embed so this needs to be checked first in cmake/FindPython.cmake

Changed in weechat (Ubuntu):
assignee: nobody → TJ (tj)
status: Confirmed → In Progress
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "python3: correctly find and link against libpython3.8" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
TJ (tj) wrote :
Revision history for this message
TJ (tj) wrote :

See also additional patches address CVE-2020-8955 in Bug #1872425

Revision history for this message
Matthias Klose (doko) wrote :

Python extensions are not linked anymore against libpython in 3.8. If weechat embeds an interpreter, then it has to link against it.

Revision history for this message
TJ (tj) wrote :

So is this being left broken then? This is a regression.

Revision history for this message
rww (rww-deactivatedaccount) wrote :

Bug confirmed in version 2.6-2ubuntu1 (currently in focal/universe). I tested 2.6-2ubuntu2 (currently in focal-proposed/universe) and confirmed that it's fixed there.

Changed in weechat (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package weechat - 2.6-2ubuntu2

---------------
weechat (2.6-2ubuntu2) focal; urgency=medium

  * Correctly find and link against libpython3.8 (LP: #1866065)
  * CVE-2020-8955 fix crashes when receiving malformed messages
    (LP: #1872425)

 -- Tj <email address hidden> Mon, 13 Apr 2020 10:21:33 +0100

Changed in weechat (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.