Bug 388241 - Cannot use python scripting when compiling from source
Summary: Cannot use python scripting when compiling from source
Status: REOPENED
Alias: None
Product: kig
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: David E. Narvaez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-26 10:23 UTC by Maurizio Paolini
Modified: 2020-05-03 08:06 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kig file exposing the problem (1.50 KB, application/x-kig)
2018-01-15 05:43 UTC, Maurizio Paolini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maurizio Paolini 2017-12-26 10:23:11 UTC
My box is a fully updated fedora 27.  I need to install kig from the Git
tree.  Cmake correctly finds the optional python scripting extension and it
compiles with no problem.
However when trying to enter a python script with one argument kig crashes
with the message:

kig: /usr/include/boost/python/object_core.hpp:425: boost::python::api::object_base::~object_base(): Assertion `Py_REFCNT(m_ptr) > 0' failed.
Comment 1 Burkhard Lück 2017-12-27 14:26:27 UTC
with kig master build from sources i have no crash here
Comment 2 David E. Narvaez 2017-12-27 16:55:14 UTC
Given the known issues Fedora causes with their Python setup (see bug 335965), you will have to open this bug with Fedora first and if they can confirm this is not because of their setup then we'll look into that.
Comment 3 Maurizio Paolini 2017-12-27 17:42:35 UTC
(In reply to David E. Narvaez from comment #2)
> Given the known issues Fedora causes with their Python setup (see bug
> 335965), you will have to open this bug with Fedora first and if they can
> confirm this is not because of their setup then we'll look into that.

Allright... I was unsure about where to file the bug, I decided for bugs.kde.org because I see the problem for a source-compiled (from git master) version of kig, however everything else is "fedora 27".  For example "boost-python" is
boost-python-1.64.0-4.fc27.i686.

Here is the reference of the bug entry in bugzilla.redhat.com: https://bugzilla.redhat.com/show_bug.cgi?id=1529346
Comment 4 Rex Dieter 2017-12-28 14:55:14 UTC
dup of bug #335965

Poke, there's a fix available,
https://git.reviewboard.kde.org/r/126549/

*** This bug has been marked as a duplicate of bug 335965 ***
Comment 5 Maurizio Paolini 2017-12-31 07:44:04 UTC
(In reply to Rex Dieter from comment #4)
> dup of bug #335965
> 
> Poke, there's a fix available,
> https://git.reviewboard.kde.org/r/126549/
> 
> *** This bug has been marked as a duplicate of bug   ***

Actually, this is a distinct issue.  Applying the patch that solves bug 335965
does not solve this problem (present also for scripts that do not use Math
Comment 6 Rex Dieter 2017-12-31 12:09:15 UTC
my apologies, reopening
Comment 7 Maurizio Paolini 2018-01-15 05:43:07 UTC
Created attachment 109867 [details]
kig file exposing the problem

This kig file contains a very simple python script depending upon
a numeric label:

def calc( arg1 ):
    x = arg1.coordinate().x
    return DoubleObject (x)
Comment 8 Maurizio Paolini 2018-01-15 05:54:22 UTC
This problem seems to appear when compiling from git sources when compiled
against boost-devel-1.63.0 or later.
In this version of boost the file /usr/include/boost/python/object_core.hpp
contains an assert at line 425:

-----------------------------------------------
inline api::object_base::~object_base()
{
    assert( Py_REFCNT(m_ptr) > 0 );
    Py_DECREF(m_ptr);
}
-----------------------------------------------

that fails.  It took long to track the problem because the kig package compiled in a rpm fedora package is compiled with build flag -DNDEBUG which disables asserts.  Can you reproduce the problem bu opening the kig file provided as attachment?