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 an array of records used as a parameter #732

Closed
ericsson49 opened this issue Sep 16, 2023 · 1 comment
Closed

Segmentation fault when an array of records used as a parameter #732

ericsson49 opened this issue Sep 16, 2023 · 1 comment
Assignees
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@ericsson49
Copy link

ericsson49 commented Sep 16, 2023

Using MiniZinc Version 2.7.6 905175540, trying to compile the following code

type State = record(0..1: e);

predicate trans_closure(array[0..1] of var State: sts) =
  (sts[0].e + 1 == sts[1].e)
  ;

array[0..1] of var State: sts;
constraint trans_closure(sts);

results in

MiniZinc error: Memory violation detected (segmentation fault).
This is a bug. Please file a bug report using the MiniZinc bug tracker.

Simpler versions, like inlined predicate or predicate w/o array of records work okay.
So, the problem looks like caused by using an array of records a a predicate parameter.

@ericsson49
Copy link
Author

Update.
The following modification works fine too (record(0..1: e) replaced with record(int: e))

type State = record(int: e);

predicate trans_closure(array[0..1] of var State: sts) =
  (sts[0].e + 1 == sts[1].e)
  ;

array[0..1] of var State: sts;
constraint trans_closure(sts);

@cyderize cyderize added the bug label Sep 21, 2023
@Dekker1 Dekker1 self-assigned this Sep 27, 2023
@Dekker1 Dekker1 added the resolved Issue is resolved and the feature or fix will be part of next release label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release
Projects
None yet
Development

No branches or pull requests

3 participants