Giter Site home page Giter Site logo

BUG: segfault when calling `CouplingAnalysis.mutual_information()` and `CouplingAnalysis.information_transfer()` about pyunicorn HOT 5 CLOSED

fkuehlein avatar fkuehlein commented on July 22, 2024
BUG: segfault when calling `CouplingAnalysis.mutual_information()` and `CouplingAnalysis.information_transfer()`

from pyunicorn.

Comments (5)

fkuehlein avatar fkuehlein commented on July 22, 2024

#162 looks like it might be related to this issue. The cython/C functions

_cross_correlation_max()/_cross_correlation_max_fast()

and

_cross_correlation_all()/_cross_correlation_all_fast()

used in CouplingAnalyis should therefore be looked into as well.

from pyunicorn.

ntfrgl avatar ntfrgl commented on July 22, 2024

The test suite passes on the freshly installed master branch for me, hence I am unable to reproduce this issue at the moment. You might want to look at my recent commits touching these files and see if reverting them changes your situation: 6dc0f63, 402197f, 21b0b6f. For example, if reverting the third commit resolved your issue, then that might indicate a platform-specific problem with the ALLOCA macro defined there.

funcnet/_ext/src_numerics.c::_get_nearest_neighbors_fast() is the last function in that file which has not been Cythonized yet. It would be great if you could port it, examine the remaining C functions (compare them against the legacy Weave code in the original commits and the current Cython versions), and delete the C file.

from pyunicorn.

fkuehlein avatar fkuehlein commented on July 22, 2024

That's curious. I did a fresh install on a new conda environment and still get the segfaults wenn running the test suite via tox.

I admit my system is not the latest, running on macOS 10.13, not sure if that might be a problem. I still have a conda=23.3 and python=3.10 though.

I could not do full reverts of the above commits because that breaks the cython compilation on reinstall, so I tried reverting only changes concerning funcnet (including setup.py and core/_ext/types.{pxd|py}) for all the above commits:

which all compiled fine, but didn't fix the segfault.

I also tried python 3.9 and 3.11 but no difference. (won't install on python=3.8 because numpy=1.25 needs python>=3.9)

Any more ideas at this point? Otherwise I will try porting funcnet/_ext/src_numerics.c::_get_nearest_neighbors_fast() to cython and see if that fixes it.

Thanks for the hint by the way, didn't realize funcnet/_ext/src_numerics.c::_cross_correlation_{max|all}_fast() were unused. _symmetrize_by_absmax_fast() is also still in there though.

from pyunicorn.

ntfrgl avatar ntfrgl commented on July 22, 2024

This sounds like a bug whose manifestation is compiler/platform-dependent. Cythonizing would therefore probably be of comparable effort to debugging the C version, and reducing the language diversity would be beneficial independently of fixing this bug. Sorry, I overlooked _symmetrize_by_absmax_fast(), but the same reasoning applies for it.

I fixed the Numpy issue in a9a70b2.

from pyunicorn.

fkuehlein avatar fkuehlein commented on July 22, 2024

Thanks for fixing the numpy issue! Will look into cythonizing the remaining C functions for CouplingAnalysis as soon as possible.

from pyunicorn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.