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

mCRL2xi can be crashed with an incorrect specification #1789

Open
gjveltink opened this issue Oct 27, 2024 · 7 comments
Open

mCRL2xi can be crashed with an incorrect specification #1789

gjveltink opened this issue Oct 27, 2024 · 7 comments
Assignees

Comments

@gjveltink
Copy link

When trying to rewrite 'makeList(-1)' using the following specification within mCRL2xi the application crashes.


map
	makeList: Int -> List(Int);

var
	n: Int;

eqn
	% makeList(n) = if(n <= 0, [], makeList(n - 1) <| n);
	makeList(n) = if(n == 0, [], makeList(n - 1) <| n); % rewrite of 'makeList(-1)' crashes mCRL2xi 

Problem.mcrl2.txt

@mlaveaux
Copy link
Member

When the rewrite system is infinite makeList(-1) ->* makeList(-2) ..., then all kinds of tools can crash due to running out of stack memory (or at some point main memory). In general this is not a recoverable operation although some tools such as the mcrl2ide divert the rewriting to another thread which might be able to avoid this situation.

@gjveltink
Copy link
Author

Yes, I understand that mCRL2xi can crash with this specification, but I seem to remember, that it did not do so in the past. However, maybe I'm confusing this with the behaviour of mcrl2ide.

@gjveltink
Copy link
Author

sorry, closed this inadvertently.

@gjveltink gjveltink reopened this Oct 28, 2024
@mlaveaux mlaveaux self-assigned this Oct 29, 2024
@mlaveaux
Copy link
Member

For mcrl2ide we have only recently added the ability to rewrite data expressions, but from my testing it is at least somewhat robust against this case. Both cancelling the rewriting and letting it continue until it runs out of memory does not crash the mcrl2ide on my machine. I don't think mcrl2xi ever had the ability to not crash with (or abort) infinite rewrites.

@mlaveaux
Copy link
Member

One discussion we had during the mCRL2 meeting is if it would be useful to remove mcrl2xi in favor of just having the mcrl2ide instead of adapting mcrl2xi for the next release. Would this be something that could work for you, or are there features in mcrl2ide that are missing for this to be a good alternative.

@gjveltink
Copy link
Author

I have to admit, that up to now I was not aware of the fact that mcrl2ide now can rewrite data terms. I will try this out in class next week! The only thing that might be missing is the setting of (some of) the different options, that can be set in mcrl2xi.

@gjveltink
Copy link
Author

OK, I have given it a try in mcrl2ide and have observed that, like in mcrl2xi before, I get a syntax error when the "init" clause is missing. :-(

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