Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-25776

scoped_db_conn_test sends uninitialized bytes over the wire

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Networking
    • Labels:
      None
    • ALL
    • Service Arch 2022-05-30

      Running Valgrind Memcheck on scoped_db_conn_test shows the issue:

      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.421-0400 2016-08-24T13:17:46.382-0400 I -        [main] going to run suite: DummyServerFixture
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.428-0400 2016-08-24T13:17:46.427-0400 I -        [main] 	 going to run test: BasicScopedDbConnection
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.711-0400 2016-08-24T13:17:46.709-0400 I NETWORK  [thread1] waiting for connections on port 27017
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.730-0400 2016-08-24T13:17:46.729-0400 W NETWORK  [main] Failed to connect to 127.0.0.1:27017, reason: Connection refused
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.750-0400 2016-08-24T13:17:46.749-0400 I NETWORK  [thread1] connection accepted from 127.0.0.1:52040 #1 (1 connection now open)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.852-0400 ==13774== Thread 2:
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.854-0400 ==13774== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.856-0400 ==13774==    at 0x63DB03F: send (send.c:26)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.858-0400 ==13774==    by 0x60C7A3: mongo::Socket::_send(char const*, int, char const*) (sock.cpp:435)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.860-0400 ==13774==    by 0x60C7F9: mongo::Socket::send(char const*, int, char const*) (sock.cpp:454)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.862-0400 ==13774==    by 0x5CFC2D: operator() (transport_layer_legacy.cpp:159)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.865-0400 ==13774==    by 0x5CFC2D: std::_Function_handler<mongo::Status (mongo::AbstractMessagingPort*), mongo::transport::TransportLayerLegacy::sinkMessage(mongo::transport::Session&, mongo::Message const&, mongo::Date_t)::{lambda(mongo::AbstractMessagingPort*)#1}>::_M_invoke(std::_Any_data const&, mongo::AbstractMessagingPort*&&) (functional:1857)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.866-0400 ==13774==    by 0x5D0EE9: operator() (functional:2267)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.869-0400 ==13774==    by 0x5D0EE9: mongo::transport::TransportLayerLegacy::_runTicket(mongo::transport::Ticket) (transport_layer_legacy.cpp:267)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.871-0400 ==13774==    by 0x5D12EE: mongo::transport::TransportLayerLegacy::wait(mongo::transport::Ticket&&) (transport_layer_legacy.cpp:172)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.873-0400 ==13774==    by 0x5CEB16: mongo::transport::Ticket::wait() && (ticket.cpp:57)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.875-0400 ==13774==    by 0x2E6548: mongo::(anonymous namespace)::DummyServiceEntryPoint::run(mongo::transport::Session&&) (scoped_db_conn_test.cpp:118)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.877-0400 ==13774==    by 0x5BE8F1F: execute_native_thread_routine (thread.cc:84)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.879-0400 ==13774==    by 0x63D2619: start_thread (pthread_create.c:334)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.880-0400 ==13774==    by 0x66EB59C: clone (clone.S:109)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.882-0400 ==13774==  Address 0x8651998 is 8 bytes inside a block of size 516 alloc'd
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.884-0400 ==13774==    at 0x4C28BF6: malloc (vg_replace_malloc.c:299)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.886-0400 ==13774==    by 0x5DE09C: mongo::mongoMalloc(unsigned long) (allocator.cpp:39)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.888-0400 ==13774==    by 0x5A3145: allocate (shared_buffer.h:51)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.890-0400 ==13774==    by 0x5A3145: malloc (builder.h:82)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.891-0400 ==13774==    by 0x5A3145: _BufBuilder (builder.h:148)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.893-0400 ==13774==    by 0x5A3145: mongo::rpc::LegacyReplyBuilder::LegacyReplyBuilder(mongo::Message&&) (legacy_reply_builder.cpp:48)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.895-0400 ==13774==    by 0x5A3238: mongo::rpc::LegacyReplyBuilder::LegacyReplyBuilder() (legacy_reply_builder.cpp:46)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.897-0400 ==13774==    by 0x5A0F94: make_unique<mongo::rpc::LegacyReplyBuilder> (make_unique_object.hpp:21)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.899-0400 ==13774==    by 0x5A0F94: mongo::rpc::makeReplyBuilder(mongo::rpc::Protocol) (factory.cpp:95)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.901-0400 ==13774==    by 0x2E6322: mongo::(anonymous namespace)::DummyServiceEntryPoint::run(mongo::transport::Session&&) (scoped_db_conn_test.cpp:102)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.903-0400 ==13774==    by 0x5BE8F1F: execute_native_thread_routine (thread.cc:84)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.905-0400 ==13774==    by 0x63D2619: start_thread (pthread_create.c:334)
      [cpp_unit_test:scoped_db_conn_test] 2016-08-24T13:17:46.907-0400 ==13774==    by 0x66EB59C: clone (clone.S:109)
      

            Assignee:
            daniel.morilha@mongodb.com Daniel Morilha (Inactive)
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: