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 iterating over Control.symbolic_atoms.by_signature() #389

Closed
daveraja opened this issue Sep 13, 2022 · 1 comment
Assignees
Labels

Comments

@daveraja
Copy link

Iterating over a signature where there are no matching entries will cause a seg fault for the latest Clingo. So, the following is fine with Clingo 5.5 but seg faults with Clingo 5.6.0:

from clingo import Control, Number, String, Function, SymbolType
from clingo.ast import parse_string, ProgramBuilder

prgstr = """x(1)."""
ctrl = Control()

with ProgramBuilder(ctrl) as pb:
    parse_string(prgstr, pb.add)
ctrl.ground([("base", [])])

for sa in ctrl.symbolic_atoms.by_signature("x", 1, False):
    print(f"{sa}")
@rkaminsk
Copy link
Member

Definitely a bug. Maybe something mishap when refactoring code. It should not be difficult to fix. Will take care of it tomorrow.

@rkaminsk rkaminsk self-assigned this Sep 13, 2022
@rkaminsk rkaminsk added the bug label Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants