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

actor.slicer function segmentation faults when using a int64 data type as input #851

Open
pjsjongsung opened this issue Dec 4, 2023 · 9 comments
Labels
type:Bug Fix Something isn't working type:Discussion

Comments

@pjsjongsung
Copy link

Description

If fury.actor.slicer is passed a int64 type image, it throws a segmentation fault. Not a critical bug, but could be confusing to users if they encounter this.

Way to reproduce

from fury.actor import slicer
import numpy as np
temp = np.ones((20, 20, 20)).astype(np.int64)
slicer(temp, np.eye(4))

Operating system is ubuntu 20.04. Tested with python 3.9 and 3.10

@Preetam-Das26
Copy link

Preetam-Das26 commented Jan 26, 2024

I would like to work on this issue.
@pjsjongsung

@xantric
Copy link
Contributor

xantric commented Mar 4, 2024

is this issue still reproducible? @pjsjongsung ... The given code works perfectly fine for me

@skoudoro
Copy link
Contributor

skoudoro commented Mar 4, 2024

Yes, I just reproduce it @IshanKamboj. I am using macOS, maybe it is specific to the OS which would be strange. I tried with different python version and still the issue

@xantric
Copy link
Contributor

xantric commented Mar 4, 2024

Yes, I just reproduce it @IshanKamboj. I am using macOS, maybe it is specific to the OS which would be strange. I tried with different python version and still the issue

Ohh it works perfectly fine on windows. I think the issue is specific to linux/macOS.

@pjsjongsung
Copy link
Author

Could it be related to python version? I just tested on python 3.8 and 3.10 on windows and still get the fault.

@skoudoro
Copy link
Contributor

skoudoro commented Mar 4, 2024

We both tested on different python version / OS and we still get segfault.

only @IshanKamboj do not get a segfault. Maybe he can share its full setup. (OS, python version, all packages versions / environment, etc...)

@xantric
Copy link
Contributor

xantric commented Mar 5, 2024

I am using windows 11 as my OS and python version : 3.10.11

Following are the package versions:
fury==0.10.0
vtk==9.3.0
numpy==1.26.2
scipy==1.11.4
Pillow==10.0.1
pygltflib==1.16.1
packaging==23.2
aiohttp==3.9.1

@robinroy03
Copy link
Member

robinroy03 commented Mar 5, 2024

I reproduced the segmentation fault on both Ubuntu(WSL) and Windows 11.

Ubuntu(WSL) mentions segmentation fault on terminal but windows powershell terminates the code abruptly.

from fury.actor import slicer
import numpy as np
temp = np.ones((20, 20, 20)).astype(np.int64)
slicer(temp, np.eye(4))
print("this won't be printed")

The last line won't be printed on Windows if tried. The code crashes.
Running $? after the python script on windows powershell will show False, meaning the code crashes.

PS C:\Users\Robin Roy\Desktop> python testing_bug.py
PS C:\Users\Robin Roy\Desktop> $?
False

People using Windows who run into this will certainly find it super confusing to debug.

@xantric
Copy link
Contributor

xantric commented Mar 6, 2024

@robinroy03 is right ... The code ends abruptly and does not show segmentation fault on the terminal in windows.

@skoudoro so to solve this we can just check if data array is passed as int64 and raise a ValueError inside the slicer function in actor.py

@WassCodeur WassCodeur added type:Bug Fix Something isn't working type:Discussion labels Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Bug Fix Something isn't working type:Discussion
Projects
None yet
Development

No branches or pull requests

6 participants