-
Notifications
You must be signed in to change notification settings - Fork 69
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
Segfault extending by inheritance in python #165
Comments
The bug also affects ObserverFeatures and Modules written in python. However, source.add(MySourceFeature()) will fail; sf = MySourceFeature() will work. The reason is that in the former case the object is deleted by python. Monkey patching ( swig/swig#723) might be a solution to disown the created object first but is surely an ugly solution. |
It is the same issue I had almost 3 years ago, see #27 . Disown is, I agree, an ugly solution, while the one where the python is taking care of the ownership is what I regularly use and it works. I would write a recommendation how to handle this on the wiki, section about extending CRPropa from Python, and close the issue. I'm afraid we cannot do more. |
I had this problem, too. I agree with Andrej let's just put an explanation in the wiki and maybe a comment in the example for the source feature. So when the example is used people will know why the object has to be created outside of the class attributes. |
Okay, I will add a tag `Won't fix' to the bug to mark that we won't work on it, but I don't think that we should close such issues. If #27 hadn't been closed it would have saved me the time figuring out the problem. |
This is from the examples and reproduces the bug
occures not always; occures in single threaded and multi threaded execution
The text was updated successfully, but these errors were encountered: