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 writing the final solution in the same file as the initial solution #13

Open
avangogo opened this issue Jan 21, 2020 · 3 comments

Comments

@avangogo
Copy link

I am using CSDP 6.1.1 via the linux package.

The following command line gives a segmentation fault.
csdp problem solution solution
It is a weird edge case that is easy to avoid but maybe it could be fixed or properly caught, so I post it here.

@avangogo
Copy link
Author

avangogo commented Jan 21, 2020

I investigated further and I found out that the bug was actually coming from an incorrect initial solution. This seems to happen when solution contains only the vector y.

If problem contains for instance:

2
2 
2 2
30.0 40.0  
0 1 1 1 1.0
0 2 2 2 1.0 
1 1 1 1 1.0
2 2 1 1 1.0
2 2 2 2 1.0

And solution contains

1 1

Then csdp problem solution solution gives a segmentation fault.
Moreover, if solution does not end with a newline, then the program seems to go in an infinite loop.

@brianborchers
Copy link
Contributor

Not having a newline on the last line of the file is a problem that should be easy to detect an handle.

An incomplete initial solution is very problematic since there's no obvious approach to set values for the missing parts of the solution that make any sense. If you tried to treat the missing matrix variables X and Z as 0, the algorithm would crash since these aren't positive definite. The algorithm really requires an initial solution with X and Z strictly positive definite.

readprob could be fixed to treat missing X and Z matrices as 0, but then the code would crash immediately with an error related to the infeasible initial solution.

Thanks for reporting the bugs. I'm sorry that what you may have been trying to do with incomplete solutions isn't workable, but I will work to make readprob more tolerant of these issues. It will probably be May before I can work on this.

@avangogo
Copy link
Author

avangogo commented Feb 7, 2020

Thank you for your answer.
To be clear about what I mean, I do not expect csdp to run on incomplete initial solutions. The issue I raised was that the command line could make an infinite loops/segmentation fault where it should terminate with an appropriate error message (as it actually does on most bad inputs). This seems quite minor and probably be easy to fix.

The particular case in which I appened to run csdp on an incomplete input was coming from a bug on my side.

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

2 participants