Bug#857180: unblock: libosmium/2.11.1-1

Bas Couwenberg sebastic at xs4all.nl
Wed Mar 8 15:56:46 UTC 2017


Package: release.debian.org
Severity: normal
User: release.debian.org at packages.debian.org
Usertags: unblock

Please unblock package libosmium

Upstream has only fixed bugs for this release in line with the freeze policy.

unblock libosmium/2.11.1-1
-------------- next part --------------
diff -Nru libosmium-2.11.0/CHANGELOG.md libosmium-2.11.1/CHANGELOG.md
--- libosmium-2.11.0/CHANGELOG.md	2017-01-14 11:50:34.000000000 +0100
+++ libosmium-2.11.1/CHANGELOG.md	2017-03-07 13:54:48.000000000 +0100
@@ -6,12 +6,18 @@
 
 ## [unreleased] -
 
-### Added
+### Fixed
 
-### Changed
+
+## [2.11.1] - 2017-03-07
 
 ### Fixed
 
+- Terminate called on full non-auto-growing buffer. (Issue #189.)
+- When file formats were used that were not compiled into the binary, it
+  terminated instead of throwing. (Issue #197.)
+- The `Filter::count()` method didn't compile at all.
+
 
 ## [2.11.0] - 2017-01-14
 
@@ -525,7 +531,9 @@
   Doxygen (up to version 1.8.8). This version contains a workaround to fix
   this.
 
-[unreleased]: https://github.com/osmcode/libosmium/compare/v2.10.3...HEAD
+[unreleased]: https://github.com/osmcode/libosmium/compare/v2.11.1...HEAD
+[2.11.1]: https://github.com/osmcode/libosmium/compare/v2.11.0...v2.11.1
+[2.11.0]: https://github.com/osmcode/libosmium/compare/v2.10.3...v2.11.0
 [2.10.3]: https://github.com/osmcode/libosmium/compare/v2.10.2...v2.10.3
 [2.10.2]: https://github.com/osmcode/libosmium/compare/v2.10.1...v2.10.2
 [2.10.1]: https://github.com/osmcode/libosmium/compare/v2.10.0...v2.10.1
diff -Nru libosmium-2.11.0/CMakeLists.txt libosmium-2.11.1/CMakeLists.txt
--- libosmium-2.11.0/CMakeLists.txt	2017-01-14 11:50:34.000000000 +0100
+++ libosmium-2.11.1/CMakeLists.txt	2017-03-07 13:54:48.000000000 +0100
@@ -25,7 +25,7 @@
 
 set(LIBOSMIUM_VERSION_MAJOR 2)
 set(LIBOSMIUM_VERSION_MINOR 11)
-set(LIBOSMIUM_VERSION_PATCH 0)
+set(LIBOSMIUM_VERSION_PATCH 1)
 
 set(LIBOSMIUM_VERSION
     "${LIBOSMIUM_VERSION_MAJOR}.${LIBOSMIUM_VERSION_MINOR}.${LIBOSMIUM_VERSION_PATCH}")
diff -Nru libosmium-2.11.0/debian/changelog libosmium-2.11.1/debian/changelog
--- libosmium-2.11.0/debian/changelog	2017-01-17 18:29:43.000000000 +0100
+++ libosmium-2.11.1/debian/changelog	2017-03-07 18:31:00.000000000 +0100
@@ -1,3 +1,17 @@
+libosmium (2.11.1-1) unstable; urgency=medium
+
+  * New upstream bugfix release.
+    - Fix the Filter::count() method.
+    - Bugfix: Terminate called on full buffer.
+      See: https://github.com/osmcode/libosmium/issues/189
+    - Add test for not correctly handled unsupported_file_format_error.
+      See: https://github.com/osmcode/libosmium/issues/197
+    - Bugfix: Call get_creator_function() in main thread.
+      See: https://github.com/osmcode/libosmium/issues/197
+  * Update gbp.conf to use upstream-2.11 branch.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 07 Mar 2017 18:31:00 +0100
+
 libosmium (2.11.0-1) unstable; urgency=medium
 
   * Move from experimental to unstable.
diff -Nru libosmium-2.11.0/debian/gbp.conf libosmium-2.11.1/debian/gbp.conf
--- libosmium-2.11.0/debian/gbp.conf	2016-11-26 10:23:21.000000000 +0100
+++ libosmium-2.11.1/debian/gbp.conf	2017-03-07 18:31:00.000000000 +0100
@@ -2,7 +2,7 @@
 
 # The default name for the upstream branch is "upstream".
 # Change it if the name is different (for instance, "master").
-upstream-branch = upstream
+upstream-branch = upstream-2.11
 
 # The default name for the Debian branch is "master".
 # Change it if the name is different (for instance, "debian/unstable").
diff -Nru libosmium-2.11.0/include/osmium/builder/builder.hpp libosmium-2.11.1/include/osmium/builder/builder.hpp
--- libosmium-2.11.0/include/osmium/builder/builder.hpp	2017-01-14 11:50:34.000000000 +0100
+++ libosmium-2.11.1/include/osmium/builder/builder.hpp	2017-03-07 13:54:48.000000000 +0100
@@ -168,6 +168,20 @@
             }
 
             /**
+             * Append data to buffer and append an additional \0.
+             *
+             * @param data Pointer to data.
+             * @param length Length of data in bytes.
+             * @returns The number of bytes appended (length + 1).
+             */
+            osmium::memory::item_size_type append_with_zero(const char* data, const osmium::memory::item_size_type length) {
+                unsigned char* target = reserve_space(length + 1);
+                std::copy_n(reinterpret_cast<const unsigned char*>(data), length, target);
+                target[length] = '\0';
+                return length + 1;
+            }
+
+            /**
              * Append \0-terminated string to buffer.
              *
              * @param str \0-terminated string.
@@ -180,9 +194,11 @@
             /**
              * Append '\0' to the buffer.
              *
+             * @deprecated Use append_with_zero() instead.
+             *
              * @returns The number of bytes appended (always 1).
              */
-            osmium::memory::item_size_type append_zero() {
+            OSMIUM_DEPRECATED osmium::memory::item_size_type append_zero() {
                 *reserve_space(1) = '\0';
                 return 1;
             }
diff -Nru libosmium-2.11.0/include/osmium/builder/osm_object_builder.hpp libosmium-2.11.1/include/osmium/builder/osm_object_builder.hpp
--- libosmium-2.11.0/include/osmium/builder/osm_object_builder.hpp	2017-01-14 11:50:34.000000000 +0100
+++ libosmium-2.11.1/include/osmium/builder/osm_object_builder.hpp	2017-03-07 13:54:48.000000000 +0100
@@ -99,7 +99,8 @@
                 if (std::strlen(value) > osmium::max_osm_string_length) {
                     throw std::length_error("OSM tag value is too long");
                 }
-                add_size(append(key) + append(value));
+                add_size(append(key));
+                add_size(append(value));
             }
 
             /**
@@ -117,8 +118,8 @@
                 if (value_length > osmium::max_osm_string_length) {
                     throw std::length_error("OSM tag value is too long");
                 }
-                add_size(append(key,   osmium::memory::item_size_type(key_length))   + append_zero() +
-                         append(value, osmium::memory::item_size_type(value_length)) + append_zero());
+                add_size(append_with_zero(key,   osmium::memory::item_size_type(key_length)));
+                add_size(append_with_zero(value, osmium::memory::item_size_type(value_length)));
             }
 
             /**
@@ -134,8 +135,8 @@
                 if (value.size() > osmium::max_osm_string_length) {
                     throw std::length_error("OSM tag value is too long");
                 }
-                add_size(append(key.data(),   osmium::memory::item_size_type(key.size())   + 1) +
-                         append(value.data(), osmium::memory::item_size_type(value.size()) + 1));
+                add_size(append(key.data(),   osmium::memory::item_size_type(key.size())   + 1));
+                add_size(append(value.data(), osmium::memory::item_size_type(value.size()) + 1));
             }
 
             /**
@@ -144,7 +145,8 @@
              * @param tag Tag.
              */
             void add_tag(const osmium::Tag& tag) {
-                add_size(append(tag.key()) + append(tag.value()));
+                add_size(append(tag.key()));
+                add_size(append(tag.value()));
             }
 
             /**
@@ -226,7 +228,7 @@
                     throw std::length_error("OSM relation member role is too long");
                 }
                 member.set_role_size(osmium::string_size_type(length) + 1);
-                add_size(append(role, osmium::memory::item_size_type(length)) + append_zero());
+                add_size(append_with_zero(role, osmium::memory::item_size_type(length)));
                 add_padding(true);
             }
 
@@ -310,7 +312,7 @@
                     throw std::length_error("OSM user name is too long");
                 }
                 comment.set_user_size(osmium::string_size_type(length) + 1);
-                add_size(append(user, osmium::memory::item_size_type(length)) + append_zero());
+                add_size(append_with_zero(user, osmium::memory::item_size_type(length)));
             }
 
             void add_text(osmium::ChangesetComment& comment, const char* text, const size_t length) {
@@ -322,7 +324,7 @@
                     throw std::length_error("OSM changeset comment is too long");
                 }
                 comment.set_text_size(osmium::string_size_type(length) + 1);
-                add_size(append(text, osmium::memory::item_size_type(length)) + append_zero());
+                add_size(append_with_zero(text, osmium::memory::item_size_type(length)));
                 add_padding(true);
             }
 
diff -Nru libosmium-2.11.0/include/osmium/io/reader.hpp libosmium-2.11.1/include/osmium/io/reader.hpp
--- libosmium-2.11.0/include/osmium/io/reader.hpp	2017-01-14 11:50:34.000000000 +0100
+++ libosmium-2.11.1/include/osmium/io/reader.hpp	2017-03-07 13:54:48.000000000 +0100
@@ -92,6 +92,8 @@
 
             osmium::io::File m_file;
 
+            detail::ParserFactory::create_parser_type m_creator;
+
             enum class status {
                 okay   = 0, // normal reading
                 error  = 1, // some error occurred while reading
@@ -128,13 +130,12 @@
             }
 
             // This function will run in a separate thread.
-            static void parser_thread(const osmium::io::File& file,
+            static void parser_thread(const detail::ParserFactory::create_parser_type& creator,
                                       detail::future_string_queue_type& input_queue,
                                       detail::future_buffer_queue_type& osmdata_queue,
                                       std::promise<osmium::io::Header>&& header_promise,
                                       osmium::io::detail::reader_options options) {
                 std::promise<osmium::io::Header> promise = std::move(header_promise);
-                const auto creator = detail::ParserFactory::instance().get_creator_function(file);
                 const auto parser = creator(input_queue, osmdata_queue, promise, options);
                 parser->parse();
             }
@@ -236,6 +237,7 @@
             template <typename... TArgs>
             explicit Reader(const osmium::io::File& file, TArgs&&... args) :
                 m_file(file.check()),
+                m_creator(detail::ParserFactory::instance().get_creator_function(m_file)),
                 m_status(status::okay),
                 m_childpid(0),
                 m_input_queue(detail::get_input_queue_size(), "raw_input"),
@@ -256,7 +258,7 @@
 
                 std::promise<osmium::io::Header> header_promise;
                 m_header_future = header_promise.get_future();
-                m_thread = osmium::thread::thread_handler{parser_thread, std::ref(m_file), std::ref(m_input_queue), std::ref(m_osmdata_queue), std::move(header_promise), m_options};
+                m_thread = osmium::thread::thread_handler{parser_thread, std::ref(m_creator), std::ref(m_input_queue), std::ref(m_osmdata_queue), std::move(header_promise), m_options};
             }
 
             template <typename... TArgs>
diff -Nru libosmium-2.11.0/include/osmium/tags/filter.hpp libosmium-2.11.1/include/osmium/tags/filter.hpp
--- libosmium-2.11.0/include/osmium/tags/filter.hpp	2017-01-14 11:50:34.000000000 +0100
+++ libosmium-2.11.1/include/osmium/tags/filter.hpp	2017-03-07 13:54:48.000000000 +0100
@@ -140,7 +140,7 @@
              * Return the number of rules in this filter.
              */
             size_t count() const {
-                return m_rules.count();
+                return m_rules.size();
             }
 
             /**
diff -Nru libosmium-2.11.0/include/osmium/version.hpp libosmium-2.11.1/include/osmium/version.hpp
--- libosmium-2.11.0/include/osmium/version.hpp	2017-01-14 11:50:34.000000000 +0100
+++ libosmium-2.11.1/include/osmium/version.hpp	2017-03-07 13:54:48.000000000 +0100
@@ -35,8 +35,8 @@
 
 #define LIBOSMIUM_VERSION_MAJOR 2
 #define LIBOSMIUM_VERSION_MINOR 11
-#define LIBOSMIUM_VERSION_PATCH 0
+#define LIBOSMIUM_VERSION_PATCH 1
 
-#define LIBOSMIUM_VERSION_STRING "2.11.0"
+#define LIBOSMIUM_VERSION_STRING "2.11.1"
 
 #endif // OSMIUM_VERSION_HPP
diff -Nru libosmium-2.11.0/test/CMakeLists.txt libosmium-2.11.1/test/CMakeLists.txt
--- libosmium-2.11.0/test/CMakeLists.txt	2017-01-14 11:50:34.000000000 +0100
+++ libosmium-2.11.1/test/CMakeLists.txt	2017-03-07 13:54:48.000000000 +0100
@@ -167,6 +167,7 @@
 add_unit_test(io test_bzip2 ENABLE_IF ${BZIP2_FOUND} LIBS ${BZIP2_LIBRARIES})
 add_unit_test(io test_file_formats)
 add_unit_test(io test_reader LIBS "${OSMIUM_XML_LIBRARIES};${OSMIUM_PBF_LIBRARIES}")
+add_unit_test(io test_reader_fileformat ENABLE_IF ${Threads_FOUND} LIBS ${CMAKE_THREAD_LIBS_INIT})
 add_unit_test(io test_reader_with_mock_decompression ENABLE_IF ${Threads_FOUND} LIBS ${OSMIUM_XML_LIBRARIES})
 add_unit_test(io test_reader_with_mock_parser ENABLE_IF ${Threads_FOUND} LIBS ${CMAKE_THREAD_LIBS_INIT})
 add_unit_test(io test_opl_parser)
diff -Nru libosmium-2.11.0/test/t/io/test_reader_fileformat.cpp libosmium-2.11.1/test/t/io/test_reader_fileformat.cpp
--- libosmium-2.11.0/test/t/io/test_reader_fileformat.cpp	1970-01-01 01:00:00.000000000 +0100
+++ libosmium-2.11.1/test/t/io/test_reader_fileformat.cpp	2017-03-07 13:54:48.000000000 +0100
@@ -0,0 +1,10 @@
+
+#include "catch.hpp"
+#include "utils.hpp"
+
+#include <osmium/io/reader.hpp>
+
+TEST_CASE("Reader throws on unsupported file format") {
+    REQUIRE_THROWS_AS(osmium::io::Reader{with_data_dir("t/io/data.osm")}, osmium::unsupported_file_format_error);
+}
+


More information about the Pkg-grass-devel mailing list