nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MINIFI-320) In cases where users run TLSSocket, the context will cause a realloc in multiple threads.
Date Thu, 18 May 2017 20:33:04 GMT

    [ https://issues.apache.org/jira/browse/MINIFI-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16016424#comment-16016424
] 

ASF GitHub Bot commented on MINIFI-320:
---------------------------------------

Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/100#discussion_r117346914
  
    --- Diff: libminifi/test/unit/SocketTests.cpp ---
    @@ -183,3 +196,42 @@ TEST_CASE("TestSocketWriteTestAfterClose", "[TestSocket6]") {
       server.closeStream();
     
     }
    +
    +std::atomic<uint8_t> counter;
    +std::mt19937_64 seed { std::random_device { }() };
    +bool createSocket() {
    +  int mine = counter++;
    +  std::shared_ptr<minifi::Configure> configuration = std::make_shared<
    +      minifi::Configure>();
    +
    +  std::uniform_int_distribution<> distribution { 10, 100 };
    +  std::this_thread::sleep_for(std::chrono::milliseconds { distribution(seed) });
    +
    +  for (int i = 0; i < 50; i++) {
    +    std::shared_ptr<TLSContext> socketA = std::make_shared<TLSContext>(
    +        configuration);
    +    socketA->initialize();
    +  }
    +
    +  return true;
    +}
    --- End diff --
    
    add some comments to why this exists. 


> In cases where users run TLSSocket, the context will cause a realloc in multiple threads.

> ------------------------------------------------------------------------------------------
>
>                 Key: MINIFI-320
>                 URL: https://issues.apache.org/jira/browse/MINIFI-320
>             Project: Apache NiFi MiNiFi
>          Issue Type: Bug
>          Components: C++
>            Reporter: marco polo
>            Priority: Blocker
>             Fix For: cpp-0.3.0
>
>
> An example stacktrace. . We can either move *back* to a singleton of simply move the
ssl library initialization to a better place. 
> #0 0x10122d520 in wrap_realloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x56520)
>     #1 0x100fe80ae in CRYPTO_realloc (libcrypto.1.0.0.dylib:x86_64+0x20ae)
>     #2 0x10109880c in lh_insert (libcrypto.1.0.0.dylib:x86_64+0xb280c)
>     #3 0x100fea6e7 in OBJ_NAME_add (libcrypto.1.0.0.dylib:x86_64+0x46e7)
>     #4 0x1010a5b41 in OpenSSL_add_all_ciphers (libcrypto.1.0.0.dylib:x86_64+0xbfb41)
>     #5 0x1010a58d1 in OPENSSL_add_all_algorithms_noconf (libcrypto.1.0.0.dylib:x86_64+0xbf8d1)
>     #6 0x10012ad40 in org::apache::nifi::minifi::io::TLSContext::initialize() TLSSocket.cpp:60
>     #7 0x100132255 in org::apache::nifi::minifi::io::TLSSocket::initialize() TLSSocket.cpp:166
>     #8 0x100677a68 in org::apache::nifi::minifi::Site2SitePeer::Open() Site2SitePeer.cpp:42
>     #9 0x100631543 in org::apache::nifi::minifi::Site2SiteClientProtocol::establish()
Site2SiteClientProtocol.cpp:46
>     #10 0x10063e9ff in org::apache::nifi::minifi::Site2SiteClientProtocol::bootstrap()
Site2SiteClientProtocol.cpp:483
>     #11 0x100600880 in org::apache::nifi::minifi::RemoteProcessorGroupPort::onTrigger(org::apache::nifi::minifi::core::ProcessContext*,
org::apache::nifi::minifi::core::ProcessSession*) RemoteProcessorGroupPort.cpp:148
>     #12 0x1002c1a3a in org::apache::nifi::minifi::core::Processor::onTrigger(org::apache::nifi::minifi::core::ProcessContext*,
org::apache::nifi::minifi::core::ProcessSessionFactory*) Processor.cpp:235
>     #13 0x10062cc20 in org::apache::nifi::minifi::SchedulingAgent::onTrigger(std::__1::shared_ptr<org::apache::nifi::minifi::core::Processor>,
org::apache::nifi::minifi::core::ProcessContext*, org::apache::nifi::minifi::core::ProcessSessionFactory*)
SchedulingAgent.cpp:66
>     #14 0x10069b933 in org::apache::nifi::minifi::TimerDrivenSchedulingAgent::run(std::__1::shared_ptr<org::apache::nifi::minifi::core::Processor>,
org::apache::nifi::minifi::core::ProcessContext*, org::apache::nifi::minifi::core::ProcessSessionFactory*)
TimerDrivenSchedulingAgent.cpp:37
>     #15 0x100690205 in org::apache::nifi::minifi::ThreadedSchedulingAgent::schedule(std::__1::shared_ptr<org::apache::nifi::minifi::core::Processor>)::$_0::operator()()
const ThreadedSchedulingAgent.cpp:97
>     #16 0x10068f37d in void* std::__1::__thread_proxy<std::__1::tuple<org::apache::nifi::minifi::ThreadedSchedulingAgent::schedule(std::__1::shared_ptr<org::apache::nifi::minifi::core::Processor>)::$_0>
>(void*) __functional_base:416
>     #17 0x7fffb45cf9ae in _pthread_body (libsystem_pthread.dylib:x86_64+0x39ae)
>     #18 0x7fffb45cf8fa in _pthread_start (libsystem_pthread.dylib:x86_64+0x38fa)
>     #19 0x7fffb45cf100 in thread_start (libsystem_pthread.dylib:x86_64+0x3100)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message