You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/09/07 14:32:27 UTC

[1/2] qpid-proton git commit: PROTON-1574: Fix AddressSanitizer: stack-use-after-scope

Repository: qpid-proton
Updated Branches:
  refs/heads/master d7ba57b6a -> c870da9fa


PROTON-1574: Fix AddressSanitizer: stack-use-after-scope

This is a strange error and probably a false one, but this fix removes it and is
otherwise harmless.

8: TEST: (coerce_test<V>())
8: =================================================================
8: ==522==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffc0fb69b78 at pc 0x7f67732cfde3 bp 0x7ffc0fb69a70 sp 0x7ffc0fb69a68
8: WRITE of size 8 at 0x7ffc0fb69b78 thread T0
8:     #0 0x7f67732cfde2 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_Vector_impl::_Vector_impl() /nix/store/pdidaf83cvkrgx8xjgjdnl5m1naqjbfk-gcc-7.1.0/include/c++/7.1.0/bits/stl_vector.h:89
8:     #1 0x7f67732cfde2 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_Vector_base() /nix/store/pdidaf83cvkrgx8xjgjdnl5m1naqjbfk-gcc-7.1.0/include/c++/7.1.0/bits/stl_vector.h:127
8:     #2 0x7f67732cfde2 in std::vector<unsigned char, std::allocator<unsigned char> >::vector() /nix/store/pdidaf83cvkrgx8xjgjdnl5m1naqjbfk-gcc-7.1.0/include/c++/7.1.0/bits/stl_vector.h:263
8:     #3 0x7f67732cfde2 in proton::binary::binary() /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/include/proton/binary.hpp:41
8:     #4 0x7f67732cfde2 in proton::scalar_base::scalar_base() /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/src/scalar_base.cpp:36
8:     #5 0x53022f in proton::scalar::scalar() /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/include/proton/./scalar.hpp:35
8:     #6 0x53022f in void proton::coerce<double>(proton::value const&, double&) /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/include/proton/./value.hpp:151
8:     #7 0x621343 in double proton::coerce<double>(proton::value const&) /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/include/proton/./value.hpp:141
8:     #8 0x621343 in void test::coerce_test<proton::value>() /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/src/include/scalar_test.hpp:129
8:     #9 0x67c623 in void test::scalar_test_group<proton::value>(int&) /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/src/include/scalar_test.hpp:202
8:     #10 0x41e5b7 in main /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/src/value_test.cpp:83
8:     #11 0x7f677042752f in __libc_start_main (/nix/store/l48biijfr1j6d5kdg911051x2phfjrz7-glibc-2.25/lib/libc.so.6+0x2052f)
8:     #12 0x439119 in _start (/home/jdanek/Work/repos/qpid-proton/build_sanitizers/proton-c/bindings/cpp/value_test+0x439119)
8:
8: Address 0x7ffc0fb69b78 is located in stack of thread T0 at offset 184 in frame
8:     #0 0x53011f in void proton::coerce<double>(proton::value const&, double&) /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/include/proton/./value.hpp:148
8:
8:   This frame has 3 object(s):
8:     [32, 33) '<unknown>'
8:     [96, 112) 'd'
8:     [160, 208) 's' <== Memory access at offset 184 is inside this variable


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/c99ab4a2
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/c99ab4a2
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/c99ab4a2

Branch: refs/heads/master
Commit: c99ab4a267d9f4dc22b2ab1cbd530102002d2160
Parents: d7ba57b
Author: Alan Conway <ac...@redhat.com>
Authored: Thu Sep 7 10:00:02 2017 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Thu Sep 7 10:09:24 2017 -0400

----------------------------------------------------------------------
 proton-c/bindings/cpp/include/proton/value.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c99ab4a2/proton-c/bindings/cpp/include/proton/value.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/value.hpp b/proton-c/bindings/cpp/include/proton/value.hpp
index c1c0835..9ced1af 100644
--- a/proton-c/bindings/cpp/include/proton/value.hpp
+++ b/proton-c/bindings/cpp/include/proton/value.hpp
@@ -147,8 +147,8 @@ template<class T> T coerce(const value& v) { T x; coerce(v, x); return x; }
 /// @relatedalso proton::value
 template<class T> void coerce(const value& v, T& x) {
     codec::decoder d(v, false);
+    scalar s;
     if (type_id_is_scalar(v.type())) {
-        scalar s;
         d >> s;
         x = internal::coerce<T>(s);
     } else {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[2/2] qpid-proton git commit: PROTON-1576: c++: remove link_namer from public API

Posted by ac...@apache.org.
PROTON-1576: c++: remove link_namer from public API

It is an internal detail of our container implementation, does not need to be public.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/c870da9f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/c870da9f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/c870da9f

Branch: refs/heads/master
Commit: c870da9fa02bb884322ca893e22c878b2bc3edca
Parents: c99ab4a
Author: Alan Conway <ac...@redhat.com>
Authored: Thu Sep 7 10:30:11 2017 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Thu Sep 7 10:30:11 2017 -0400

----------------------------------------------------------------------
 .../cpp/include/proton/io/link_namer.hpp        | 51 --------------------
 .../bindings/cpp/src/connection_driver_test.cpp |  2 +-
 .../bindings/cpp/src/include/link_namer.hpp     | 51 ++++++++++++++++++++
 proton-c/bindings/cpp/src/io/link_namer.cpp     |  2 +-
 proton-c/bindings/cpp/src/session.cpp           |  2 +-
 5 files changed, 54 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c870da9f/proton-c/bindings/cpp/include/proton/io/link_namer.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/io/link_namer.hpp b/proton-c/bindings/cpp/include/proton/io/link_namer.hpp
deleted file mode 100644
index e6d84ee..0000000
--- a/proton-c/bindings/cpp/include/proton/io/link_namer.hpp
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef PROTON_IO_LINK_NAMER_HPP
-#define PROTON_IO_LINK_NAMER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "../internal/export.hpp"
-#include <string>
-
-namespace proton {
-
-class connection;
-
-namespace io {
-
-/// **Unsettled API** - Generate default link names that are unique
-/// within a container.  base_container provides a default
-/// implementation.
-class link_namer {
-  public:
-    virtual ~link_namer() {}
-
-    /// Generate a unique link name.
-    virtual std::string link_name() = 0;
-};
-
-/// **Unsettled API** - Set the link_namer to use on a connection.
-PN_CPP_EXTERN void set_link_namer(connection&, link_namer&);
-
-} // io
-} // proton
-
-#endif // PROTON_IO_LINK_NAMER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c870da9f/proton-c/bindings/cpp/src/connection_driver_test.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/connection_driver_test.cpp b/proton-c/bindings/cpp/src/connection_driver_test.cpp
index d174454..18d4f6e 100644
--- a/proton-c/bindings/cpp/src/connection_driver_test.cpp
+++ b/proton-c/bindings/cpp/src/connection_driver_test.cpp
@@ -20,11 +20,11 @@
 
 #include "test_bits.hpp"
 #include "proton_bits.hpp"
+#include "link_namer.hpp"
 
 #include "proton/container.hpp"
 #include "proton/connection.hpp"
 #include "proton/io/connection_driver.hpp"
-#include "proton/io/link_namer.hpp"
 #include "proton/link.hpp"
 #include "proton/message.hpp"
 #include "proton/messaging_handler.hpp"

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c870da9f/proton-c/bindings/cpp/src/include/link_namer.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/include/link_namer.hpp b/proton-c/bindings/cpp/src/include/link_namer.hpp
new file mode 100644
index 0000000..d107728
--- /dev/null
+++ b/proton-c/bindings/cpp/src/include/link_namer.hpp
@@ -0,0 +1,51 @@
+#ifndef PROTON_IO_LINK_NAMER_HPP
+#define PROTON_IO_LINK_NAMER_HPP
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "proton/internal/export.hpp"
+#include <string>
+
+namespace proton {
+
+class connection;
+
+namespace io {
+
+/// **Unsettled API** - Generate default link names that are unique
+/// within a container.  base_container provides a default
+/// implementation.
+class link_namer {
+  public:
+    virtual ~link_namer() {}
+
+    /// Generate a unique link name.
+    virtual std::string link_name() = 0;
+};
+
+/// **Unsettled API** - Set the link_namer to use on a connection.
+PN_CPP_EXTERN void set_link_namer(connection&, link_namer&);
+
+} // io
+} // proton
+
+#endif // PROTON_IO_LINK_NAMER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c870da9f/proton-c/bindings/cpp/src/io/link_namer.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/io/link_namer.cpp b/proton-c/bindings/cpp/src/io/link_namer.cpp
index 2ac5402..c8c7c8c 100644
--- a/proton-c/bindings/cpp/src/io/link_namer.cpp
+++ b/proton-c/bindings/cpp/src/io/link_namer.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "proton/io/link_namer.hpp"
+#include "link_namer.hpp"
 
 #include "proton/connection.hpp"
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c870da9f/proton-c/bindings/cpp/src/session.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/session.cpp b/proton-c/bindings/cpp/src/session.cpp
index 4c3932b..d2fb401 100644
--- a/proton-c/bindings/cpp/src/session.cpp
+++ b/proton-c/bindings/cpp/src/session.cpp
@@ -21,12 +21,12 @@
 #include "proton/session.hpp"
 
 #include "proton/connection.hpp"
-#include "proton/io/link_namer.hpp"
 #include "proton/receiver_options.hpp"
 #include "proton/sender_options.hpp"
 #include "proton/session_options.hpp"
 
 #include "contexts.hpp"
+#include "link_namer.hpp"
 #include "proton_bits.hpp"
 
 #include <proton/connection.h>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org