Menu

#506 Avogadro Archlinux and Fedora distribution packages crash

v_1.0.1
closed
5
2012-09-12
2010-11-14
Anonymous
No

Avogadro Archlinux and Fedora 14 distribution packages (both are 1.0.1) crash immediately after launch with the error message:
$ avogadro
The _C_API object in the sip python module is invalid.
Could not initialize SIP API !
terminate called after throwing an instance of 'boost::python::error_already_set'
Aborted
I installed also http://avogadro.openmolecules.net/nightly/linux/unstable/Avogadro-1.1-trunk-Linux-x86-Install in HOME and it works.

Discussion

  • Konstantin Tokarev

    1. Thank you for testing of Linux binary package. It's the only way of Avogadro installation on Linux which does not depend on system configuration and other external factors

    2. Please submit bugs to maintainers of these distributions. I guess there is a mismatch of SIP versions (e.g. you are using Avogadro 1.0.1 with SIP 4.11 which will not work)

     
  • Edward Sheldrake

    Fedora 14 has sip 4.10.5 and python 2.7 - the problem appears to be the pycapsule change mentioned in the NEWS file for sip 4.10.4 - which is only used with python 2.7. I removed SIP_USE_PYCAPSULE from siplib/sip.h, and rebuilt sip, and avogadro then starts up.

     
  • Edward Sheldrake

    The Fedora 14 package is now fixed, the patch is at https://bugzilla.redhat.com/show_bug.cgi?id=642248

     
  • Anonymous

    Anonymous - 2010-12-18

    The redhat patch not working on archlinux. So i mixed this with the gentoo patch
    http://bugs.gentoo.org/335644

    Here is the patch:

    CUT HERE

    --- avogadro-1.0.1/cmake/modules/PythonDeps.cmake.oirgin 2010-05-02 18:31:22.000000000 +0200
    +++ cmake/modules/PythonDeps.cmake 2010-12-18 17:28:13.920000007 +0100
    @@ -59,10 +59,14 @@
    if (EXISTS ${PYTHON_INCLUDE_PATH}/sip.h)
    message(STATUS "Found sip.h header...")
    execute_process(COMMAND sip -V OUTPUT_VARIABLE SIP_VERSION)
    - if (${SIP_VERSION} VERSION_GREATER "4.8")
    - message(STATUS "using sip version 4.8 or above...")
    - add_definitions( -DSIP_4_8 )
    - endif (${SIP_VERSION} VERSION_GREATER "4.8")
    +
    + if (NOT ${SIP_VERSION} VERSION_LESS "4.11")
    + message(STATUS "using sip version 4.11 or above...")
    + add_definitions( -DSIP_4_11 -DSIP_4_8 )
    + elseif (NOT ${SIP_VERSION} VERSION_LESS "4.8")
    + message(STATUS "using sip version 4.8 or above...")
    + add_definitions( -DSIP_4_8 )
    + endif (NOT ${SIP_VERSION} VERSION_LESS "4.11")
    else (EXISTS ${PYTHON_INCLUDE_PATH}/sip.h)
    message(STATUS "sip.h header NOT found - Python support disabled")
    # message(STATUS "debian/ubuntu: install the python-sip4-dev package.")
    --- avogadro-1.0.1/libavogadro/src/python/sip.cpp.orig 2010-12-18 18:27:25.786667013 +0100
    +++ avogadro-1.0.1/libavogadro/src/python/sip.cpp 2010-12-18 18:27:34.706666845 +0100
    @@ -61,13 +61,20 @@
    std::cout << "Could not find the _C_API entry in the sip python module dictionary." << std::endl;
    return false;
    }
    -
    +#ifdef SIP_USE_PYCAPSULE
    + if (!PyCapsule_IsValid(sip_capi_obj.ptr(), "sip._C_API")) {
    +#else
    if (!PyCObject_Check(sip_capi_obj.ptr())) {
    +#endif
    std::cout << "The _C_API object in the sip python module is invalid." << std::endl;
    return false;
    }

    +#ifdef SIP_USE_PYCAPSULE
    + sip_API = reinterpret_cast<const sipAPIDef*="">(PyCapsule_GetPointer(sip_capi_obj.ptr(), "sip._C_API"));
    +#else
    sip_API = reinterpret_cast<const sipAPIDef*="">(PyCObject_AsVoidPtr(sip_capi_obj.ptr()));
    +#endif

    return true;
    }
    @@ -204,7 +211,11 @@
    sipWrapper *wrapper = reinterpret_cast<sipWrapper*>(obj_ptr);
    #endif
    // return the C++ pointer
    +#ifdef SIP_4_11
    + return sip_API->api_get_address(wrapper);
    +#else
    return wrapper->u.cppPtr;
    +#endif
    }

    QClass_converters()

    END

    zeld

     
  • Anonymous

    Anonymous - 2010-12-18

    sorry but indentation it's not working :| i'm waiting for reopening the avogadro bug on archlinux bugzilla and committing the patch.

     
  • Marcus D. Hanwell

    There is a proposed patch that fixes this, based on your proposal. I have confirmed that things work correctly on the latest Arch with the latest SIP package.

     
  • Marcus D. Hanwell

    The patch is applied in master and 1.0. This will be in the 1.0.2 release coming soon. Thanks!

     
  • Nobody/Anonymous

    jIG02g dieqdciwdprn, [url=http://ulgkxumefnax.com/]ulgkxumefnax[/url], [link=http://arebwwalwrto.com/]arebwwalwrto[/link], http://qeivjenzsfdc.com/