Skip to content
This repository has been archived by the owner on May 17, 2020. It is now read-only.

Segmentation fault during fir_convolve_impl_mirror_mirror_antisymmetric_avxfmaN #13

Closed
ssidorenko opened this issue Oct 10, 2017 · 6 comments
Assignees

Comments

@ssidorenko
Copy link

ssidorenko commented Oct 10, 2017

I've encoutered segmentation faults while running code in a ipython notebook using fastfilters to validate a model to be used in ilastik. I've managed to narrow it down to this minimal case to trigger it:

import fastfilters
import numpy as np

data = np.random.normal(size=(200, 200))
data = fastfilters.hessianOfGaussianEigenvalues(data, window_size=3.5, scale=3.5)
data = fastfilters.structureTensorEigenvalues(data, window_size=3.5, innerScale=3.5, outerScale=3.5)

It seems to occur in fir_convolve_impl_mirror_mirror_antisymmetric_avxfmaN as seen in the crash report attached below.

python3.6_2017-10-10-123502_MacBook-Pro.crash.txt

This was using fastfilters compiled from the latest master at the time of this post: 1f8d11a

@svenpeter42 svenpeter42 self-assigned this Oct 10, 2017
@svenpeter42
Copy link
Owner

Thanks for the detailed report. I've heard about this bug before but so far no one had been able to produce a small testcase!

I'm busy teaching this week but will try to fix it afterwards.

@stuarteberg @k-dominik I think this is the bug we've run into a few times already.

@svenpeter42
Copy link
Owner

Running hessianOfGaussianEigenvalues twice also reliably triggers this segfault for me.
I think the first call overwrites some memory which triggers the fault in the second call.

@ssidorenko
Copy link
Author

ssidorenko commented Oct 10, 2017

Interestingly, using two consecutive hessianOfGaussianEigenvalues but with scale and windowSize set to 1.2 (or lower) does not trigger the segmentation fault.

Compiling with FMA and AVX disabled still gives a segmentation fault.

@svenpeter42
Copy link
Owner

I think in this case the problem is that you try to filter the result of an eigenvalue filter again. Fastfilters will assume 3d convolution for the second one and then fault because one axis only has a length of two.

Did you want to do this or is the testcase just coincidentally faulting and the real error is somewhere else?

@ssidorenko
Copy link
Author

Indeed, the testcase is coincidentally faulting. I'll try to make another testcase closer to what I wanted to do.

@ssidorenko
Copy link
Author

ssidorenko commented Oct 11, 2017

After more investigation, it turns out that the downsampled data I was using for development was too small (3D array with depth of 12 while computing LoG with window_size=4). I think that #14 should then be the only change needed.

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

No branches or pull requests

2 participants