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

'Segmentation fault' when delete IPhaser pointer both Cpp and Python #8

Open
TerryFast opened this issue May 9, 2023 · 1 comment

Comments

@TerryFast
Copy link

I run on the code on CUDA 11.2 with GCC 9.4 on Ubuntu OS.
The program can make the right reconstruction result. In src/examples/testEPIE.cpp, after write the result to disk "phaser->writeResultsToDisk; ", the program delete the pointer of class IPhaser "delete phaser; ", then the program got the "Segmentation fault".
I try to figure its location, but have no idea. Maybe the CUDA version make the problem. Would you please help me to figure it out?

@TerryFast
Copy link
Author

I found that after the final iteration of conjugate gradient, the code at CudaSmartPtr.cpp line 55 'if (--m_ptr->m_refCount == 0) delete m_ptr; ' causes this Segmentation fault.
I think that the program deletes the 'm_ptr' at the final iteration, then after writing the result to disk ,the program deletes the 'm_ptr' once again at the file 'IPhaser.cpp' line 66 'if(m_diffractions) delete m_diffractions; '. This deleting operation calls the CudaSmartPtr.cpp line 55 of deleting 'm_ptr' .

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

1 participant