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

Comprehension segfault #779

Closed
wldhx opened this issue Jan 8, 2024 · 1 comment
Closed

Comprehension segfault #779

wldhx opened this issue Jan 8, 2024 · 1 comment
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@wldhx
Copy link

wldhx commented Jan 8, 2024

Hi, here's a repro:

array[1..2] of var set of 1..2: xy_shapes;

array[int] of var opt set of 1..2: x_roff =
    [ {1}
    | l in 1..2, sh in xy_shapes[l] ];
MiniZinc error: Memory violation detected (segmentation fault).
This is a bug. Please file a bug report using the MiniZinc bug tracker.
> minizinc --version
MiniZinc to FlatZinc converter, version 2.8.2
Copyright (C) 2014-1980 Monash University, NICTA, Data61
@cyderize cyderize added the bug label Jan 16, 2024
@cyderize
Copy link
Member

Unfortunately MiniZinc doesn't currently support opt set types.

In this case the comprehension iterates over a var set, and gets transformed into an array of opt under the hood - but since the comprehension returns {1} it tries to create a var opt set which is not supported.

Of course, this shouldn't crash with a segfault, so we'll have to fix the type checker to properly disallow the var opt set declaration, and the var comprehension with the set inside. In the future, we may have a look at trying to add support for opt sets so that this would be allowed.

@cyderize cyderize added the resolved Issue is resolved and the feature or fix will be part of next release label Jan 25, 2024
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

2 participants