Hi,
I'm testing some programs and get the following error when using the Python interface
free(): double free detected in tcache 2
Aborted
So i've tracked down the problem and I got this minimal example:
import clingo
asp_program = ["{a}. {b}."]
ctl = clingo.Control(["--models=0"])
for clause in asp_program:
ctl.add('base', [], clause)
ctl.ground([("base", [])])
opt = " "
with ctl.solve(yield_=True) as handle:
for m in handle:
opt = m
print(opt)
handle.get()
print(opt) # <---- this
Note that if I remove the last print (denoted with <---), the program works well and no errors are thrown.
Note also that if I remove the print inside the for loop the program works as well.
> clingo --version
clingo version 5.5.2
Address model: 64-bit
libclingo version 5.5.2
Configuration: with Python 3.9.12, without Lua
libclasp version 3.3.8 (libpotassco version 1.1.0)
Configuration: WITH_THREADS=1
Copyright (C) Benjamin Kaufmann
Honestly, I'm not sure whether this is problem is from clingo or Python itself...
Hi, I'm testing some programs and get the following error when using the Python interface
So i've tracked down the problem and I got this minimal example:
Note that if I remove the last print (denoted with
<---
), the program works well and no errors are thrown. Note also that if I remove the print inside the for loop the program works as well.Honestly, I'm not sure whether this is problem is from clingo or Python itself...