Commit 9ad062b2 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Fix two spurious segfaults in test cases for the Python interface.

* wrap/python/tests/setxor.py, wrap/python/tests/bddnqueen.py:
Clean all used bdd variables before calling bdd_done(), so that
bdd_delref() is never called after bdd_done().  In NDEBUG builds,
bdd_delref() does not check whether the BuDDy is running or not,
and calling it after bdd_done() will crash.
parent 0caf51ab
2011-04-09 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Fix two spurious segfaults in test cases for the Python interface.
* wrap/python/tests/setxor.py, wrap/python/tests/bddnqueen.py:
Clean all used bdd variables before calling bdd_done(), so that
bdd_delref() is never called after bdd_done(). In NDEBUG builds,
bdd_delref() does not check whether the BuDDy is running or not,
and calling it after bdd_done() will crash.
2011-04-09 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* HACKING: Add an example for using callgrind.
......
# -*- mode: python; coding: iso-8859-1 -*-
# Copyright (C) 2003, 2004, 2010 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie.
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2010, 2011 Laboratoire de Recherche et Développement
# de l'EPITA.
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6
# (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
# Pierre et Marie Curie.
#
# This file is part of Spot, a model checking library.
#
......@@ -97,4 +99,8 @@ solution = bdd_satone(queen)
bdd_printset(solution)
print
# Cleanup all BDD variables before calling bdd_done(), otherwise
# bdd_delref will be called after bdd_done() and this is unsafe in
# optimized builds.
X = e = queen = solution = 0
bdd_done()
# -*- mode: python; coding: iso-8859-1 -*-
# Copyright (C) 2010 Laboratoire de Recherche et Dveloppement de l'EPITA.
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2010, 2011 Laboratoire de Recherche et Développement
# de l'EPITA.
#
# This file is part of Spot, a model checking library.
#
......@@ -43,4 +44,8 @@ e = V[0] & V[1] & -V[2] & -V[3] & V[4]
assert(e == bdd_setxor(a,d))
assert(e == bdd_setxor(d,a))
# Cleanup all BDD variables before calling bdd_done(), otherwise
# bdd_delref will be called after bdd_done() and this is unsafe in
# optimized builds.
V = a = b = c = d = e = 0;
bdd_done()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment