ContinuumIO/anaconda-issues

scipy.io.loadmat crashing python in version 2.5.0

bamboocza opened this issue · 20 comments

As title states, I didn't get the loadmat method to work without causing the interpreter to crash. I reproduced the issue on different system too, although it works fine on 2.4.1 and 3.x versions.

Can you give more information about the crash. Which version of Scipy are you using? I assume 0.17.0. Is this correct? Which OS and version of Python are you using? What is the exact command that causes Python to crash? Is there a traceback? A segfault? Thanks

Hello,
the OS is windows 10. Here
http://stackoverflow.com/questions/35238878/python-stops-working-on-loadmat's
my query on stackoverflow which should tell you everything I know.

2016-02-10 4:29 GMT+01:00 Ilan Schnell notifications@github.com:

Can you give more information about the crash. Which version of Scipy are
you using? I assume 0.17.0. Is this correct? Which OS and version of Python
are you using? What is the exact command that causes Python to crash? Is
there a traceback? A segfault? Thanks


Reply to this email directly or view it on GitHub
#650 (comment)
.

SMeo commented

I have absolutely the same problem. Win 10, Anaconda 2.5.0 and scipy.io.loadmat(...)
I've debugged down to mio5.py line 217:
mdtype, byte_count = self._file_reader.read_full_tag()
I can't event step into this function.
It seems the problems are in memory access by mio_utils lib

Any ideas ?

Update: I reproduced the issue on my Win 7 workstation

Update: I downgraded to anaconda 2.4.1 and the issue was resolved.
Then I updated scipy to the latest version and the issue reproduced.
Finally I downgraded scipy only to version 0.16.0-np110py27_0 and the issue disappeared again.
Thus scipy version matters

I see this problem on a scipy 0.17.0, 32 bit Python 2.7 build, but not on a 64 bit Python 3.4 build. Here's a link to one of my Appveyor builds with more information. The test that it fails on calls loadmat.

Edit: Also fails on 64 bit Python 2.7.

The code on SO crashes for me, using Miniconda2 on Win7 (64-bit). Python 2.7.11, scipy 0.17.0.

Python 2.7.11 |Continuum Analytics, Inc.| (default, Jan 29 2016, 14:26:21) [MSC
v.1500 64 bit (AMD64)] on win32

Downgrading to 1.16.0 solved the issue. conda install scipy==0.16.0.
I first assumed this was a Windows issue, but it turns out my Linux install was running 0.16.0.

Saw this on Windows 7, Python 2.7, scipy 0.17.0. Also an Anaconda install. @roessland 's fix worked for me too.

same here, downgrading scipy worked. does not depend on Windows version, I have Win10.

oxsem commented

It works, but its workaround, not solution. It would be great to fix the issue, because SciPy 0.17 provides some new features which I need to use.
BTW, WinPython distribution is compatible with the latest version of SciPy, and scipy.io.loadmat works just fine, though I would still prefer Anaconda, due to better quality of matplotlib figures.

same here. Win 10 doesn't work. Repos in heroku and ubuntu work fine. It should be the issue with scipy 0.17 and windows system.

Windows 7 , Python 3.5.1, scipy 0.17.0

Same issue, to reproduce the bug the matfile needs

  • to contain a structure
  • to have a certain size.

Big arrays are fine, it's only when compounded in a structure that they make python blow up.

Below, only the last matfile fails to load :

A = rand(100,50);
B = rand(101,51);
S = struct('A',A,'B',B);
save('E:\2016\01_HoboAcquisition\WIND\A.mat','A') % OK
save('E:\2016\01_HoboAcquisition\WIND\AB.mat','A','B') % OK
save('E:\2016\01_HoboAcquisition\WIND\S.mat','S') % OK
Big = rand(26499870,2);
save('E:\2016\01_HoboAcquisition\WIND\Big.mat','Big') % OK
A = rand(26499870,1);
B = rand(26499870,1);
save('E:\2016\01_HoboAcquisition\WIND\BigAB.mat','A','B') % OK
BigS = struct('A',rand(26499870,1),'B', rand(26499870,1));
save('E:\2016\01_HoboAcquisition\WIND\BigS.mat','BigS') % fail

I have the same issue. Windows 10 pro, Anaconda 2.5 64-bit,

conda install scipy=0.17.0
ipython
import scipy.io as sio
sio.test() 
<Python has crashed popup>
conda install scipy=0.16.1
ipython
import scipy.io as sio
sio.test() 
<Python has crashed popup>
conda install scipy=0.16.0
ipython
import scipy.io as sio
sio.test() 
<All Tests Pass>

All the scipy's work on Ubuntu 15 with Anaconda 2.5 64-bit

Same issue on both Windows 7 and Windows Server 2012 R2. Both 64 bit. Downgrading to scipy 0.16.0 fixes the issue.

Same issue here. Windows 10(64-bit), Python 2.7.11, Scipy 0.17.0, Miniconda2.
Python crashed when use scipy.io.loadmat().
Downgrading scipy to 0.16.0 solved the issue!conda install scipy==0.16.0

Same here
Windows 7 (64-bit)
Anaconda distribution 4.0 (Python 2.7.11), Scipy 0.17.0.
I have also downgraded to scipy 0.16.0 to resolve issue.

I am sorry to report: same...
Windows 7 (64-bit)
Anaconda 2.3.0 (Python 2.7.11); IPython 4.1.2, Scipy 0.17.0
I had to downgrade as well to Scipy 0.16.0, to load a .mat file

Same here.

Python 2.7.11
Anaconda 4.0.0 (64-bit)
[MSC v.1500 64 bit (AMD64)]
scipy-0.17.0 (build: np110py27_1)

I can confirm, too, that after downgrading to scipy 0.16.0, I can load .mat files.

I'm still getting this error with the newest scipy release on Anaconda, Windows 7 64-bit, scipy 0.17.1. I was able to downgrade back to scipy 0.16.0 and keep working. Scipy 0.17.x has some features that I would like to be able to take advantage of, but am unable to do so until Anaconda gets their distribution fixed.

from conda info
platform: win-64
conda version: 4.0.8
conda-build version: 1.20.3
python version: 2.7.11.final.0

You might try nomkl. See this blog post:

https://www.continuum.io/blog/developer-blog/anaconda-25-release-now-mkl-optimizations

On Tue, Jun 14, 2016 at 11:22 AM CompPhysChris notifications@github.com
wrote:

I'm still getting this error with the newest scipy release on Anaconda,
Windows 7 64-bit, scipy 0.17.1. I was able to downgrade back to scipy
0.16.0 and keep working. Scipy 0.17.x has some features that I would like
to be able to take advantage of, but am unable to do so until Anaconda gets
their distribution fixed.

from conda info
platform: win-64
conda version: 4.0.8
conda-build version: 1.20.3
python version: 2.7.11.final.0


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub
#650 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AACV-TtauO-xlRHGf9PlslW5g99bePbSks5qLtUngaJpZM4HU5U7
.

I also have the same problem.
python version :2.7, scipy :0.17.0.
When I use sio.loadmat(matfn), it'll be crashed. I have searched all the same problem, and we can solve the problem by downgrading the scipy version to 0.16.0 or update the scipy. I succeed using loadmat function when I updated the version to 0.19.0, However, I still have no idea what's wrong with the version 0.17.0 .

I think it is best to delete the ".local" folder in your home directory instead of playing around with the versions of installed packages. so, rm -r ~/.local should do the trick in Ubuntu.