Bug 1238113 - kig: ImportError: /usr/lib64/python2.7/lib-dynload/math.so: undefined symbol: PyFloat_Type
Summary: kig: ImportError: /usr/lib64/python2.7/lib-dynload/math.so: undefined symbol:...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kig
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-01 08:50 UTC by Maurizio Paolini
Modified: 2017-12-28 14:54 UTC (History)
16 users (show)

Fixed In Version: kig-15.04.3-1.fc22
Clone Of:
Environment:
Last Closed: 2015-07-18 02:11:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
KDE Software Compilation 335965 0 NOR REOPENED mathematical functions like sin, exp,... unusable in python scripts 2020-04-02 13:58:43 UTC

Description Maurizio Paolini 2015-07-01 08:50:34 UTC
Description of problem: python scripts in kig cannot use mathematical functions


Version-Release number of selected component (if applicable):
kig-15.04.0-1.fc22.i686

How reproducible:
Create a python script that uses a mathematical function (e.g. sin)


Steps to Reproduce:
1. open kig
3. Objects->Other->Python Script
4. click on "Next"
5. enter e.g.
<TAB>return DoubleObject( 4*atan(1.0) )

Actual results:
Error in script:
  ...
  NameError: global name 'atan' is not defined
  ...

Expected results:
The string "3.1315" should appear near the origin

Additional info:
This happens even with the latest Git code, so I "reopened" the
bug upstream:  https://bugs.kde.org/show_bug.cgi?id=335965
However soon after that the bug was closed as
"RESOLVED DOWNSTREAM".
Does that mean "Fedora" for me?

A workaround is to open kig with:

$ LD_PRELOAD=/usr/lib/libpython2.7.so.1.0 kig

(or "lib64")

Comment 1 Rex Dieter 2015-07-01 12:26:10 UTC
Basically same issue as f21's kig bug #1101626

We're seeing runtime error/warning:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /usr/lib64/python2.7/lib-dynload/math.so: undefined symbol: PyFloat_Type

Comment 2 Rex Dieter 2015-07-01 16:04:56 UTC
Per my upstream comment https://bugs.kde.org/show_bug.cgi?id=335965#c22 this would appear to be an upstream bug fixed by my proposed patch there, but upstream developer is arguing this is a fedora/downstream issue, that (apparently?)
/usr/lib64/python2.7/lib-dynload/math.so
should link libpython itself.

Can you please clarify for me if that's expected or not?

Comment 3 Petr Viktorin (pviktori) 2015-07-01 16:45:30 UTC
Hi, I've commented on the upstream bug. Basically, I believe Fedora's configuration is fine, even if different distros may use the upstream default of linking Python modules statically.

Comment 4 Rex Dieter 2015-07-01 16:58:36 UTC
Thanks, let's bounce this back to kig.

Comment 5 Rex Dieter 2015-07-01 17:02:58 UTC
As an aside, you mentioned that python by default links modules statically, it seems in the "shared" case... it's not linked with libpython *at all*?  If true, why not?

Comment 6 Petr Viktorin (pviktori) 2015-07-01 17:29:00 UTC
No, it's not linked to libpython. It's not a generic shared library usable with any C program that wants it. It is meant to be loaded by Python's import machinery, from the specific version of Python for which it was configured and built.

The comments on the upstream bug tracker indicate that a Py_Initialize() was called while libpython wasn't loaded, which is looks extremely strange to me, since Py_Initialize is provided by libpython.


FWIW, I just checked that with upstream Python te module is linked this way, when configured as mentioned in the upstream bug and built from source.

Comment 7 Fedora Update System 2015-07-01 17:49:05 UTC
kig-15.04.3-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/kig-15.04.3-1.fc22

Comment 8 Maurizio Paolini 2015-07-01 20:43:49 UTC
(In reply to Fedora Update System from comment #7)
> kig-15.04.3-1.fc22 has been submitted as an update for Fedora 22.
> https://admin.fedoraproject.org/updates/kig-15.04.3-1.fc22

The proposed update works fine for me!  Thank you for tracking the problem
down... I couldn't understand the discussion (both downstream and upstream),
I hope nobody got hurt in the process :-)

Comment 9 Fedora Update System 2015-07-03 18:51:57 UTC
Package kig-15.04.3-1.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kig-15.04.3-1.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-11142/kig-15.04.3-1.fc22
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2015-07-18 02:11:04 UTC
kig-15.04.3-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Rex Dieter 2017-12-28 14:54:13 UTC
*** Bug 1529346 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.