Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sigaltstack: Cannot allocate memory #36

Open
saxelsen opened this issue Feb 12, 2018 · 6 comments
Open

Sigaltstack: Cannot allocate memory #36

saxelsen opened this issue Feb 12, 2018 · 6 comments

Comments

@saxelsen
Copy link

saxelsen commented Feb 12, 2018

Hi,

I have been using your library a lot recently and it's great. Yesterday I decided to do a clean install of my environment, so I removed my virtual environment and recreated it and installed cython, numpy and pyfasttext.

Ever since I removed the virtual environment and recreated it, whenever I try to import pyfasttext

import pyfasttext as pft

my python process immediately exits and outputs sigaltstack: Cannot allocate memory.
I have previously removed and re-installed it plenty of times without any issues.

Have you seen or heard about this behavior before?

If I install and run it in a Docker container there is no problem, making me think it might be my python installation that has somehow corrupted. But I have not changed anything inbetween reinstalling pyfasttext. I am running Python 3.5.2 on a Mac with High Sierra 10.13.3, if that helps.

Thanks.

@saxelsen
Copy link
Author

saxelsen commented Feb 12, 2018

I have uncovered what seems to be causing the problem, although I don't know why.

When I pip install pyfasttext, I install cython and numpy before.
It seems that cysignals is not a requirement for cython on Mac OS X, whereas it is installed as a dependency (version 1.6.6) if I install it in Docker based on an Ubuntu image.

Now, I have noticed that when I install pyfasttext using pip on Mac OS X, it reads the requirement for cysignals and installs the latest (which is 1.6.7). This seems to be the root cause for the error I am getting above. If I install cysignals-1.6.6, pyfasttext works.

The solution for me then, is to install cython, numpy and cysignals-1.6.6 before installing pyfasttext.

There seems to be something in cysignals-1.6.7 that breaks pyfasttext for me on Mac OS X. Trying the same cysignals version in the Docker Ubuntu container does not break it.

@vrasneur
Copy link
Owner

Hello @saxelsen89,

Thanks for the detailed bug report!

Can you file an issue in the cysignal bug tracker ? (here: https://github.com/sagemath/cysignals/issues)

I should add a way to disable cysignals at compile time...

Thanks,

Vincent

@kadir-gunel
Copy link

@saxelsen89 could you please share your dockerfile ? I am trying to install pyfasttext on docker but unfortunately it crashes during install.

@saxelsen
Copy link
Author

saxelsen commented May 17, 2018

@kadir-gunel I install in several steps:

pip install cython
pip install cysignals==1.6.6
pip install pyfasttext

Alternatively, if you use requirements.txt file, you can do

pip install cython
pip install cysignals==1.6.6
pip install -r requirements.txt

or make 2 requirement.txt files and install one, then the other.

This is the Dockerfile for testing:

# Initial image
FROM ubuntu:16.04

# Install Ubuntu dependencies
RUN apt-get update && apt-get install -y \
	git \
    curl \
    ssh \
    nano \
    python3-pip \
    python3-dev

# Install Python dependencies
RUN pip3 install --upgrade pip
RUN pip3 install cython==0.27.3 cysignals==1.6.7 numpy
RUN pip3 install pyfasttext

CMD /bin/bash

@kadir-gunel
Copy link

kadir-gunel commented May 17, 2018

@saxelsen89 Thank you for fast reply. Unfortunately, I still get error.

Complete output from command python setup.py egg_info:
Compiling src/pyfasttext.pyx because it depends on /usr/local/lib/python3.5/dist-packages/cysignals/signals.pxd.
[1/1] Cythonizing src/pyfasttext.pyx
/bin/sh: 1: svnversion: not found
/bin/sh: 1: svnversion: not found
non-existing path in 'numpy/distutils': 'site.cfg'
Could not locate executable gfortran
Could not locate executable f95
Could not locate executable ifort
Could not locate executable ifc
Could not locate executable lf95
Could not locate executable pgfortran
Could not locate executable f90
Could not locate executable f77
Could not locate executable fort
Could not locate executable efort
Could not locate executable efc
Could not locate executable g77
Could not locate executable g95
Could not locate executable pathf95
Could not locate executable nagfor
don't know how to compile Fortran code on platform 'posix'
Running from numpy source directory.
/tmp/easy_install-vggfnttt/numpy-1.14.3/setup.py:369: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
/tmp/easy_install-vggfnttt/numpy-1.14.3/numpy/distutils/system_info.py:624: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
/tmp/easy_install-vggfnttt/numpy-1.14.3/numpy/distutils/system_info.py:624: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.

This list of errors continues and at the end gives :

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-a8m0918b/pyfasttext/

As I understand there are missing packages like gfortran but even I install them I get the same result.
Any idea ?
Thank you in advance

@kadir-gunel
Copy link

Resolved! For me the main problem was determining the version of the cython!

cython==0.27.3 solved my issue.

Thank you again !
Cheers
Kadir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants