From a55801c223fc8e8df84a15588607f58c1587d700 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sat, 11 Nov 2017 08:45:29 +0100 Subject: [PATCH 1/9] fix some g++-snapshot warnings * spot/twaalgos/couvreurnew.cc: explicit operator bool is not used by return. --- spot/twaalgos/couvreurnew.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spot/twaalgos/couvreurnew.cc b/spot/twaalgos/couvreurnew.cc index d99282400..4f90d9b2d 100644 --- a/spot/twaalgos/couvreurnew.cc +++ b/spot/twaalgos/couvreurnew.cc @@ -613,14 +613,14 @@ namespace spot } // Handy cast operators. - // Note that a pointer can be cast to a Boolean as usual. operator bool() const { if (tag == BOOL) return res; else - return ecr; + return !!ecr; } + operator emptiness_check_result_ptr() const { if (tag == PTR) From 544d63f2f2f2e90156d9916ea3f0ec2c2971e3d2 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Fri, 17 Nov 2017 17:50:26 +0100 Subject: [PATCH 2/9] couvreur99_new: fix two memory leaks found by ASAN This only occurs when doing the emptiness check of twa with allocated states. * spot/twaalgos/couvreurnew.cc: Here. * NEWS: Mention the bug. --- NEWS | 5 ++++- spot/twaalgos/couvreurnew.cc | 27 ++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 7ac09a585..99374ebd1 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ New in spot 2.4.2.dev (not yet released) - Nothing yet. + Bug fixes: + + - couvreur99_new() leaked memory when processing TωA that allocate + states. New in spot 2.4.2 (2017-11-07) diff --git a/spot/twaalgos/couvreurnew.cc b/spot/twaalgos/couvreurnew.cc index 4f90d9b2d..3f9fcc780 100644 --- a/spot/twaalgos/couvreurnew.cc +++ b/spot/twaalgos/couvreurnew.cc @@ -94,7 +94,7 @@ namespace spot using state_t = const state*; using iterator_t = twa_succ_iterator*; template - using state_map = state_map; + using state_map = spot::state_map; template static @@ -290,6 +290,11 @@ namespace spot init(); } + ~couvreur99_new_status() + { + uninit(); + } + automaton_ptr aut; std::stack root; typename T::template state_map h; @@ -304,10 +309,26 @@ namespace spot h.resize(aut->num_states(), 0); } + template + typename std::enable_if::type + uninit() + { + } + template typename std::enable_if::type init() - {} + { + } + + template + typename std::enable_if::type + uninit() + { + auto i = h.begin(); + while (i != h.end()) + i++->first->destroy(); + } }; template @@ -723,7 +744,6 @@ namespace spot // We have a successor to look at. inc_transitions(); // Fetch the values we are interested in... - state_t dest = succ->dst(); auto acc = succ->acc(); if (!need_accepting_run) if (strength == TERMINAL && ecs_->aut->acc().accepting(acc)) @@ -739,6 +759,7 @@ namespace spot // We do not need an accepting run. return true; } + state_t dest = succ->dst(); // ... and point the iterator to the next successor, for // the next iteration. todo.top().second->next(); From d967dcb155f245f0b926133474ad5d8324cdab17 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Fri, 17 Nov 2017 17:22:02 +0100 Subject: [PATCH 3/9] fix ASAN reports about mismatched emplace new/delete * spot/misc/bitvect.cc, spot/misc/bitvect.hh, spot/tl/formula.cc, spot/tl/formula.hh: Here. * NEWS: Mention the bug. --- NEWS | 2 ++ spot/misc/bitvect.cc | 12 ++++++------ spot/misc/bitvect.hh | 16 ++++++++++++++-- spot/tl/formula.cc | 15 ++++++++------- spot/tl/formula.hh | 4 ++-- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/NEWS b/NEWS index 99374ebd1..dbad3d5a9 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ New in spot 2.4.2.dev (not yet released) - couvreur99_new() leaked memory when processing TωA that allocate states. + - Some mismatched placement-new/delete reported by ASAN were fixed. + New in spot 2.4.2 (2017-11-07) Tools: diff --git a/spot/misc/bitvect.cc b/spot/misc/bitvect.cc index 021c3eecf..fafb9c350 100644 --- a/spot/misc/bitvect.cc +++ b/spot/misc/bitvect.cc @@ -1,5 +1,5 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement +// Copyright (C) 2013, 2014, 2017 Laboratoire de Recherche et Développement // de l'Epita (LRDE). // // This file is part of Spot, a model checking library. @@ -108,8 +108,8 @@ namespace spot // Allocate some memory for the bitvect. The instance // already contains one int of local_storage_, but // we allocate n-1 more so that we store the table. - void* mem = operator new(sizeof(bitvect) - + (n - 1) * sizeof(bitvect::block_t)); + void* mem = ::operator new(sizeof(bitvect) + + (n - 1) * sizeof(bitvect::block_t)); bitvect* res = new(mem) bitvect(size_, n, true); memcpy(res->storage_, storage_, res->block_count_ * sizeof(block_t)); return res; @@ -143,8 +143,8 @@ namespace spot // Allocate some memory for the bitvect. The instance // already contains one int of local_storage_, but // we allocate n-1 more so that we store the table. - void* mem = operator new(sizeof(bitvect) - + (n - 1) * sizeof(bitvect::block_t)); + void* mem = ::operator new(sizeof(bitvect) + + (n - 1) * sizeof(bitvect::block_t)); return new(mem) bitvect(bitcount, n); } @@ -156,7 +156,7 @@ namespace spot size_t bvsize = sizeof(bitvect) + (n - 1) * sizeof(bitvect::block_t); // Allocate the bitvect_array with enough space at the end // to store all bitvect instances. - void* mem = operator new(sizeof(bitvect_array) + bvsize * vectcount); + void* mem = ::operator new(sizeof(bitvect_array) + bvsize * vectcount); bitvect_array* bva = new(mem) bitvect_array(vectcount, bvsize); // Initialize all the bitvect instances. for (size_t i = 0; i < vectcount; ++i) diff --git a/spot/misc/bitvect.hh b/spot/misc/bitvect.hh index 210486a99..721aa9956 100644 --- a/spot/misc/bitvect.hh +++ b/spot/misc/bitvect.hh @@ -1,6 +1,6 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2013, 2014, 2015, 2016 Laboratoire de Recherche et -// Développement de l'Epita (LRDE). +// Copyright (C) 2013-2017 Laboratoire de Recherche et Développement +// de l'Epita (LRDE). // // This file is part of Spot, a model checking library. // @@ -76,6 +76,12 @@ namespace spot bitvect* clone() const; + void operator delete(void *ptr) + { + // This object was allocated using a placement new. + ::operator delete(ptr); + } + void make_empty() { size_ = 0; @@ -398,6 +404,12 @@ namespace spot at(i).~bitvect(); } + void operator delete(void *ptr) + { + // This object was allocated using a placement new. + ::operator delete(ptr); + } + /// The number of bitvect in the array. size_t size() const { diff --git a/spot/tl/formula.cc b/spot/tl/formula.cc index 2a5238a95..bc78e7108 100644 --- a/spot/tl/formula.cc +++ b/spot/tl/formula.cc @@ -124,7 +124,7 @@ namespace spot } } - const fnode* fnode::unique(const fnode* f) + const fnode* fnode::unique(fnode* f) { auto ires = m.uniq.emplace(f); if (!ires.second) @@ -132,7 +132,8 @@ namespace spot //(*ires.first)->dump(std::cerr << "UNI: ") << '\n'; for (auto c: *f) c->destroy(); - delete f; + f->~fnode(); + ::operator delete(f); return (*ires.first)->clone(); } //f->dump(std::cerr << "INS: ") << '\n'; @@ -158,7 +159,8 @@ namespace spot for (auto c: *this) c->destroy(); } - delete this; + this->~fnode(); + ::operator delete(const_cast(this)); } void @@ -615,9 +617,8 @@ namespace spot v.insert(v.begin(), tt()); } - - auto mem = operator new(sizeof(fnode) - + (v.size() - 1)*sizeof(*children)); + auto mem = ::operator new(sizeof(fnode) + + (v.size() - 1)*sizeof(*children)); return unique(new(mem) fnode(o, v.begin(), v.end())); } @@ -1029,7 +1030,7 @@ namespace spot SPOT_UNREACHABLE(); } - auto mem = operator new(sizeof(fnode) + sizeof(*children)); + auto mem = ::operator new(sizeof(fnode) + sizeof(*children)); return unique(new(mem) fnode(o, {first, second})); } diff --git a/spot/tl/formula.hh b/spot/tl/formula.hh index 28c04216e..ac6368255 100644 --- a/spot/tl/formula.hh +++ b/spot/tl/formula.hh @@ -1,5 +1,5 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2015, 2016 Laboratoire de Recherche et Développement de +// Copyright (C) 2015, 2016, 2017 Laboratoire de Recherche et Développement de // l'Epita (LRDE). // // This file is part of Spot, a model checking library. @@ -484,7 +484,7 @@ namespace spot [[noreturn]] static void report_min_invalid_arg(); [[noreturn]] static void report_max_invalid_arg(); - static const fnode* unique(const fnode*); + static const fnode* unique(fnode*); // Destruction may only happen via destroy(). ~fnode() = default; From 0fabd6b7fbb948b721b966da99be912526778175 Mon Sep 17 00:00:00 2001 From: Maximilien Colange Date: Wed, 22 Nov 2017 11:08:20 +0100 Subject: [PATCH 4/9] Fix a typo in a test * tests/sanity/namedprop.test: fix typo for proper output --- tests/sanity/namedprop.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sanity/namedprop.test b/tests/sanity/namedprop.test index a21e2c224..864d603d3 100755 --- a/tests/sanity/namedprop.test +++ b/tests/sanity/namedprop.test @@ -47,7 +47,7 @@ while read prop; do fi done if test -f namedprop.log; then - echo "The following named properties are not documented in $ORG:" + echo "The following named properties are not documented in $DOC:" cat namedprop.log exit 1 fi From 24a98b17363338c5b99d40c95a3763ddc4b4f893 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 22 Nov 2017 09:58:29 +0100 Subject: [PATCH 5/9] fix usage pf importlib.util.find_spec for newer pythons * tests/python/ipnbdoctest.py: Here. It seems importlib does not load importlib.util anymore. --- tests/python/ipnbdoctest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/ipnbdoctest.py b/tests/python/ipnbdoctest.py index eb4256cf2..3af3790eb 100755 --- a/tests/python/ipnbdoctest.py +++ b/tests/python/ipnbdoctest.py @@ -22,7 +22,7 @@ except ImportError: print('Python 3.x is needed to run this script.') sys.exit(77) -import importlib +import importlib.util try: importlib.util.find_spec('IPython') except: From 89e1dbc3c8be25109293a5aa33a0d8a057a867ae Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 28 Nov 2017 11:23:42 +0100 Subject: [PATCH 6/9] bin: do not redefine argp_bug_address This prevented static compilation on MinGW. * bin/common_setup.cc: Here. --- bin/common_setup.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/common_setup.cc b/bin/common_setup.cc index 4d7c518e8..ac0b3f000 100644 --- a/bin/common_setup.cc +++ b/bin/common_setup.cc @@ -28,8 +28,6 @@ #include #include -const char* argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; - static void display_version(FILE *stream, struct argp_state*) { @@ -82,9 +80,12 @@ static void setup_sig_handler() void setup(char** argv) { + argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; + // Simplify the program name, because argp() uses it to report // errors and display help text. set_program_name(argv[0]); + argv[0] = const_cast(program_name); argp_program_version_hook = display_version; From 7500962c3d67c0724ea517dd705ccc58d39e3c08 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 28 Nov 2017 18:22:32 +0100 Subject: [PATCH 7/9] org: fix URL to last successful build * doc/org/install.org: Here. --- doc/org/install.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/org/install.org b/doc/org/install.org index 51d6b7d51..61be4978e 100644 --- a/doc/org/install.org +++ b/doc/org/install.org @@ -11,7 +11,7 @@ The latest release of Spot is version {{{LASTRELEASE}}}: - {{{LASTTARBALL}}} (see also the {{{LASTNEWS}}}) Past releases can be found [[https://www.lrde.epita.fr/dload/spot/][in the same directory]]. If you are -interested in /future/ releases, you can always peek at the [[http://teamcity.lrde.epita.fr/viewLog.html?buildTypeId%3Dbt16&buildId%3DlastFinished&buildBranch%3Dnext&tab%3Dartifacts&guest%3D1][last +interested in /future/ releases, you can always peek at the [[http://teamcity.lrde.epita.fr/viewLog.html?buildTypeId=bt16&buildId=lastFinished&buildBranch=next&tab=artifacts&guest=1][last successful development build]]. ** Requirements From 325d3f921fae206abbdd4d8c481090fbc9a7f673 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 19 Dec 2017 10:12:13 +0100 Subject: [PATCH 8/9] Release Spot 2.4.3 * NEWS, configure.ac, doc/org/setup.org: Update. --- NEWS | 11 +++++++++-- configure.ac | 2 +- doc/org/setup.org | 10 +++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index dbad3d5a9..a38c353c7 100644 --- a/NEWS +++ b/NEWS @@ -1,12 +1,19 @@ -New in spot 2.4.2.dev (not yet released) +New in spot 2.4.3 (2017-12-19) - Bug fixes: + Bugs fixed: - couvreur99_new() leaked memory when processing TωA that allocate states. - Some mismatched placement-new/delete reported by ASAN were fixed. + - Static compilation was broken on MinGW. + + - Execution of Jupyter notebooks from the testsuite failed with + recent versions of Python. + + - Fix some warnings triggered by the development version of g++. + New in spot 2.4.2 (2017-11-07) Tools: diff --git a/configure.ac b/configure.ac index 420b42df2..e0068f184 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ # along with this program. If not, see . AC_PREREQ([2.61]) -AC_INIT([spot], [2.4.2.dev], [spot@lrde.epita.fr]) +AC_INIT([spot], [2.4.3], [spot@lrde.epita.fr]) AC_CONFIG_AUX_DIR([tools]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([1.11 gnu tar-ustar color-tests parallel-tests]) diff --git a/doc/org/setup.org b/doc/org/setup.org index a59a432b3..96ab4dc45 100644 --- a/doc/org/setup.org +++ b/doc/org/setup.org @@ -1,8 +1,8 @@ #+OPTIONS: H:2 num:nil toc:t html-postamble:nil #+EMAIL: spot@lrde.epita.fr #+HTML_LINK_HOME: index.html -#+MACRO: SPOTVERSION 2.4.2 -#+MACRO: LASTRELEASE 2.4.2 -#+MACRO: LASTTARBALL [[http://www.lrde.epita.fr/dload/spot/spot-2.4.2.tar.gz][=spot-2.4.2.tar.gz=]] -#+MACRO: LASTNEWS [[https://gitlab.lrde.epita.fr/spot/spot/blob/spot-2-4-2/NEWS][summary of the changes]] -#+MACRO: LASTDATE 2017-11-07 +#+MACRO: SPOTVERSION 2.4.3 +#+MACRO: LASTRELEASE 2.4.3 +#+MACRO: LASTTARBALL [[http://www.lrde.epita.fr/dload/spot/spot-2.4.3.tar.gz][=spot-2.4.3.tar.gz=]] +#+MACRO: LASTNEWS [[https://gitlab.lrde.epita.fr/spot/spot/blob/spot-2-4-3/NEWS][summary of the changes]] +#+MACRO: LASTDATE 2017-12-19 From 696d81f65174392c13b92f58f6bf5ce42e40d00f Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 19 Dec 2017 10:17:40 +0100 Subject: [PATCH 9/9] Bump version number * configure.ac, NEWS: Update to 2.4.3.dev. --- NEWS | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a38c353c7..497965b7f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +New in spot 2.4.3.dev (not yet released) + + Nothing yet. + New in spot 2.4.3 (2017-12-19) Bugs fixed: diff --git a/configure.ac b/configure.ac index e0068f184..e547ca657 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ # along with this program. If not, see . AC_PREREQ([2.61]) -AC_INIT([spot], [2.4.3], [spot@lrde.epita.fr]) +AC_INIT([spot], [2.4.3.dev], [spot@lrde.epita.fr]) AC_CONFIG_AUX_DIR([tools]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([1.11 gnu tar-ustar color-tests parallel-tests])